Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-25602 blocks Altered order of block editing icons and added CSS t…

…o better control the size of block editing icons
  • Loading branch information...
commit 6919b90f05b975f7d5d1c2beae12ca4ced44b4f1 1 parent 7969f1e
@samhemelryk samhemelryk authored
View
53 lib/blocklib.php
@@ -1007,29 +1007,10 @@ public function edit_controls($block) {
$controls = array();
$actionurl = $this->page->url->out(false, array('sesskey'=> sesskey()));
- // Assign roles icon.
- if (has_capability('moodle/role:assign', $block->context)) {
- //TODO: please note it is sloppy to pass urls through page parameters!!
- // it is shortened because some web servers (e.g. IIS by default) give
- // a 'security' error if you try to pass a full URL as a GET parameter in another URL.
-
- $return = $this->page->url->out(false);
- $return = str_replace($CFG->wwwroot . '/', '', $return);
-
- $controls[] = array('url' => $CFG->wwwroot . '/' . $CFG->admin .
- '/roles/assign.php?contextid=' . $block->context->id . '&returnurl=' . urlencode($return),
- 'icon' => 'i/roles', 'caption' => get_string('assignroles', 'role'));
- }
-
- if ($this->page->user_can_edit_blocks() && $block->instance_can_be_hidden()) {
- // Show/hide icon.
- if ($block->instance->visible) {
- $controls[] = array('url' => $actionurl . '&bui_hideid=' . $block->instance->id,
- 'icon' => 't/hide', 'caption' => get_string('hide'));
- } else {
- $controls[] = array('url' => $actionurl . '&bui_showid=' . $block->instance->id,
- 'icon' => 't/show', 'caption' => get_string('show'));
- }
+ if ($this->page->user_can_edit_blocks()) {
+ // Move icon.
+ $controls[] = array('url' => $actionurl . '&bui_moveid=' . $block->instance->id,
+ 'icon' => 't/move', 'caption' => get_string('move'));
}
if ($this->page->user_can_edit_blocks() || $block->user_can_edit()) {
@@ -1048,10 +1029,28 @@ public function edit_controls($block) {
}
}
- if ($this->page->user_can_edit_blocks()) {
- // Move icon.
- $controls[] = array('url' => $actionurl . '&bui_moveid=' . $block->instance->id,
- 'icon' => 't/move', 'caption' => get_string('move'));
+ if ($this->page->user_can_edit_blocks() && $block->instance_can_be_hidden()) {
+ // Show/hide icon.
+ if ($block->instance->visible) {
+ $controls[] = array('url' => $actionurl . '&bui_hideid=' . $block->instance->id,
+ 'icon' => 't/hide', 'caption' => get_string('hide'));
+ } else {
+ $controls[] = array('url' => $actionurl . '&bui_showid=' . $block->instance->id,
+ 'icon' => 't/show', 'caption' => get_string('show'));
+ }
+ }
+
+ // Assign roles icon.
+ if (has_capability('moodle/role:assign', $block->context)) {
+ //TODO: please note it is sloppy to pass urls through page parameters!!
+ // it is shortened because some web servers (e.g. IIS by default) give
+ // a 'security' error if you try to pass a full URL as a GET parameter in another URL.
+ $return = $this->page->url->out(false);
+ $return = str_replace($CFG->wwwroot . '/', '', $return);
+
+ $controls[] = array('url' => $CFG->wwwroot . '/' . $CFG->admin .
+ '/roles/assign.php?contextid=' . $block->context->id . '&returnurl=' . urlencode($return),
+ 'icon' => 'i/roles', 'caption' => get_string('assignroles', 'role'));
}
return $controls;
View
2  theme/base/style/blocks.css
@@ -2,6 +2,8 @@
.block .header h2 {margin:4px;}
.block .header .block_action {float:right;margin:0 4px;vertical-align:top;}
.block .header .block_action input {margin-right:2px;}
+.block .header .commands {margin-left:4px;}
+.block .header .commands .icon img {width:11px;height:11px;margin-right:1px;}
.block .content {padding:4px;}
.block.hidden .content {display: none;}
.block .content .userpicture {width:16px;height:16px;margin-right:4px;}
View
4 theme/standard/style/blocks.css
@@ -8,7 +8,7 @@
.block .content {border-color: #dddddd;background-color:#FCFCFC;}
.block .content hr {border-top-color:#999999;}
.block .header .commands {font-size:0.9em;clear:both;}
-.block .header .commands .icon { padding-left:2px;padding-right:2px;margin-right:2px;}
+.block .header .commands .icon {margin-right:2px;}
.block .footer {font-size:0.9em;text-align:center;clear:both;}
.block.beingmoved {border-color: #f88;}
@@ -85,4 +85,4 @@
.block_rss_client .list li .description {color:#555555;font-size:0.8em;padding-left:1em;}
/** Site main menu **/
-.block_site_main_menu .footer select {font-size: 0.8em;}
+.block_site_main_menu .footer select {font-size: 0.8em;}
Please sign in to comment.
Something went wrong with that request. Please try again.