mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +02:00
MDL-75714 navigation: Check if node is false
This commit is contained in:
parent
c6211a68b4
commit
8e371f138a
1 changed files with 4 additions and 1 deletions
|
@ -1027,7 +1027,10 @@ class secondary extends view {
|
||||||
$coursesecondarynode = navigation_node::create(get_string('course'), null, self::TYPE_COURSE, null, 'course');
|
$coursesecondarynode = navigation_node::create(get_string('course'), null, self::TYPE_COURSE, null, 'course');
|
||||||
$this->load_course_navigation($coursesecondarynode);
|
$this->load_course_navigation($coursesecondarynode);
|
||||||
// Remove the unnecessary 'Course' child node generated in load_course_navigation().
|
// Remove the unnecessary 'Course' child node generated in load_course_navigation().
|
||||||
$coursesecondarynode->find('coursehome', self::TYPE_COURSE)->remove();
|
$coursehomenode = $coursesecondarynode->find('coursehome', self::TYPE_COURSE);
|
||||||
|
if (!empty($coursehomenode)) {
|
||||||
|
$coursehomenode->remove();
|
||||||
|
}
|
||||||
|
|
||||||
// Add the 'Course' node to the secondary navigation only if this node has children nodes.
|
// Add the 'Course' node to the secondary navigation only if this node has children nodes.
|
||||||
if (count($coursesecondarynode->children) > 0) {
|
if (count($coursesecondarynode->children) > 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue