Permalink
Browse files

Merge branch 'MDL-25291_20_admintreeflag' of git://github.com/samheme…

…lryk/moodle
  • Loading branch information...
2 parents cf59f74 + 7e90d3a commit 1c6a1e12aa1425dc1346dae6f3c47dd8bb6bbc38 @skodak skodak committed Jan 31, 2011
Showing with 8 additions and 4 deletions.
  1. +8 −4 lib/navigationlib.php
View
@@ -2537,7 +2537,7 @@ public function __construct(moodle_page &$page) {
*
*/
public function initialise() {
- global $DB;
+ global $DB, $SESSION;
if (during_initial_install()) {
return false;
@@ -2581,7 +2581,13 @@ public function initialise() {
}
$settings = $this->load_user_settings($this->page->course->id);
- $admin = $this->load_administration_settings();
+
+ if (isloggedin() && !isguestuser() && (!property_exists($SESSION, 'load_navigation_admin') || $SESSION->load_navigation_admin)) {
+ $admin = $this->load_administration_settings();
+ $SESSION->load_navigation_admin = ($admin->has_children());
+ } else {
+ $admin = false;
+ }
if ($context->contextlevel == CONTEXT_SYSTEM && $admin) {
$admin->force_open();
@@ -2598,8 +2604,6 @@ public function initialise() {
$this->add(get_string('returntooriginaluser', 'moodle', fullname($realuser, true)), $url, self::TYPE_SETTING, null, null, new pix_icon('t/left', ''));
}
- // Make sure the first child doesnt have proceed with hr set to true
-
foreach ($this->children as $key=>$node) {
if ($node->nodetype != self::NODETYPE_BRANCH || $node->children->count()===0) {
$node->remove();

0 comments on commit 1c6a1e1

Please sign in to comment.