MDL-22425 Don't show My Home link on home page if not logged in

This commit is contained in:
Martin Dougiamas 2010-05-14 02:55:46 +00:00
parent 57513281da
commit 3f9ccf85ce

View File

@ -842,8 +842,10 @@ class global_navigation extends navigation_node {
// users: Other users information loaded here.
$this->rootnodes = array();
if (get_home_page() == HOMEPAGE_SITE) {
// The home element should be the my moolde because the root element is the site
$this->rootnodes['home'] = $this->add(get_string('myhome'), new moodle_url('/my/'), self::TYPE_SETTING, null, 'home');
// The home element should be my moodle because the root element is the site
if (isloggedin()) { // Makes no sense if you aren't logged in
$this->rootnodes['home'] = $this->add(get_string('myhome'), new moodle_url('/my/'), self::TYPE_SETTING, null, 'home');
}
} else {
// The home element should be the site because the root node is my moodle
$this->rootnodes['home'] = $this->add(get_string('sitehome'), new moodle_url('/'), self::TYPE_SETTING, null, 'home');
@ -3559,4 +3561,4 @@ class navigation_cache {
}
}
}
}
}