mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-40975 Blocks: Move most block actions into the block menu
This commit is contained in:
parent
7fd16ca1fd
commit
803912ae69
@ -1050,7 +1050,7 @@ class block_manager {
|
||||
if ($this->page->user_can_edit_blocks() || $block->user_can_edit()) {
|
||||
// Edit config icon - always show - needed for positioning UI.
|
||||
$str = new lang_string('configureblock', 'block', $blocktitle);
|
||||
$controls[] = new action_menu_link_primary(
|
||||
$controls[] = new action_menu_link_secondary(
|
||||
new moodle_url($actionurl, array('bui_editid' => $block->instance->id)),
|
||||
new pix_icon('t/edit', $str, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
$str,
|
||||
@ -1059,17 +1059,6 @@ class block_manager {
|
||||
|
||||
}
|
||||
|
||||
if ($this->user_can_delete_block($block)) {
|
||||
// Delete icon.
|
||||
$str = new lang_string('deleteblock', 'block', $blocktitle);
|
||||
$controls[] = new action_menu_link_secondary(
|
||||
new moodle_url($actionurl, array('bui_deleteid' => $block->instance->id)),
|
||||
new pix_icon('t/delete', $str, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
$str,
|
||||
array('class' => 'editing_delete')
|
||||
);
|
||||
}
|
||||
|
||||
if ($this->page->user_can_edit_blocks() && $block->instance_can_be_hidden()) {
|
||||
// Show/hide icon.
|
||||
if ($block->instance->visible) {
|
||||
@ -1083,7 +1072,7 @@ class block_manager {
|
||||
$icon = new pix_icon('t/show', $str, 'moodle', array('class' => 'iconsmall', 'title' => ''));
|
||||
$attributes = array('class' => 'editing_show');
|
||||
}
|
||||
$controls[] = new action_menu_link_primary($url, $icon, $str, $attributes);
|
||||
$controls[] = new action_menu_link_secondary($url, $icon, $str, $attributes);
|
||||
}
|
||||
|
||||
// Assign roles icon.
|
||||
@ -1105,6 +1094,18 @@ class block_manager {
|
||||
array('class' => 'editing_roles')
|
||||
);
|
||||
}
|
||||
|
||||
if ($this->user_can_delete_block($block)) {
|
||||
// Delete icon.
|
||||
$str = new lang_string('deleteblock', 'block', $blocktitle);
|
||||
$controls[] = new action_menu_link_secondary(
|
||||
new moodle_url($actionurl, array('bui_deleteid' => $block->instance->id)),
|
||||
new pix_icon('t/delete', $str, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||
$str,
|
||||
array('class' => 'editing_delete')
|
||||
);
|
||||
}
|
||||
|
||||
return $controls;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user