Skip to content

Commit

Permalink
MDL-49667 navigation: allow items without branches in the settings menu
Browse files Browse the repository at this point in the history
also remove the code that adds a "return to XXX user" link that was
supposed to be removed in MDL-23911 , otherwise the link would become
visible after the bug fix (but not functional).
  • Loading branch information
marinaglancy committed Jun 16, 2015
1 parent f1a415e commit 034fed3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 0 additions & 2 deletions blocks/settings/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
.block_settings .block_tree .tree_item {padding-left: 21px;margin:3px 0px;text-align:left;}

.block_settings .block_tree .tree_item.branch {background-image: url([[pix:t/expanded]]);background-position: 0 10%;background-repeat: no-repeat;}
.block_settings .block_tree .root_node.leaf {padding-left:0px;}
.block_settings .block_tree .active_tree_node {font-weight:bold;}
.jsenabled .block_settings .block_tree .tree_item.branch {cursor:pointer;}
.jsenabled .block_settings .block_tree .tree_item.emptybranch {background-image: url([[pix:t/collapsed_empty]]);background-position: 0 10%;background-repeat: no-repeat;}
Expand All @@ -29,7 +28,6 @@
.dir-rtl .block_settings .block_tree li ul {padding-left:0;padding-right: 18px;}
.dir-rtl .block_settings .block_tree .tree_item {padding-right: 21px; padding-left: 0; text-align:right;}
.dir-rtl .block_settings .block_tree .tree_item.branch {background-position: center right;}
.dir-rtl .block_settings .block_tree .root_node.leaf {padding-right:0px;}
.dir-rtl .block_settings .block_tree li.item_with_icon > p img { right: 0; left: auto;}
.jsenabled .block_settings .block_tree .tree_item.branch.loadingbranch {background-image:url([[pix:i/loading_small]]);}

Expand Down
11 changes: 1 addition & 10 deletions lib/navigationlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3516,20 +3516,11 @@ public function initialise() {
$usersettings->force_open();
}

// Check if the user is currently logged in as another user
if (\core\session\manager::is_loggedinas()) {
// Get the actual user, we need this so we can display an informative return link
$realuser = \core\session\manager::get_realuser();
// Add the informative return to original user link
$url = new moodle_url('/course/loginas.php',array('id'=>$this->page->course->id, 'return'=>1,'sesskey'=>sesskey()));
$this->add(get_string('returntooriginaluser', 'moodle', fullname($realuser, true)), $url, self::TYPE_SETTING, null, null, new pix_icon('t/left', ''));
}

// At this point we give any local plugins the ability to extend/tinker with the navigation settings.
$this->load_local_plugin_settings();

foreach ($this->children as $key=>$node) {
if ($node->nodetype != self::NODETYPE_BRANCH || $node->children->count()===0) {
if ($node->nodetype == self::NODETYPE_BRANCH && $node->children->count() == 0) {
// Site administration is shown as link.
if (!empty($SESSION->load_navigation_admin) && ($node->type === self::TYPE_SITE_ADMIN)) {
continue;
Expand Down

0 comments on commit 034fed3

Please sign in to comment.