Skip to content

Commit

Permalink
Add linking mode to default account menu
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewis-everley committed Dec 17, 2015
1 parent 025d205 commit 0a5a61a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions code/control/Users_Account_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion templates/Includes/Users_Profile_SideBar.ss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ul>
<% loop $AccountMenu %>
<li>
<a href="$Link">
<a href="$Link" class="$LinkingMode">
<span class="arrow">&rarr;</span>
<span class="text">$Title</span>
</a>
Expand Down

0 comments on commit 0a5a61a

Please sign in to comment.