mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
Merge branch 'MDL-78773' of https://github.com/paulholden/moodle
This commit is contained in:
commit
966d5308a5
8
.upgradenotes/MDL-78773-2024060309112838.yml
Normal file
8
.upgradenotes/MDL-78773-2024060309112838.yml
Normal file
@ -0,0 +1,8 @@
|
||||
issueNumber: MDL-78773
|
||||
notes:
|
||||
report:
|
||||
- message: >
|
||||
The `report_helper::print_report_selector` method accepts an additional
|
||||
argument for adding content to the tertiary navigation to align with the
|
||||
report selector
|
||||
type: changed
|
@ -28,13 +28,14 @@ use stdClass;
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class report_helper {
|
||||
|
||||
/**
|
||||
* Print the selector dropdown
|
||||
*
|
||||
* @param string $pluginname The report plugin where the header is modified
|
||||
* @return void
|
||||
* @param string $additional Additional content to display aligned with the selector
|
||||
*/
|
||||
public static function print_report_selector(string $pluginname): void {
|
||||
public static function print_report_selector(string $pluginname, string $additional = ''): void {
|
||||
global $OUTPUT, $PAGE;
|
||||
|
||||
if ($reportnode = $PAGE->settingsnav->find('coursereports', \navigation_node::TYPE_CONTAINER)) {
|
||||
@ -73,12 +74,18 @@ class report_helper {
|
||||
$options = \html_writer::tag(
|
||||
'div',
|
||||
$OUTPUT->render_from_template('core/tertiary_navigation_selector', $selectmenu->export_for_template($OUTPUT)),
|
||||
['class' => 'row pb-3']
|
||||
['class' => 'navitem']
|
||||
);
|
||||
|
||||
if ($additional) {
|
||||
$options .= \html_writer::div('', 'navitem-divider') .
|
||||
\html_writer::div($additional, 'navitem');
|
||||
}
|
||||
|
||||
echo \html_writer::tag(
|
||||
'div',
|
||||
$options,
|
||||
['class' => 'tertiary-navigation full-width-bottom-border ml-0', 'id' => 'tertiary-navigation']);
|
||||
['class' => 'tertiary-navigation full-width-bottom-border ml-0 d-flex', 'id' => 'tertiary-navigation']);
|
||||
} else {
|
||||
echo $OUTPUT->heading($pluginname, 2, 'mb-3');
|
||||
}
|
||||
|
@ -86,12 +86,15 @@ if ($course->id == SITEID) {
|
||||
$PAGE->set_title("$course->shortname: $strstats");
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$PAGE->set_pagelayout('report');
|
||||
$PAGE->set_headingmenu(report_stats_mode_menu($course, $mode, $time, "$CFG->wwwroot/report/stats/index.php"));
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
// Print the selected dropdown.
|
||||
$pluginname = get_string('pluginname', 'report_stats');
|
||||
report_helper::print_report_selector($pluginname);
|
||||
report_helper::print_report_selector(
|
||||
get_string('pluginname', 'report_stats'),
|
||||
report_stats_mode_menu($course, $mode, $time, $PAGE->url->out_omit_querystring())
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
report_stats_report($course, $report, $mode, $user, $roleid, $time);
|
||||
|
Loading…
x
Reference in New Issue
Block a user