Commit d7e10c3d authored by Paul Holden's avatar Paul Holden
Browse files

MDL-72968 reportbuilder: breadcrumb navigation for edit/view report.

parent b16fc541
......@@ -164,3 +164,4 @@ $string['userfullnamewithpicture'] = 'Full name with picture';
$string['userfullnamewithpicturelink'] = 'Full name with picture and link';
$string['usermodified'] = 'Modified by';
$string['userpicture'] = 'User picture';
$string['viewreport'] = 'View report';
......@@ -249,7 +249,7 @@ class reports_list extends system_report {
// Preview action.
$this->add_action((new action(
new moodle_url('/reportbuilder/view.php', ['id' => ':id']),
new pix_icon('i/search', get_string('view', 'moodle')),
new pix_icon('i/search', get_string('viewreport', 'core_reportbuilder')),
[]
))
->add_callback(function(stdClass $row): bool {
......
......@@ -34,17 +34,18 @@ require_once("{$CFG->libdir}/adminlib.php");
$reportid = required_param('id', PARAM_INT);
admin_externalpage_setup('customreports', null, ['id' => $reportid], new moodle_url('/reportbuilder/edit.php'));
navigation_node::override_active_url(new moodle_url('/reportbuilder/index.php'));
$report = manager::get_report_from_id($reportid);
permission::require_can_edit_report($report->get_report_persistent());
$PAGE->set_context($report->get_context());
$PAGE->navbar->add(get_string('editreportcontent', 'core_reportbuilder'), $PAGE->url);
/** @var \core_reportbuilder\output\renderer $renderer */
$renderer = $PAGE->get_renderer('core_reportbuilder');
$reportname = $report->get_report_persistent()->get_formatted_name();
$PAGE->navbar->add($reportname);
$PAGE->set_title($reportname);
$PAGE->set_heading($reportname);
......
......@@ -34,17 +34,18 @@ require_once("{$CFG->libdir}/adminlib.php");
$reportid = required_param('id', PARAM_INT);
admin_externalpage_setup('customreports', null, ['id' => $reportid], new moodle_url('/reportbuilder/view.php'));
navigation_node::override_active_url(new moodle_url('/reportbuilder/index.php'));
$report = manager::get_report_from_id($reportid);
permission::require_can_view_report($report->get_report_persistent());
$PAGE->set_context($report->get_context());
$PAGE->navbar->add(get_string('viewreport', 'core_reportbuilder'), $PAGE->url);
/** @var \core_reportbuilder\output\renderer $renderer */
$renderer = $PAGE->get_renderer('core_reportbuilder');
$reportname = $report->get_report_persistent()->get_formatted_name();
$PAGE->navbar->add($reportname);
$PAGE->set_title($reportname);
$PAGE->set_heading($reportname);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment