From: tjhunt Date: Thu, 16 Jul 2009 11:05:26 +0000 (+0000) Subject: blocks editing ui: MDL-19398 Can now edit the position of any block. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=73e2e5c03dcc1aa3b7a9a2c1303559b05ae773b0;p=moodle.git blocks editing ui: MDL-19398 Can now edit the position of any block. I think this is probaby insecure at the moment. I am still working on it. --- diff --git a/blocks/edit.php b/blocks/edit.php index 369f606a33..8a584c2b96 100644 --- a/blocks/edit.php +++ b/blocks/edit.php @@ -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')); } diff --git a/lib/blocklib.php b/lib/blocklib.php index 347f88b742..c1289ca004 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -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)) {