| Línea 22... |
Línea 22... |
| 22 |
* @copyright 2012 onwards Totara Learning Solutions Ltd {@link http://www.totaralms.com/}
|
22 |
* @copyright 2012 onwards Totara Learning Solutions Ltd {@link http://www.totaralms.com/}
|
| 23 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
23 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
| 24 |
* @author Yuliya Bozhko <yuliya.bozhko@totaralms.com>
|
24 |
* @author Yuliya Bozhko <yuliya.bozhko@totaralms.com>
|
| 25 |
*/
|
25 |
*/
|
| Línea -... |
Línea 26... |
| - |
|
26 |
|
| - |
|
27 |
use core_badges\reportbuilder\local\systemreports\recipients;
|
| - |
|
28 |
use core_reportbuilder\system_report_factory;
|
| 26 |
|
29 |
|
| 27 |
require_once(__DIR__ . '/../config.php');
|
30 |
require_once(__DIR__ . '/../config.php');
|
| Línea 28... |
Línea 31... |
| 28 |
require_once($CFG->libdir . '/badgeslib.php');
|
31 |
require_once($CFG->libdir . '/badgeslib.php');
|
| Línea 35... |
Línea 38... |
| 35 |
throw new \moodle_exception('badgesdisabled', 'badges');
|
38 |
throw new \moodle_exception('badgesdisabled', 'badges');
|
| 36 |
}
|
39 |
}
|
| Línea 37... |
Línea 40... |
| 37 |
|
40 |
|
| 38 |
$badge = new badge($badgeid);
|
41 |
$badge = new badge($badgeid);
|
| - |
|
42 |
$context = $badge->get_context();
|
| 39 |
$context = $badge->get_context();
|
43 |
$title = [get_string('awards', 'badges'), $badge->name];
|
| Línea 40... |
Línea 44... |
| 40 |
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type));
|
44 |
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type));
|
| Línea 41... |
Línea 45... |
| 41 |
|
45 |
|
| Línea 46... |
Línea 50... |
| 46 |
throw new \moodle_exception('coursebadgesdisabled', 'badges');
|
50 |
throw new \moodle_exception('coursebadgesdisabled', 'badges');
|
| 47 |
}
|
51 |
}
|
| 48 |
require_login($badge->courseid);
|
52 |
require_login($badge->courseid);
|
| 49 |
$course = get_course($badge->courseid);
|
53 |
$course = get_course($badge->courseid);
|
| 50 |
$heading = format_string($course->fullname, true, ['context' => $context]);
|
54 |
$heading = format_string($course->fullname, true, ['context' => $context]);
|
| - |
|
55 |
$title[] = $heading;
|
| 51 |
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
|
56 |
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
|
| 52 |
$PAGE->set_pagelayout('standard');
|
57 |
$PAGE->set_pagelayout('standard');
|
| 53 |
navigation_node::override_active_url($navurl);
|
58 |
navigation_node::override_active_url($navurl);
|
| 54 |
} else {
|
59 |
} else {
|
| 55 |
$PAGE->set_pagelayout('admin');
|
60 |
$PAGE->set_pagelayout('admin');
|
| Línea 58... |
Línea 63... |
| 58 |
}
|
63 |
}
|
| Línea 59... |
Línea 64... |
| 59 |
|
64 |
|
| 60 |
$PAGE->set_context($context);
|
65 |
$PAGE->set_context($context);
|
| 61 |
$PAGE->set_url('/badges/recipients.php', ['id' => $badgeid]);
|
66 |
$PAGE->set_url('/badges/recipients.php', ['id' => $badgeid]);
|
| 62 |
$PAGE->set_heading($heading);
|
67 |
$PAGE->set_heading($heading);
|
| 63 |
$PAGE->set_title($badge->name);
|
68 |
$PAGE->set_title(implode(\moodle_page::TITLE_SEPARATOR, $title));
|
| Línea -... |
Línea 69... |
| - |
|
69 |
$PAGE->navbar->add($badge->name);
|
| 64 |
$PAGE->navbar->add($badge->name);
|
70 |
|
| Línea 65... |
Línea 71... |
| 65 |
|
71 |
/** @var core_badges_renderer $output */
|
| Línea 66... |
Línea 72... |
| 66 |
$output = $PAGE->get_renderer('core', 'badges');
|
72 |
$output = $PAGE->get_renderer('core', 'badges');
|
| 67 |
|
73 |
|
| Línea 68... |
Línea 74... |
| 68 |
echo $output->header();
|
74 |
echo $output->header();
|
| 69 |
|
75 |
|
| Línea 70... |
Línea -... |
| 70 |
$actionbar = new \core_badges\output\recipients_action_bar($badge, $PAGE);
|
- |
|
| 71 |
echo $output->render_tertiary_navigation($actionbar);
|
76 |
$actionbar = new \core_badges\output\recipients_action_bar($badge, $PAGE);
|
| 72 |
|
- |
|
| 73 |
echo $OUTPUT->heading(print_badge_image($badge, $context, 'small') . ' ' . $badge->name);
|
77 |
echo $output->render_tertiary_navigation($actionbar);
|
| Línea 74... |
Línea 78... |
| 74 |
echo $output->print_badge_status_box($badge);
|
78 |
|