]> git.mjollnir.org Git - moodle.git/commitdiff
blocks editing ui: MDL-19398 Can now edit the position of any block.
authortjhunt <tjhunt>
Thu, 16 Jul 2009 11:05:26 +0000 (11:05 +0000)
committertjhunt <tjhunt>
Thu, 16 Jul 2009 11:05:26 +0000 (11:05 +0000)
I think this is probaby insecure at the moment. I am still working on it.

blocks/edit.php
lib/blocklib.php

index 369f606a3331e2b1de2c7c7b9dba72615ad72b86..8a584c2b96701f66f7e96a568bfe33f3ff41da9f 100644 (file)
@@ -57,7 +57,7 @@ $blockpage->set_url($url->out(true), $url->params());
 
 $block = block_load_for_page($blockid, $blockpage);
 
-if (!$block->user_can_edit() || (!$block->instance_allow_multiple() && !$block->instance_allow_config())) {
+if (!$block->user_can_edit()) {
     throw new moodle_exception('nopermissions', '', $page->url->out(), get_string('editblock'));
 }
 
index 347f88b742f8ad6ff88fc045096805cbe47a3bf7..c1289ca004c44a5055845ebcf64840270eddb6ff 100644 (file)
@@ -936,11 +936,9 @@ function block_edit_controls($block, $page) {
                     'icon' => 't/show', 'caption' => get_string('show'));
         }
 
-        // Edit config icon.
-        if ($block->instance_allow_multiple() || $block->instance_allow_config()) {
-            $controls[] = array('url' => block_edit_url($block, $page)->out(),
-                    'icon' => 't/edit', 'caption' => get_string('configuration'));
-        }
+        // Edit config icon - always show - needed for positioning UI.
+        $controls[] = array('url' => block_edit_url($block, $page)->out(),
+                'icon' => 't/edit', 'caption' => get_string('configuration'));
 
         // Delete icon.
         if ($block->user_can_addto($page)) {