Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 55... Línea 55...
55
     */
55
     */
56
    protected function get_default_course_mapping(): array {
56
    protected function get_default_course_mapping(): array {
57
        $nodes = [];
57
        $nodes = [];
58
        $nodes['settings'] = [
58
        $nodes['settings'] = [
59
            self::TYPE_CONTAINER => [
59
            self::TYPE_CONTAINER => [
60
                'coursereports' => 3,
60
                'coursereports' => 4,
61
                'questionbank' => 4,
61
                'questionbank' => 5,
62
            ],
62
            ],
63
            self::TYPE_SETTING => [
63
            self::TYPE_SETTING => [
64
                'editsettings' => 0,
64
                'editsettings' => 0,
65
                'review' => 1.1,
65
                'review' => 1.1,
66
                'manageinstances' => 1.2,
66
                'manageinstances' => 1.2,
Línea 69... Línea 69...
69
                'roles' => 1.5,
69
                'roles' => 1.5,
70
                'permissions' => 1.6,
70
                'permissions' => 1.6,
71
                'otherusers' => 1.7,
71
                'otherusers' => 1.7,
72
                'gradebooksetup' => 2.1,
72
                'gradebooksetup' => 2.1,
73
                'outcomes' => 2.2,
73
                'outcomes' => 2.2,
74
                'coursecompletion' => 6,
74
                'coursecompletion' => 7,
75
                'coursebadges' => 7.1,
75
                'coursebadges' => 8.1,
76
                'newbadge' => 7.2,
76
                'newbadge' => 8.2,
77
                'filtermanagement' => 9,
77
                'filtermanagement' => 10,
78
                'unenrolself' => 10,
78
                'unenrolself' => 11,
79
                'coursetags' => 11,
79
                'coursetags' => 12,
80
                'download' => 12,
80
                'download' => 13,
81
                'contextlocking' => 13,
81
                'contextlocking' => 14,
82
            ],
82
            ],
83
        ];
83
        ];
84
        $nodes['navigation'] = [
84
        $nodes['navigation'] = [
85
            self::TYPE_CONTAINER => [
85
            self::TYPE_CONTAINER => [
86
                'participants' => 1,
86
                'participants' => 1,
-
 
87
                'courseoverview' => 3,
87
            ],
88
            ],
88
            self::TYPE_SETTING => [
89
            self::TYPE_SETTING => [
89
                'grades' => 2,
90
                'grades' => 2,
90
                'badgesview' => 7,
91
                'badgesview' => 8,
91
                'competencies' => 8,
92
                'competencies' => 9,
92
                'communication' => 14,
93
                'communication' => 15,
93
            ],
94
            ],
94
            self::TYPE_CUSTOM => [
95
            self::TYPE_CUSTOM => [
95
                'contentbank' => 5,
96
                'contentbank' => 6,
96
                'participants' => 1, // In site home, 'participants' is classified differently.
97
                'participants' => 1, // In site home, 'participants' is classified differently.
97
            ],
98
            ],
98
        ];
99
        ];
Línea 99... Línea 100...
99
 
100
 
Línea 430... Línea 431...
430
            $rootnode->add_node(
431
            $rootnode->add_node(
431
                navigation_node::create($firstnodeidentifier, new \moodle_url('/course/view.php', ['id' => $course->id]),
432
                navigation_node::create($firstnodeidentifier, new \moodle_url('/course/view.php', ['id' => $course->id]),
432
                    self::TYPE_COURSE, null, 'coursehome'), reset($nodekeys)
433
                    self::TYPE_COURSE, null, 'coursehome'), reset($nodekeys)
433
            );
434
            );
434
        }
435
        }
-
 
436
 
-
 
437
        // Allow plugins to add nodes to the secondary navigation.
-
 
438
        $hook = new \core\hook\navigation\secondary_extend($this);
-
 
439
        \core\di::get(\core\hook\manager::class)->dispatch($hook);
435
    }
440
    }
Línea 436... Línea 441...
436
 
441
 
437
    /**
442
    /**
438
     * Gets the overflow navigation nodes for the course administration category.
443
     * Gets the overflow navigation nodes for the course administration category.
Línea 580... Línea 585...
580
        $issingleactivitycourse = $this->page->course->format === 'singleactivity';
585
        $issingleactivitycourse = $this->page->course->format === 'singleactivity';
581
        $rootnode = $issingleactivitycourse ? $this->find('course', self::TYPE_COURSE) : $this;
586
        $rootnode = $issingleactivitycourse ? $this->find('course', self::TYPE_COURSE) : $this;
582
        $activenode = $this->find_active_node();
587
        $activenode = $this->find_active_node();
583
        $incourseadmin = false;
588
        $incourseadmin = false;
Línea -... Línea 589...
-
 
589
 
-
 
590
        $activeleafnode = $this->page->settingsnav->find_active_node();
-
 
591
        $parentnode = $activeleafnode->parent ?? null;
-
 
592
        if ($issingleactivitycourse && $parentnode && $parentnode->key === 'quiz_report') {
-
 
593
            $activenode = $parentnode;
-
 
594
        }
584
 
595
 
585
        if (!$activenode || ($issingleactivitycourse && $activenode->key === 'course')) {
596
        if (!$activenode || ($issingleactivitycourse && $activenode->key === 'course')) {
586
            // Could be in the course admin section.
597
            // Could be in the course admin section.
587
            $courseadmin = $this->page->settingsnav->find('courseadmin', navigation_node::TYPE_COURSE);
598
            $courseadmin = $this->page->settingsnav->find('courseadmin', navigation_node::TYPE_COURSE);
588
            if (!$courseadmin) {
599
            if (!$courseadmin) {
Línea 625... Línea 636...
625
                $selectedoverflownode = $this->node_matches_key_string($courseoverflownode, $this->overflowselected);
636
                $selectedoverflownode = $this->node_matches_key_string($courseoverflownode, $this->overflowselected);
626
                $selectedoverflownodeurl = $selectedoverflownode ? $selectedoverflownode->action->out(false) : null;
637
                $selectedoverflownodeurl = $selectedoverflownode ? $selectedoverflownode->action->out(false) : null;
627
            }
638
            }
Línea 628... Línea 639...
628
 
639
 
629
            $menuselect = new url_select($menuarray, $selectedoverflownodeurl ?? $this->page->url, null);
640
            $menuselect = new url_select($menuarray, $selectedoverflownodeurl ?? $this->page->url, null);
630
            $menuselect->set_label(get_string('browsecourseadminindex', 'course'), ['class' => 'sr-only']);
641
            $menuselect->set_label(get_string('browsecourseadminindex', 'course'), ['class' => 'visually-hidden']);
631
            return $menuselect;
642
            return $menuselect;
632
        } else {
643
        } else {
633
            return $this->get_other_overflow_menu_data($activenode);
644
            return $this->get_other_overflow_menu_data($activenode);
634
        }
645
        }
Línea 678... Línea 689...
678
        if (!isset($menunode) || !$menunode->has_children()) {
689
        if (!isset($menunode) || !$menunode->has_children()) {
679
            return null;
690
            return null;
680
        }
691
        }
681
        $selectdata = static::create_menu_element([$menunode], false);
692
        $selectdata = static::create_menu_element([$menunode], false);
682
        $urlselect = new url_select($selectdata, $matchednode->action->out(false), null);
693
        $urlselect = new url_select($selectdata, $matchednode->action->out(false), null);
683
        $urlselect->set_label(get_string('browsesettingindex', 'course'), ['class' => 'sr-only']);
694
        $urlselect->set_label(get_string('browsesettingindex', 'course'), ['class' => 'visually-hidden']);
684
        return $urlselect;
695
        return $urlselect;
685
    }
696
    }
Línea 686... Línea 697...
686
 
697
 
687
    /**
698
    /**