Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 37... Línea 37...
37
}
37
}
Línea 38... Línea 38...
38
 
38
 
39
$badge = new badge($badgeid);
39
$badge = new badge($badgeid);
40
$context = $badge->get_context();
40
$context = $badge->get_context();
-
 
41
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type));
Línea 41... Línea 42...
41
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type));
42
$title = [$badge->name];
42
 
43
 
43
if ($badge->type == BADGE_TYPE_COURSE) {
44
if ($badge->type == BADGE_TYPE_COURSE) {
44
    if (empty($CFG->badges_allowcoursebadges)) {
45
    if (empty($CFG->badges_allowcoursebadges)) {
45
        throw new \moodle_exception('coursebadgesdisabled', 'badges');
46
        throw new \moodle_exception('coursebadgesdisabled', 'badges');
46
    }
47
    }
47
    require_login($badge->courseid);
48
    require_login($badge->courseid);
-
 
49
    $course = get_course($badge->courseid);
Línea 48... Línea 50...
48
    $course = get_course($badge->courseid);
50
    $heading = format_string($course->fullname, true, ['context' => $context]);
49
    $heading = format_string($course->fullname, true, ['context' => $context]);
51
    $title[] = $heading;
50
 
52
 
51
    $navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
53
    $navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
Línea 60... Línea 62...
60
$currenturl = new moodle_url('/badges/overview.php', array('id' => $badge->id));
62
$currenturl = new moodle_url('/badges/overview.php', array('id' => $badge->id));
Línea 61... Línea 63...
61
 
63
 
62
$PAGE->set_context($context);
64
$PAGE->set_context($context);
63
$PAGE->set_url($currenturl);
65
$PAGE->set_url($currenturl);
64
$PAGE->set_heading($heading);
66
$PAGE->set_heading($heading);
65
$PAGE->set_title($badge->name);
67
$PAGE->set_title(implode(\moodle_page::TITLE_SEPARATOR, $title));
Línea 66... Línea 68...
66
$PAGE->navbar->add($badge->name);
68
$PAGE->navbar->add($badge->name);
Línea 67... Línea 69...
67
 
69
 
Línea 72... Línea 74...
72
$actionbar = new \core_badges\output\manage_badge_action_bar($badge, $PAGE);
74
$actionbar = new \core_badges\output\manage_badge_action_bar($badge, $PAGE);
73
echo $output->render_tertiary_navigation($actionbar);
75
echo $output->render_tertiary_navigation($actionbar);
74
echo $OUTPUT->heading(print_badge_image($badge, $context, 'small') . ' ' . $badge->name);
76
echo $OUTPUT->heading(print_badge_image($badge, $context, 'small') . ' ' . $badge->name);
Línea 75... Línea 77...
75
 
77
 
76
if ($awards == 'cron') {
78
if ($awards == 'cron') {
77
    echo $OUTPUT->notification(get_string('awardoncron', 'badges'), 'notifysuccess');
79
    echo $OUTPUT->notification(get_string('awardoncron', 'badges', ['badgename' => $badge->name]), 'info');
78
} else if ((int)$awards > 0) {
80
} else if ((int)$awards > 0) {
79
    echo $OUTPUT->notification(get_string('numawardstat', 'badges', $awards), 'notifysuccess');
81
    echo $OUTPUT->notification(get_string('numawardstat', 'badges', ['badgename' => $badge->name, 'awards' => $awards]), 'info');
80
}
82
}
81
echo $output->print_badge_status_box($badge);
83
echo $output->print_badge_status_box($badge);
Línea 82... Línea 84...
82
echo $output->print_badge_overview($badge, $context);
84
echo $output->print_badge_overview($badge, $context);