]> git.mjollnir.org Git - moodle.git/commitdiff
workshop MDL-21169 removed Update this Workshop button, replaced with settings block...
authorDavid Mudrak <david.mudrak@gmail.com>
Mon, 4 Jan 2010 18:30:09 +0000 (18:30 +0000)
committerDavid Mudrak <david.mudrak@gmail.com>
Mon, 4 Jan 2010 18:30:09 +0000 (18:30 +0000)
mod/workshop/lib.php
mod/workshop/view.php

index 949ecaa1ccd76fa001f812add0697baad6e477c1..591ef3945dbfc8edb3a1c220f924fe16fb02370b 100644 (file)
@@ -704,11 +704,15 @@ function workshop_extend_settings_navigation(settings_navigation $settingsnav, s
     $workshopnode->forceopen = true;
     //$workshopobject = $DB->get_record("workshop", array("id" => $PAGE->cm->instance));
 
+    if (has_capability('moodle/course:manageactivities', $PAGE->cm->context)) {
+        $url = new moodle_url($CFG->wwwroot . '/course/mod.php', array('update' => $PAGE->cm->id, 'return' => true, 'sesskey' => sesskey()));
+        $workshopnode->add(get_string('updatethis', '', get_string('modulename', 'workshop')), $url, settings_navigation::TYPE_SETTING);
+    }
     if (has_capability('mod/workshop:editdimensions', $PAGE->cm->context)) {
         $url = new moodle_url($CFG->wwwroot . '/mod/workshop/editform.php', array('cmid' => $PAGE->cm->id));
         $workshopnode->add(get_string('editassessmentform', 'workshop'), $url, settings_navigation::TYPE_SETTING);
     }
-    if (has_capability('mod/workshop:allocate', $PAGE->context)) {
+    if (has_capability('mod/workshop:allocate', $PAGE->cm->context)) {
         $url = new moodle_url($CFG->wwwroot . '/mod/workshop/allocation.php', array('cmid' => $PAGE->cm->id));
         $workshopnode->add(get_string('allocate', 'workshop'), $url, settings_navigation::TYPE_SETTING);
     }
index 791e5222042f93c14d4133b1dea1902dd21ac5c8..55144b420386d21d4899801c80c6ffff8ddb2f7e 100644 (file)
@@ -57,18 +57,6 @@ $PAGE->set_url($workshop->view_url());
 $PAGE->set_title($workshop->name);
 $PAGE->set_heading($course->fullname);
 
-// todo 
-$buttons = array();
-if ($PAGE->user_allowed_editing()) {
-    $editblocks                 = new html_form();
-    $editblocks->method         = 'get';
-    $editblocks->button->text   = get_string($PAGE->user_is_editing() ? 'blockseditoff' : 'blocksediton');
-    $editblocks->url            = new moodle_url($PAGE->url, array('editmode' => $PAGE->user_is_editing() ? 'off' : 'on'));
-    $buttons[] = $OUTPUT->button($editblocks);
-}
-$buttons[] = $OUTPUT->update_module_button($cm->id, 'workshop');
-$PAGE->set_button(implode('', $buttons));
-
 $wsoutput = $PAGE->get_renderer('mod_workshop');
 
 /// Output starts here