From 0a5a61acb05be3a949ee2cf3656fcf1afd6e2d5a Mon Sep 17 00:00:00 2001 From: Morven Lewis-Everley Date: Thu, 17 Dec 2015 14:23:45 +0000 Subject: [PATCH] Add linking mode to default account menu --- code/control/Users_Account_Controller.php | 11 ++++++++--- templates/Includes/Users_Profile_SideBar.ss | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/code/control/Users_Account_Controller.php b/code/control/Users_Account_Controller.php index 95d9591..5ba3ea3 100755 --- a/code/control/Users_Account_Controller.php +++ b/code/control/Users_Account_Controller.php @@ -160,23 +160,28 @@ public function ChangePasswordForm() { */ public function getAccountMenu() { $menu = new ArrayList(); + + $curr_action = $this->request->param("Action"); $menu->add(new ArrayData(array( "ID" => 0, "Title" => _t('Users.PROFILESUMMARY',"Profile Summary"), - "Link" => $this->Link() + "Link" => $this->Link(), + "LinkingMode" => (!$curr_action) ? "current" : "link" ))); $menu->add(new ArrayData(array( "ID" => 10, "Title" => _t('Users.EDITDETAILS',"Edit account details"), - "Link" => $this->Link("edit") + "Link" => $this->Link("edit"), + "LinkingMode" => ($curr_action == "edit") ? "current" : "link" ))); $menu->add(new ArrayData(array( "ID" => 30, "Title" => _t('Users.CHANGEPASSWORD',"Change password"), - "Link" => $this->Link("changepassword") + "Link" => $this->Link("changepassword"), + "LinkingMode" => ($curr_action == "changepassword") ? "current" : "link" ))); $this->extend("updateAccountMenu", $menu); diff --git a/templates/Includes/Users_Profile_SideBar.ss b/templates/Includes/Users_Profile_SideBar.ss index 3b48b30..08a5c9a 100755 --- a/templates/Includes/Users_Profile_SideBar.ss +++ b/templates/Includes/Users_Profile_SideBar.ss @@ -3,7 +3,7 @@