Skip to content

Commit

Permalink
ISE: adiciona link 'Gerenciar cursos' no cabeçalho para P_Materiais
Browse files Browse the repository at this point in the history
  • Loading branch information
danielneis committed Jul 3, 2023
1 parent 88998c4 commit d03965b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/classes/navigation/output/primary.php
Expand Up @@ -106,14 +106,21 @@ protected function get_custom_menu(renderer_base $output): array {
user_has_role_assignment($USER->id, $DB->get_field('role', 'id', ['shortname' => 'p_materiais'])) ||
user_has_role_assignment($USER->id, $DB->get_field('role', 'id', ['shortname' => 'p_professor']));

if (empty($CFG->custommenuitems) && !$addcontentbank) {
$addmanagecourses =
user_has_role_assignment($USER->id, $DB->get_field('role', 'id', ['shortname' => 'p_materiais']));

if (empty($CFG->custommenuitems) && !$addcontentbank && !$addmanagecourses) {
// Early return if a custom menu does not exists.
return [];
}

$custommenuitems = $CFG->custommenuitems;
if ($addcontentbank) {
$custommenuitems .= "\r" . get_string('contentbank') . '|/contentbank';
$custommenuitems .= "\n" . get_string('contentbank') . '|/contentbank';
}

if ($addmanagecourses) {
$custommenuitems .= "\n" . get_string('managecourses') . '|/course/management.php?categoryid=0';
}

$currentlang = current_language();
Expand Down

0 comments on commit d03965b

Please sign in to comment.