mirror of
https://github.com/moodle/moodle.git
synced 2025-03-19 23:20:09 +01:00
MDL-69588 navigation: Show home primary node when required
This commit is contained in:
parent
eed2498215
commit
1ce2bb0007
@ -35,8 +35,10 @@ class primary extends view {
|
||||
return;
|
||||
}
|
||||
$this->id = 'primary_navigation';
|
||||
$this->add(get_string('home'), new \moodle_url('/'), self::TYPE_SYSTEM,
|
||||
if (get_home_page() == HOMEPAGE_SITE && isloggedin() && !isguestuser()) {
|
||||
$this->add(get_string('home'), new \moodle_url('/'), self::TYPE_SYSTEM,
|
||||
null, 'home', new \pix_icon('i/home', ''));
|
||||
}
|
||||
|
||||
// Add the dashboard link.
|
||||
if (isloggedin() && !isguestuser()) { // Makes no sense if you aren't logged in.
|
||||
|
@ -58,9 +58,9 @@ class primary_test extends \advanced_testcase {
|
||||
*/
|
||||
public function test_setting_initialise_provider() {
|
||||
return [
|
||||
'Testing as a guest user' => ['guest', ['home', 'courses']],
|
||||
'Testing as an admin' => ['admin', ['home', 'myhome', 'courses', 'siteadminnode']],
|
||||
'Testing as a regular user' => ['user', ['home', 'myhome', 'courses']]
|
||||
'Testing as a guest user' => ['guest', ['courses']],
|
||||
'Testing as an admin' => ['admin', ['myhome', 'courses', 'siteadminnode']],
|
||||
'Testing as a regular user' => ['user', ['myhome', 'courses']]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user