From c326402e8654983429cd4674f507fadec588f879 Mon Sep 17 00:00:00 2001 From: Mihail Geshoski Date: Wed, 27 Oct 2021 11:47:00 +0800 Subject: [PATCH] MDL-72873 core_grades: Add tertiary navigation in grade export plugins --- grade/classes/output/export_action_bar.php | 100 +++++++++++++++++++++ .../output/export_key_manager_action_bar.php | 63 +++++++++++++ grade/classes/output/export_publish_action_bar.php | 73 +++++++++++++++ grade/export/index.php | 56 ++++++++++++ grade/export/key.php | 3 + grade/export/keymanager.php | 10 +-- grade/export/ods/export.php | 5 +- grade/export/ods/index.php | 5 +- grade/export/txt/export.php | 5 +- grade/export/txt/index.php | 5 +- grade/export/xls/export.php | 5 +- grade/export/xls/index.php | 5 +- grade/export/xml/export.php | 5 +- grade/export/xml/index.php | 5 +- grade/templates/export_action_bar.mustache | 82 +++++++++++++++++ .../export_key_manager_action_bar.mustache | 99 ++++++++++++++++++++ grade/templates/export_publish_action_bar.mustache | 45 ++++++++++ 17 files changed, 557 insertions(+), 14 deletions(-) create mode 100644 grade/classes/output/export_action_bar.php create mode 100644 grade/classes/output/export_key_manager_action_bar.php create mode 100644 grade/classes/output/export_publish_action_bar.php create mode 100644 grade/export/index.php create mode 100644 grade/templates/export_action_bar.mustache create mode 100644 grade/templates/export_key_manager_action_bar.mustache create mode 100644 grade/templates/export_publish_action_bar.mustache diff --git a/grade/classes/output/export_action_bar.php b/grade/classes/output/export_action_bar.php new file mode 100644 index 00000000000..8186ad45cd4 --- /dev/null +++ b/grade/classes/output/export_action_bar.php @@ -0,0 +1,100 @@ +. + +namespace core_grades\output; + +use moodle_url; + +/** + * Renderable class for the action bar elements in the gradebook export pages. + * + * @package core_grades + * @copyright 2021 Mihail Geshoski + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class export_action_bar extends action_bar { + + /** @var moodle_url $exportactiveurl The URL that should be set as active in the exports URL selector element. */ + protected $exportactiveurl; + + /** @var string $activeplugin The plugin of the current export grades page (xml, ods, ...). */ + protected $activeplugin; + + /** + * The class constructor. + * + * @param \context $context The context object. + * @param moodle_url $exportactiveurl The URL that should be set as active in the exports URL selector element. + * @param string $activeplugin The plugin of the current export grades page (xml, ods, ...). + */ + public function __construct(\context $context, moodle_url $exportactiveurl, string $activeplugin) { + parent::__construct($context); + $this->exportactiveurl = $exportactiveurl; + $this->activeplugin = $activeplugin; + } + + /** + * Returns the template for the action bar. + * + * @return string + */ + public function get_template(): string { + return 'core_grades/export_action_bar'; + } + + /** + * Export the data for the mustache template. + * + * @param \renderer_base $output renderer to be used to render the action bar elements. + * @return array + */ + public function export_for_template(\renderer_base $output): array { + if ($this->context->contextlevel !== CONTEXT_COURSE) { + return []; + } + $courseid = $this->context->instanceid; + // Get the data used to output the general navigation selector. + $generalnavselector = new general_action_bar($this->context, + new moodle_url('/grade/export/index.php', ['id' => $courseid]), 'export', $this->activeplugin); + $data = $generalnavselector->export_for_template($output); + + // Get all grades export plugins. If there isn't any available export plugins there is no need to create and + // display the exports navigation selector menu. Therefore, return only the current data. + if (!$exports = \grade_helper::get_plugins_export($courseid)) { + return $data; + } + + // If exports key management is enabled, always display this item at the end of the list. + if (array_key_exists('keymanager', $exports)) { + $keymanager = $exports['keymanager']; + unset($exports['keymanager']); + $exports['keymanager'] = $keymanager; + } + + $exportsmenu = []; + // Generate the data for the exports navigation selector menu. + foreach ($exports as $export) { + $exportsmenu[$export->link->out()] = $export->string; + } + + // This navigation selector menu will contain the links to all available grade export plugin pages. + $exportsurlselect = new \url_select($exportsmenu, $this->exportactiveurl->out(false), null, + 'gradesexportactionselect'); + $data['exportselector'] = $exportsurlselect->export_for_template($output); + + return $data; + } +} diff --git a/grade/classes/output/export_key_manager_action_bar.php b/grade/classes/output/export_key_manager_action_bar.php new file mode 100644 index 00000000000..b3214934bb5 --- /dev/null +++ b/grade/classes/output/export_key_manager_action_bar.php @@ -0,0 +1,63 @@ +. + +namespace core_grades\output; + +use moodle_url; + +/** + * Renderable class for the action bar elements in the gradebook exports key manager page. + * + * @package core_grades + * @copyright 2021 Mihail Geshoski + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class export_key_manager_action_bar extends action_bar { + + /** + * Returns the template for the action bar. + * + * @return string + */ + public function get_template(): string { + return 'core_grades/export_key_manager_action_bar'; + } + + /** + * Export the data for the mustache template. + * + * @param \renderer_base $output renderer to be used to render the action bar elements. + * @return array + */ + public function export_for_template(\renderer_base $output): array { + if ($this->context->contextlevel !== CONTEXT_COURSE) { + return []; + } + $courseid = $this->context->instanceid; + // Get the data used to output the general navigation selector and exports navigation selector. + $exportnavselectors = new export_action_bar($this->context, + new moodle_url('/grade/export/keymanager.php', ['id' => $courseid]), 'keymanager'); + $data = $exportnavselectors->export_for_template($output); + + // Add a button to the action bar with a link to the 'add user key' page. + $adduserkeylink = new moodle_url('/grade/export/key.php', ['courseid' => $courseid]); + $adduserkeybutton = new \single_button($adduserkeylink, get_string('adduserkey', 'userkey'), + 'get', true); + $data['adduserkeybutton'] = $adduserkeybutton->export_for_template($output); + + return $data; + } +} diff --git a/grade/classes/output/export_publish_action_bar.php b/grade/classes/output/export_publish_action_bar.php new file mode 100644 index 00000000000..a0a5d2a46ac --- /dev/null +++ b/grade/classes/output/export_publish_action_bar.php @@ -0,0 +1,73 @@ +. + +namespace core_grades\output; + +use moodle_url; + +/** + * Renderable class for the action bar elements in the gradebook publish export page. + * + * @package core_grades + * @copyright 2021 Mihail Geshoski + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class export_publish_action_bar extends action_bar { + + /** @var string $activeplugin The plugin of the current export grades page (xml, ods, ...). */ + protected $activeplugin; + + /** + * The class constructor. + * + * @param \context $context The context object. + * @param string $activeplugin The plugin of the current export grades page (xml, ods, ...). + */ + public function __construct(\context $context, string $activeplugin) { + parent::__construct($context); + $this->activeplugin = $activeplugin; + } + + /** + * Returns the template for the action bar. + * + * @return string + */ + public function get_template(): string { + return 'core_grades/export_publish_action_bar'; + } + + /** + * Export the data for the mustache template. + * + * @param \renderer_base $output renderer to be used to render the action bar elements. + * @return array + */ + public function export_for_template(\renderer_base $output): array { + if ($this->context->contextlevel !== CONTEXT_COURSE) { + return []; + } + $courseid = $this->context->instanceid; + + // Add a back button to the action bar. + $backlink = new moodle_url("/grade/export/{$this->activeplugin}/index.php", ['id' => $courseid]); + $backbutton = new \single_button($backlink, get_string('back'), 'get'); + + return [ + 'backbutton' => $backbutton->export_for_template($output) + ]; + } +} diff --git a/grade/export/index.php b/grade/export/index.php new file mode 100644 index 00000000000..7901e2b75a9 --- /dev/null +++ b/grade/export/index.php @@ -0,0 +1,56 @@ +. + +/** + * Redirects the user to a default grades export plugin page. + * + * @package core_grades + * @copyright 2021 Mihail Geshoski + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +require_once(__DIR__ . '/../../config.php'); + +// Course ID. +$courseid = required_param('id', PARAM_INT); + +$PAGE->set_url(new moodle_url('/grade/export/index.php', ['id' => $courseid])); + +// Basic access checks. +if (!$course = $DB->get_record('course', ['id' => $courseid])) { + throw new moodle_exception('invalidcourseid', 'error'); +} +require_login($course); +$context = context_course::instance($courseid); +require_capability('moodle/grade:export', $context); + +$exportplugins = core_component::get_plugin_list('gradeexport'); +if (!empty($exportplugins)) { + $exportplugin = array_key_first($exportplugins); + $url = new moodle_url("/grade/export/{$exportplugin}/index.php", ['id' => $courseid]); + redirect($url); +} + +// Otherwise, output the page with a notification stating that there are no available grade import options. +$PAGE->set_title(get_string('export', 'grades')); +$PAGE->set_pagelayout('incourse'); +$PAGE->set_heading($course->fullname); +$PAGE->set_pagetype('course-view-' . $course->format); + +echo $OUTPUT->header(); +echo $OUTPUT->heading(get_string('export', 'grades')); +echo html_writer::div($OUTPUT->notification(get_string('nogradeexport', 'debug'), 'error'), 'mt-3'); +echo $OUTPUT->footer(); diff --git a/grade/export/key.php b/grade/export/key.php index 2922900ea08..595ce4c7d71 100644 --- a/grade/export/key.php +++ b/grade/export/key.php @@ -80,6 +80,7 @@ if ($id and $delete) { if (!$confirm) { $PAGE->set_title(get_string('deleteselectedkey')); $PAGE->set_heading($course->fullname); + $PAGE->set_secondary_active_tab('grades'); echo $OUTPUT->header(); $optionsyes = array('id'=>$id, 'delete'=>1, 'courseid'=>$courseid, 'sesskey'=>sesskey(), 'confirm'=>1); $optionsno = array('id'=>$courseid); @@ -133,7 +134,9 @@ $PAGE->navbar->add($strheading); /// Print header $PAGE->set_title($strkeys); $PAGE->set_heading($course->fullname); +$PAGE->set_secondary_active_tab('grades'); echo $OUTPUT->header(); +echo $OUTPUT->heading($strheading); $editform->display(); echo $OUTPUT->footer(); diff --git a/grade/export/keymanager.php b/grade/export/keymanager.php index 303a7a66af9..9ce3631ce4c 100644 --- a/grade/export/keymanager.php +++ b/grade/export/keymanager.php @@ -45,7 +45,10 @@ if (!isset($plugins['keymanager'])) { print_error('nopermissions'); } -print_grade_page_head($course->id, 'export', 'keymanager', get_string('keymanager', 'grades')); +$actionbar = new \core_grades\output\export_key_manager_action_bar($context); +print_grade_page_head($COURSE->id, 'export', 'keymanager', + get_string('keymanager', 'grades'), false, false, true, null, + null, null, $actionbar); $stredit = get_string('edit'); $strdelete = get_string('delete'); @@ -81,10 +84,5 @@ $table->align = array('left', 'left', 'left', 'center'); $table->width = '90%'; $table->data = $data; echo html_writer::table($table); - -echo $OUTPUT->container_start('buttons mdl-align'); -echo $OUTPUT->single_button(new moodle_url('key.php', array('courseid'=>$course->id)), get_string('newuserkey', 'userkey')); -echo $OUTPUT->container_end(); - echo $OUTPUT->footer(); diff --git a/grade/export/ods/export.php b/grade/export/ods/export.php index cfb3bfeeb5c..4d695ad11ef 100644 --- a/grade/export/ods/export.php +++ b/grade/export/ods/export.php @@ -37,7 +37,10 @@ require_capability('gradeexport/ods:view', $context); // If you use this method without this check, will break the direct grade exporting (without publishing). $key = optional_param('key', '', PARAM_RAW); if (!empty($CFG->gradepublishing) && !empty($key)) { - print_grade_page_head($COURSE->id, 'export', 'ods', get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_ods')); + $actionbar = new \core_grades\output\export_publish_action_bar($context, 'ods'); + print_grade_page_head($COURSE->id, 'export', 'ods', + get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_ods'), + false, false, true, null, null, null, $actionbar); } if (groups_get_course_groupmode($COURSE) == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) { diff --git a/grade/export/ods/index.php b/grade/export/ods/index.php index 9fe78e771ec..a1fb7b70de4 100644 --- a/grade/export/ods/index.php +++ b/grade/export/ods/index.php @@ -33,7 +33,10 @@ $context = context_course::instance($id); require_capability('moodle/grade:export', $context); require_capability('gradeexport/ods:view', $context); -print_grade_page_head($COURSE->id, 'export', 'ods', get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_ods')); +$actionbar = new \core_grades\output\export_action_bar($context, $PAGE->url, 'ods'); +print_grade_page_head($COURSE->id, 'export', 'ods', + get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_ods'), + false, false, true, null, null, null, $actionbar); export_verify_grades($COURSE->id); if (!empty($CFG->gradepublishing)) { diff --git a/grade/export/txt/export.php b/grade/export/txt/export.php index bba045ae3bd..2de9ba8482a 100644 --- a/grade/export/txt/export.php +++ b/grade/export/txt/export.php @@ -37,7 +37,10 @@ require_capability('gradeexport/txt:view', $context); // If you use this method without this check, will break the direct grade exporting (without publishing). $key = optional_param('key', '', PARAM_RAW); if (!empty($CFG->gradepublishing) && !empty($key)) { - print_grade_page_head($COURSE->id, 'export', 'txt', get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_txt')); + $actionbar = new \core_grades\output\export_publish_action_bar($context, 'txt'); + print_grade_page_head($COURSE->id, 'export', 'txt', + get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_txt'), + false, false, true, null, null, null, $actionbar); } if (groups_get_course_groupmode($COURSE) == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) { diff --git a/grade/export/txt/index.php b/grade/export/txt/index.php index 98c0f73c124..24c70bab0a6 100644 --- a/grade/export/txt/index.php +++ b/grade/export/txt/index.php @@ -33,7 +33,10 @@ $context = context_course::instance($id); require_capability('moodle/grade:export', $context); require_capability('gradeexport/txt:view', $context); -print_grade_page_head($COURSE->id, 'export', 'txt', get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_txt')); +$actionbar = new \core_grades\output\export_action_bar($context, $PAGE->url, 'txt'); +print_grade_page_head($COURSE->id, 'export', 'txt', + get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_txt'), + false, false, true, null, null, null, $actionbar); export_verify_grades($COURSE->id); if (!empty($CFG->gradepublishing)) { diff --git a/grade/export/xls/export.php b/grade/export/xls/export.php index 507ce12db82..3a1603d94c7 100644 --- a/grade/export/xls/export.php +++ b/grade/export/xls/export.php @@ -37,7 +37,10 @@ require_capability('gradeexport/xls:view', $context); // If you use this method without this check, will break the direct grade exporting (without publishing). $key = optional_param('key', '', PARAM_RAW); if (!empty($CFG->gradepublishing) && !empty($key)) { - print_grade_page_head($COURSE->id, 'export', 'xls', get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_xls')); + $actionbar = new \core_grades\output\export_publish_action_bar($context, 'xls'); + print_grade_page_head($COURSE->id, 'export', 'xls', + get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_xls'), + false, false, true, null, null, null, $actionbar); } if (groups_get_course_groupmode($COURSE) == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) { diff --git a/grade/export/xls/index.php b/grade/export/xls/index.php index 519f9eaa923..4654d930099 100644 --- a/grade/export/xls/index.php +++ b/grade/export/xls/index.php @@ -33,7 +33,10 @@ $context = context_course::instance($id); require_capability('moodle/grade:export', $context); require_capability('gradeexport/xls:view', $context); -print_grade_page_head($COURSE->id, 'export', 'xls', get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_xls')); +$actionbar = new \core_grades\output\export_action_bar($context, $PAGE->url, 'xls'); +print_grade_page_head($COURSE->id, 'export', 'xls', + get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_xls'), + false, false, true, null, null, null, $actionbar); export_verify_grades($COURSE->id); if (!empty($CFG->gradepublishing)) { diff --git a/grade/export/xml/export.php b/grade/export/xml/export.php index e3a55b0cb31..ba0d448326f 100644 --- a/grade/export/xml/export.php +++ b/grade/export/xml/export.php @@ -37,7 +37,10 @@ require_capability('gradeexport/xml:view', $context); // If you use this method without this check, will break the direct grade exporting (without publishing). $key = optional_param('key', '', PARAM_RAW); if (!empty($CFG->gradepublishing) && !empty($key)) { - print_grade_page_head($COURSE->id, 'export', 'xml', get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_xml')); + $actionbar = new \core_grades\output\export_publish_action_bar($context, 'xml'); + print_grade_page_head($COURSE->id, 'export', 'xml', + get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_xml'), + false, false, true, null, null, null, $actionbar); } if (groups_get_course_groupmode($COURSE) == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) { diff --git a/grade/export/xml/index.php b/grade/export/xml/index.php index 40fa2ec9480..530a4a4fde7 100644 --- a/grade/export/xml/index.php +++ b/grade/export/xml/index.php @@ -33,7 +33,10 @@ $context = context_course::instance($id); require_capability('moodle/grade:export', $context); require_capability('gradeexport/xml:view', $context); -print_grade_page_head($COURSE->id, 'export', 'xml', get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_xml')); +$actionbar = new \core_grades\output\export_action_bar($context, $PAGE->url, 'xml'); +print_grade_page_head($COURSE->id, 'export', 'xml', + get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_xml'), + false, false, true, null, null, null, $actionbar); export_verify_grades($COURSE->id); if (!empty($CFG->gradepublishing)) { diff --git a/grade/templates/export_action_bar.mustache b/grade/templates/export_action_bar.mustache new file mode 100644 index 00000000000..162eff40352 --- /dev/null +++ b/grade/templates/export_action_bar.mustache @@ -0,0 +1,82 @@ +{{! + This file is part of Moodle - http://moodle.org/ + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template core_grades/export_action_bar + + Actions bar for the gradebook export pages. + + Context variables required for this template: + * generalnavselector - The data object containing the required properties to render the general navigation selector. + * exportselector - The data object containing the required properties to render the export options selector. + + Example context (json): + { + "generalnavselector": { + "id": "url_select12345", + "action": "https://example.com/get", + "classes": "urlselect", + "formid": "gradesactionselect", + "sesskey": "sesskey", + "label": "", + "helpicon": false, + "showbutton": null, + "options": [{ + "name": "View", "isgroup": true, "options": + [ + {"name": "Grader report", "isgroup": false, "value": "/grade/report/grader/index.php"} + ]}, + {"name": "Setup", "isgroup": true, "options": + [ + {"name": "Gradebook setup", "isgroup": false, "value": "/grade/edit/tree/index.php"} + ]}], + "disabled": false, + "title": null + }, + "exportselector": { + "id": "url_select56789", + "action": "https://example.com/get", + "formid": "gradesexportactionselect", + "sesskey": "sesskey", + "classes": "urlselect", + "label": "", + "helpicon": false, + "showbutton": null, + "options": [ + { + "name": "OpenDocument spreadsheet", + "value": "/grade/export/ods/index.php", + "selected": true + } + ], + "disabled": false, + "title": null + } + } +}} +
+
+
+
+ {{#generalnavselector}} + {{>core/url_select}} + {{/generalnavselector}} +
+
+ {{#exportselector}} + {{>core/url_select}} + {{/exportselector}} +
+
+
+
diff --git a/grade/templates/export_key_manager_action_bar.mustache b/grade/templates/export_key_manager_action_bar.mustache new file mode 100644 index 00000000000..b0a58cd44b8 --- /dev/null +++ b/grade/templates/export_key_manager_action_bar.mustache @@ -0,0 +1,99 @@ +{{! + This file is part of Moodle - http://moodle.org/ + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template core_grades/export_key_manager_action_bar + + Actions bar for the gradebook exports key manager page. + + Context variables required for this template: + * generalnavselector - The data object containing the required properties to render the general navigation selector. + * exportselector - The data object containing the required properties to render the export options selector. + * adduserkeybutton - The data object containing the required properties to render the 'add user key' button. + + Example context (json): + { + "generalnavselector": { + "id": "url_select12345", + "action": "https://example.com/get", + "classes": "urlselect", + "formid": "gradesactionselect", + "sesskey": "sesskey", + "label": "", + "helpicon": false, + "showbutton": null, + "options": [{ + "name": "View", "isgroup": true, "options": + [ + {"name": "Grader report", "isgroup": false, "value": "/grade/report/grader/index.php"} + ]}, + {"name": "Setup", "isgroup": true, "options": + [ + {"name": "Gradebook setup", "isgroup": false, "value": "/grade/edit/tree/index.php"} + ]}], + "disabled": false, + "title": null + }, + "exportselector": { + "id": "url_select56789", + "action": "https://example.com/get", + "formid": "gradesexportactionselect", + "sesskey": "sesskey", + "classes": "urlselect", + "label": "", + "helpicon": false, + "showbutton": null, + "options": [ + { + "name": "OpenDocument spreadsheet", + "value": "/grade/export/ods/index.php", + "selected": true + } + ], + "disabled": false, + "title": null + }, + "adduserkeybutton": { + "id": "single_button12345", + "method" : "get", + "classes": "singlebutton", + "formid": null, + "url" : "#", + "primary" : true, + "tooltip" : null, + "label" : "Add user key", + "attributes": [] + } + } +}} +
+
+
+
+ {{#generalnavselector}} + {{>core/url_select}} + {{/generalnavselector}} +
+
+ {{#exportselector}} + {{>core/url_select}} + {{/exportselector}} +
+ {{#adduserkeybutton}} +
+ {{>core/single_button}} +
+ {{/adduserkeybutton}} +
+
+
diff --git a/grade/templates/export_publish_action_bar.mustache b/grade/templates/export_publish_action_bar.mustache new file mode 100644 index 00000000000..b2d7588087f --- /dev/null +++ b/grade/templates/export_publish_action_bar.mustache @@ -0,0 +1,45 @@ +{{! + This file is part of Moodle - http://moodle.org/ + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template core_grades/export_publish_action_bar + + Actions bar for the gradebook publish export page. + + Context variables required for this template: + * backbutton - The data object containing the required properties to render the 'back' button. + + Example context (json): + { + "backbutton": { + "id": "single_button12345", + "method" : "get", + "classes": "singlebutton", + "formid": null, + "url" : "#", + "primary" : false, + "tooltip" : null, + "label" : "Back", + "attributes": [] + } + } +}} +
+
+
+ {{#backbutton}} + {{>core/single_button}} + {{/backbutton}} +
+
+
-- 2.11.4.GIT