MDL-71915 mod_workshop: Update tertiary nav

Update the tertiary navigation for the mod_workshop.
This also include a fix for behat tests due to the
tertiary navigation change made.
This commit is contained in:
Sujith Haridasan
2021-12-04 18:09:14 +05:30
parent 51149a78cc
commit e0f584d64c
15 changed files with 190 additions and 70 deletions
+8 -17
View File
@@ -38,7 +38,8 @@ $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EX
$workshop = $DB->get_record('workshop', array('id' => $cm->instance), '*', MUST_EXIST);
$workshop = new workshop($workshop, $cm, $course);
$PAGE->set_url($workshop->allocation_url($method));
$url = $workshop->allocation_url($method);
$PAGE->set_url($url);
require_login($course, false, $cm);
$context = $PAGE->context;
@@ -54,25 +55,15 @@ $initresult = $allocator->init();
//
// Output starts here
//
$actionbar = new \mod_workshop\output\actionbar($url, $workshop);
$output = $PAGE->get_renderer('mod_workshop');
echo $output->header();
echo $OUTPUT->heading(format_string($workshop->name));
$allocators = workshop::installed_allocators();
if (!empty($allocators)) {
$tabs = array();
$row = array();
$inactive = array();
$activated = array();
foreach ($allocators as $methodid => $methodname) {
$row[] = new tabobject($methodid, $workshop->allocation_url($methodid)->out(), $methodname);
if ($methodid == $method) {
$currenttab = $methodid;
}
}
if (!$PAGE->has_secondary_navigation()) {
echo $OUTPUT->heading(format_string($workshop->name));
}
$tabs[] = $row;
print_tabs($tabs, $currenttab, $inactive, $activated);
echo $actionbar->get_allocation_menu();
if (is_null($initresult->get_status()) or $initresult->get_status() == workshop_allocation_result::STATUS_VOID) {
echo $output->container_start('allocator-ui');