From: David Mudrak Date: Mon, 4 Jan 2010 18:01:15 +0000 (+0000) Subject: Uses tabs for all actions, removed temporary links X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3189fb2d428c9ab5fa814cc98592e9e1245c3f64;p=moodle.git Uses tabs for all actions, removed temporary links --- diff --git a/mod/workshop/allocation.php b/mod/workshop/allocation.php index cb03276a17..e476637705 100644 --- a/mod/workshop/allocation.php +++ b/mod/workshop/allocation.php @@ -58,11 +58,8 @@ $wsoutput = $PAGE->theme->get_renderer('mod_workshop', $PAGE); echo $OUTPUT->header(); $allocators = $workshop->installed_allocators(); -$tabrow = array(); -foreach ($allocators as $methodid => $methodname) { - $tabrow[] = new tabobject($methodid, "allocation.php?cmid={$cmid}&method={$methodid}", $methodname); -} -print_tabs(array($tabrow), $method); // todo use $output call +$currenttab = 'allocation'; +include(dirname(__FILE__) . '/tabs.php'); if (!empty($initresult)) { echo $OUTPUT->container_start('allocator-init-results'); diff --git a/mod/workshop/allocation/manual/renderer.php b/mod/workshop/allocation/manual/renderer.php index 4f9edb9879..a7b2ec6d7e 100644 --- a/mod/workshop/allocation/manual/renderer.php +++ b/mod/workshop/allocation/manual/renderer.php @@ -180,6 +180,7 @@ class moodle_workshopallocation_manual_renderer extends moodle_renderer_base { $exclude = array(); if (!$workshop->useselfassessment) { $exclude[$user->id] = true; + $o .= $this->output->container(get_string('selfassessmentdisabled', 'workshop'), 'info'); } // todo add an option to exclude users without own submission // todo nice to have number of current allocations for every user plus ordering by it diff --git a/mod/workshop/allocation/random/allocator.php b/mod/workshop/allocation/random/allocator.php index a4e10108e5..07ec9f670b 100644 --- a/mod/workshop/allocation/random/allocator.php +++ b/mod/workshop/allocation/random/allocator.php @@ -78,7 +78,7 @@ class workshop_random_allocator implements workshop_allocator { $removecurrent = required_param('removecurrent', PARAM_INT); $assesswosubmission = required_param('assesswosubmission', PARAM_INT); $musthavesubmission = empty($assesswosubmission); - $addselfassessment = required_param('addselfassessment', PARAM_INT); + $addselfassessment = optional_param('addselfassessment', false, PARAM_INT); // may be frozen in the form $authors = $this->workshop->get_peer_authors(); $authors = $this->workshop->get_grouped($authors); diff --git a/mod/workshop/allocation/random/settings_form.php b/mod/workshop/allocation/random/settings_form.php index c2585f16a2..da35a5a4c9 100644 --- a/mod/workshop/allocation/random/settings_form.php +++ b/mod/workshop/allocation/random/settings_form.php @@ -78,8 +78,17 @@ class workshop_random_allocator_form extends moodleform { $mform->addElement('advcheckbox', 'assesswosubmission', get_string('assesswosubmission', 'workshopallocation_random')); $mform->setDefault('assesswosubmission', 0); - $mform->addElement('advcheckbox', 'addselfassessment', get_string('addselfassessment', 'workshopallocation_random')); + $grpselfassessment = array(); + $grpselfassessment[] = $mform->createElement('advcheckbox', 'addselfassessment'); $mform->setDefault('addselfassessment', 0); + if (!$workshop->useselfassessment) { + $grpselfassessment[] = $mform->createElement('static', 'selfassessmentcheck', '', + get_string('selfassessmentdisabled', 'workshop')); + } + $mform->addGroup($grpselfassessment, 'grpselfassessment', get_string('addselfassessment', 'workshopallocation_random')); + if (!$workshop->useselfassessment) { + $mform->freeze(array('grpselfassessment')); + } $this->add_action_buttons(); } diff --git a/mod/workshop/develtools.php b/mod/workshop/develtools.php index 623a5e89b7..c0725355ba 100644 --- a/mod/workshop/develtools.php +++ b/mod/workshop/develtools.php @@ -101,6 +101,8 @@ case 'menu': // no break, skip to default default: echo $OUTPUT->header(); + $currenttab = 'develtools'; + include(dirname(__FILE__) . '/tabs.php'); echo $OUTPUT->heading('Workshop development tools', 1); echo '