diff --git a/classes/output/tabs.php b/classes/output/tabs.php index 625032d..b119d33 100644 --- a/classes/output/tabs.php +++ b/classes/output/tabs.php @@ -90,6 +90,12 @@ public function export_for_template(\renderer_base $output): array { 'title' => get_string('report_page_groups', 'tool_excimer'), 'text' => get_string('tab_page_groups', 'tool_excimer'), ], + [ + 'id' => 'import', + 'link' => [['link' => new \moodle_url('/admin/tool/excimer/import.php')]], + 'title' => get_string('import_profile', 'tool_excimer'), + 'text' => get_string('tab_import', 'tool_excimer'), + ], ], ]; diff --git a/import.php b/import.php index 3171626..dba788f 100644 --- a/import.php +++ b/import.php @@ -39,14 +39,13 @@ // Check for caps. require_capability('moodle/site:config', context_system::instance()); -$overviewurl = new moodle_url('/admin/category.php?category=tool_excimer_reports'); $url = new moodle_url('/admin/tool/excimer/import.php'); $PAGE->set_url($url); $customdata = []; $form = new import_form($PAGE->url->out(false), $customdata); if ($form->is_cancelled()) { - redirect($overviewurl); + redirect($url); } if (($data = $form->get_data())) { @@ -58,7 +57,7 @@ if (empty($id)) { // Failed to save the imported profile. \core\notification::error(get_string('import_error', 'tool_excimer')); - redirect($overviewurl); + redirect($url); } // The import was a success, so redirect to the imported profile. @@ -81,8 +80,9 @@ $PAGE->set_heading(get_string('pluginname', 'tool_excimer')); echo $OUTPUT->header(); -// Output headings. -echo $OUTPUT->heading($heading); +$renderer = $PAGE->get_renderer('tool_excimer'); +$tabs = new tool_excimer\output\tabs($url); +echo $renderer->render_tabs($tabs); // And display the form, and its validation errors if there are any. $form->display(); diff --git a/lang/en/tool_excimer.php b/lang/en/tool_excimer.php index 8212360..b658827 100644 --- a/lang/en/tool_excimer.php +++ b/lang/en/tool_excimer.php @@ -106,6 +106,7 @@ $string['unfinished'] = 'Unfinished'; $string['tab_page_groups'] = 'Page Groups'; $string['tab_page_course'] = 'Courses'; +$string['tab_import'] = 'Import'; // Month Selector. $string['displaying_month'] = 'Displaying month';