Skip to content

Commit

Permalink
MDL-36633 usability: Styling over the admin pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart committed Nov 21, 2012
1 parent 6bf410e commit fa9c0aa
Show file tree
Hide file tree
Showing 21 changed files with 93 additions and 60 deletions.
8 changes: 4 additions & 4 deletions admin/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,10 @@
$visible = '';
} else if ($blocks[$blockid]->visible) {
$visible = '<a href="blocks.php?hide='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strhide.'">'.
'<img src="'.$OUTPUT->pix_url('i/hide') . '" class="icon" alt="'.$strhide.'" /></a>';
'<img src="'.$OUTPUT->pix_url('t/hide') . '" class="iconsmall" alt="'.$strhide.'" /></a>';
} else {
$visible = '<a href="blocks.php?show='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strshow.'">'.
'<img src="'.$OUTPUT->pix_url('i/show') . '" class="icon" alt="'.$strshow.'" /></a>';
'<img src="'.$OUTPUT->pix_url('t/show') . '" class="iconsmall" alt="'.$strshow.'" /></a>';
$class = ' class="dimmed_text"'; // Leading space required!
}

Expand All @@ -219,10 +219,10 @@
$undeletable = '';
} else if (in_array($blockname, $undeletableblocktypes)) {
$undeletable = '<a href="blocks.php?unprotect='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strunprotect.'">'.
'<img src="'.$OUTPUT->pix_url('t/unlock') . '" class="icon" alt="'.$strunprotect.'" /></a>';
'<img src="'.$OUTPUT->pix_url('t/unlock') . '" class="iconsmall" alt="'.$strunprotect.'" /></a>';
} else {
$undeletable = '<a href="blocks.php?protect='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strprotect.'">'.
'<img src="'.$OUTPUT->pix_url('t/unlock_gray') . '" class="icon" alt="'.$strprotect.'" /></a>';
'<img src="'.$OUTPUT->pix_url('t/lock') . '" class="iconsmall" alt="'.$strprotect.'" /></a>';
}

$row = array(
Expand Down
6 changes: 3 additions & 3 deletions admin/filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,15 @@ function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings)

// Re-order
$updown = '';
$spacer = '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" /> ';
$spacer = '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" />';
if ($filterinfo->active != TEXTFILTER_DISABLED) {
if (!$isfirstrow) {
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'up'), new pix_icon('t/up', get_string('up')));
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'up'), new pix_icon('t/up', get_string('up'), '', array('class' => 'iconsmall')));
} else {
$updown .= $spacer;
}
if (!$islastactive) {
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'down'), new pix_icon('t/down', get_string('down')));
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'down'), new pix_icon('t/down', get_string('down'), '', array('class' => 'iconsmall')));
} else {
$updown .= $spacer;
}
Expand Down
4 changes: 2 additions & 2 deletions admin/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@
$class = '';
} else if ($module->visible) {
$visible = "<a href=\"modules.php?hide=$module->name&amp;sesskey=".sesskey()."\" title=\"$strhide\">".
"<img src=\"" . $OUTPUT->pix_url('i/hide') . "\" class=\"icon\" alt=\"$strhide\" /></a>";
"<img src=\"" . $OUTPUT->pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"$strhide\" /></a>";
$class = '';
} else {
$visible = "<a href=\"modules.php?show=$module->name&amp;sesskey=".sesskey()."\" title=\"$strshow\">".
"<img src=\"" . $OUTPUT->pix_url('i/show') . "\" class=\"icon\" alt=\"$strshow\" /></a>";
"<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strshow\" /></a>";
$class = ' class="dimmed_text"';
}
if ($module->name == "forum") {
Expand Down
10 changes: 5 additions & 5 deletions admin/qbehaviours.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
$rowclass = 'dimmed_text';
}
} else {
$icons = $OUTPUT->spacer() . ' ';
$icons = $OUTPUT->spacer(array('class' => 'iconsmall'));
}

// Move icons.
Expand All @@ -284,10 +284,10 @@

function question_behaviour_enable_disable_icons($behaviour, $enabled) {
if ($enabled) {
return question_behaviour_icon_html('disable', $behaviour, 'i/hide',
return question_behaviour_icon_html('disable', $behaviour, 't/hide',
get_string('enabled', 'question'), get_string('disable'));
} else {
return question_behaviour_icon_html('enable', $behaviour, 'i/show',
return question_behaviour_icon_html('enable', $behaviour, 't/show',
get_string('disabled', 'question'), get_string('enable'));
}
}
Expand All @@ -296,7 +296,7 @@ function question_behaviour_icon_html($action, $behaviour, $icon, $alt, $tip) {
global $OUTPUT;
return $OUTPUT->action_icon(new moodle_url('/admin/qbehaviours.php',
array($action => $behaviour, 'sesskey' => sesskey())),
new pix_icon($icon, $alt, 'moodle', array('title' => '')),
null, array('title' => $tip)) . ' ';
new pix_icon($icon, $alt, 'moodle', array('title' => '', 'class' => 'iconsmall')),
null, array('title' => $tip));
}

10 changes: 5 additions & 5 deletions admin/qtypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
$rowclass = 'dimmed_text';
}
} else {
$icons = $OUTPUT->spacer() . ' ';
$icons = $OUTPUT->spacer();
}

// Move icons.
Expand Down Expand Up @@ -294,10 +294,10 @@

function question_types_enable_disable_icons($qtypename, $createable) {
if ($createable) {
return question_type_icon_html('disable', $qtypename, 'i/hide',
return question_type_icon_html('disable', $qtypename, 't/hide',
get_string('enabled', 'question'), get_string('disable'));
} else {
return question_type_icon_html('enable', $qtypename, 'i/show',
return question_type_icon_html('enable', $qtypename, 't/show',
get_string('disabled', 'question'), get_string('enable'));
}
}
Expand All @@ -306,7 +306,7 @@ function question_type_icon_html($action, $qtypename, $icon, $alt, $tip) {
global $OUTPUT;
return $OUTPUT->action_icon(new moodle_url('/admin/qtypes.php',
array($action => $qtypename, 'sesskey' => sesskey())),
new pix_icon($icon, $alt, 'moodle', array('title' => '')),
null, array('title' => $tip)) . ' ';
new pix_icon($icon, $alt, 'moodle', array('title' => '', 'class' => 'iconsmall')),
null, array('title' => $tip));
}

6 changes: 3 additions & 3 deletions admin/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1092,17 +1092,17 @@ public function plugins_control_panel(plugin_manager $pluginman, array $options
$row->attributes['class'] = 'type-' . $plugin->type . ' name-' . $plugin->type . '_' . $plugin->name;

if ($this->page->theme->resolve_image_location('icon', $plugin->type . '_' . $plugin->name)) {
$icon = $this->output->pix_icon('icon', '', $plugin->type . '_' . $plugin->name, array('class' => 'smallicon pluginicon'));
$icon = $this->output->pix_icon('icon', '', $plugin->type . '_' . $plugin->name, array('class' => 'icon pluginicon'));
} else {
$icon = $this->output->pix_icon('spacer', '', 'moodle', array('class' => 'smallicon pluginicon noicon'));
$icon = $this->output->pix_icon('spacer', '', 'moodle', array('class' => 'icon pluginicon noicon'));
}
if ($plugin->get_status() === plugin_manager::PLUGIN_STATUS_MISSING) {
$msg = html_writer::tag('span', get_string('status_missing', 'core_plugin'), array('class' => 'notifyproblem'));
$row->attributes['class'] .= ' missingfromdisk';
} else {
$msg = '';
}
$pluginname = html_writer::tag('div', $icon . ' ' . $plugin->displayname . ' ' . $msg, array('class' => 'displayname')).
$pluginname = html_writer::tag('div', $icon . '' . $plugin->displayname . ' ' . $msg, array('class' => 'displayname')).
html_writer::tag('div', $plugin->component, array('class' => 'componentname'));
$pluginname = new html_table_cell($pluginname);

Expand Down
2 changes: 1 addition & 1 deletion cache/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function store_instance_summariers(array $stores, array $plugins) {

$info = '';
if (!empty($store['default'])) {
$info = $this->output->pix_icon('i/info', $defaultstoreactions).' ';
$info = $this->output->pix_icon('i/info', $defaultstoreactions, '', array('class' => 'icon'));
}
$htmlactions = array();
foreach ($actions as $action) {
Expand Down
2 changes: 1 addition & 1 deletion grade/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2274,7 +2274,7 @@ function grade_button($type, $courseid, $object) {
$url = new moodle_url('edit.php', array('courseid' => $courseid, 'id' => $object->id));
}

return $OUTPUT->action_icon($url, new pix_icon('t/'.$type, ${'str'.$type}));
return $OUTPUT->action_icon($url, new pix_icon('t/'.$type, ${'str'.$type}, '', array('class' => 'iconsmall')));

}

Expand Down
26 changes: 13 additions & 13 deletions lib/adminlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -5063,13 +5063,13 @@ public function output_html($data, $query='') {
if (isset($active_enrols[$enrol])) {
$aurl = new moodle_url($url, array('action'=>'disable', 'enrol'=>$enrol));
$hideshow = "<a href=\"$aurl\">";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('i/hide') . "\" class=\"icon\" alt=\"$strdisable\" /></a>";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"$strdisable\" /></a>";
$enabled = true;
$displayname = "<span>$name</span>";
} else if (isset($enrols_available[$enrol])) {
$aurl = new moodle_url($url, array('action'=>'enable', 'enrol'=>$enrol));
$hideshow = "<a href=\"$aurl\">";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('i/show') . "\" class=\"icon\" alt=\"$strenable\" /></a>";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strenable\" /></a>";
$enabled = false;
$displayname = "<span class=\"dimmed_text\">$name</span>";
} else {
Expand Down Expand Up @@ -5597,14 +5597,14 @@ public function output_html($data, $query='') {
// hide/show link
if (in_array($auth, $authsenabled)) {
$hideshow = "<a href=\"$url&amp;action=disable&amp;auth=$auth\">";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('i/hide') . "\" class=\"icon\" alt=\"disable\" /></a>";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"disable\" /></a>";
// $hideshow = "<a href=\"$url&amp;action=disable&amp;auth=$auth\"><input type=\"checkbox\" checked /></a>";
$enabled = true;
$displayname = "<span>$name</span>";
}
else {
$hideshow = "<a href=\"$url&amp;action=enable&amp;auth=$auth\">";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('i/show') . "\" class=\"icon\" alt=\"enable\" /></a>";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"enable\" /></a>";
// $hideshow = "<a href=\"$url&amp;action=enable&amp;auth=$auth\"><input type=\"checkbox\" /></a>";
$enabled = false;
$displayname = "<span class=\"dimmed_text\">$name</span>";
Expand Down Expand Up @@ -5764,14 +5764,14 @@ public function output_html($data, $query='') {
// hide/show link
if (in_array($editor, $active_editors)) {
$hideshow = "<a href=\"$url&amp;action=disable&amp;editor=$editor\">";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('i/hide') . "\" class=\"icon\" alt=\"disable\" /></a>";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"disable\" /></a>";
// $hideshow = "<a href=\"$url&amp;action=disable&amp;editor=$editor\"><input type=\"checkbox\" checked /></a>";
$enabled = true;
$displayname = "<span>$name</span>";
}
else {
$hideshow = "<a href=\"$url&amp;action=enable&amp;editor=$editor\">";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('i/show') . "\" class=\"icon\" alt=\"enable\" /></a>";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"enable\" /></a>";
// $hideshow = "<a href=\"$url&amp;action=enable&amp;editor=$editor\"><input type=\"checkbox\" /></a>";
$enabled = false;
$displayname = "<span class=\"dimmed_text\">$name</span>";
Expand Down Expand Up @@ -5896,14 +5896,14 @@ public function output_html($data, $query='') {

if ($value->enabled == 1) {
$hideshow = html_writer::link($url.'&action=disable&license='.$value->shortname,
html_writer::tag('img', '', array('src'=>$OUTPUT->pix_url('i/hide'), 'class'=>'icon', 'alt'=>'disable')));
html_writer::tag('img', '', array('src'=>$OUTPUT->pix_url('t/hide'), 'class'=>'iconsmall', 'alt'=>'disable')));
} else {
$hideshow = html_writer::link($url.'&action=enable&license='.$value->shortname,
html_writer::tag('img', '', array('src'=>$OUTPUT->pix_url('i/show'), 'class'=>'icon', 'alt'=>'enable')));
html_writer::tag('img', '', array('src'=>$OUTPUT->pix_url('t/show'), 'class'=>'iconsmall', 'alt'=>'enable')));
}

if ($value->shortname == $CFG->sitedefaultlicense) {
$displayname .= ' '.html_writer::tag('img', '', array('src'=>$OUTPUT->pix_url('i/lock'), 'class'=>'icon', 'alt'=>get_string('default'), 'title'=>get_string('default')));
$displayname .= ' '.html_writer::tag('img', '', array('src'=>$OUTPUT->pix_url('t/locked'), 'class'=>'iconsmall', 'alt'=>get_string('default'), 'title'=>get_string('default')));
$hideshow = '';
}

Expand Down Expand Up @@ -6020,12 +6020,12 @@ public function output_html($data, $query='') {
$hideshow = $txt->default;
} else {
$hideshow = html_writer::link($url->out(false, array('action' => 'disable')),
$OUTPUT->pix_icon('i/hide', $txt->disable, 'moodle', array('class' => 'icon')));
$OUTPUT->pix_icon('t/hide', $txt->disable, 'moodle', array('class' => 'iconsmall')));
}
} else {
$strformatname = html_writer::tag('span', $format->displayname, array('class' => 'dimmed_text'));
$hideshow = html_writer::link($url->out(false, array('action' => 'enable')),
$OUTPUT->pix_icon('i/show', $txt->enable, 'moodle', array('class' => 'icon')));
$OUTPUT->pix_icon('t/show', $txt->enable, 'moodle', array('class' => 'iconsmall')));
}
$updown = '';
if ($cnt) {
Expand Down Expand Up @@ -7710,11 +7710,11 @@ public function output_html($data, $query='') {
// hide/show link
if (in_array($protocol, $active_protocols)) {
$hideshow = "<a href=\"$url&amp;action=disable&amp;webservice=$protocol\">";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('i/hide') . "\" class=\"icon\" alt=\"$strdisable\" /></a>";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"$strdisable\" /></a>";
$displayname = "<span>$name</span>";
} else {
$hideshow = "<a href=\"$url&amp;action=enable&amp;webservice=$protocol\">";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('i/show') . "\" class=\"icon\" alt=\"$strenable\" /></a>";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strenable\" /></a>";
$displayname = "<span class=\"dimmed_text\">$name</span>";
}

Expand Down
8 changes: 4 additions & 4 deletions lib/editor/tinymce/adminlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,20 +199,20 @@ public function output_html($data, $query='') {
$displayname = html_writer::tag('span', $name, array('class'=>'error'));
} else if ($plugininfo->is_enabled()) {
$url = new moodle_url('/lib/editor/tinymce/subplugins.php', array('sesskey'=>sesskey(), 'return'=>'settings', 'disable'=>$name));
$hideshow = html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('i/hide'), 'class'=>'icon', 'alt'=>$strdisable));
$hideshow = html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('t/hide'), 'class'=>'iconsmall', 'alt'=>$strdisable));
$hideshow = html_writer::link($url, $hideshow);
$displayname = html_writer::tag('span', $namestr);
} else {
$url = new moodle_url('/lib/editor/tinymce/subplugins.php', array('sesskey'=>sesskey(), 'return'=>'settings', 'enable'=>$name));
$hideshow = html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('i/show'), 'class'=>'icon', 'alt'=>$strenable));
$hideshow = html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('t/show'), 'class'=>'iconsmall', 'alt'=>$strenable));
$hideshow = html_writer::link($url, $hideshow);
$displayname = html_writer::tag('span', $namestr, array('class'=>'dimmed_text'));
}

if ($PAGE->theme->resolve_image_location('icon', 'tinymce_' . $name, false)) {
$icon = $OUTPUT->pix_icon('icon', '', 'tinymce_' . $name, array('class' => 'smallicon pluginicon'));
$icon = $OUTPUT->pix_icon('icon', '', 'tinymce_' . $name, array('class' => 'icon pluginicon'));
} else {
$icon = $OUTPUT->pix_icon('spacer', '', 'moodle', array('class' => 'smallicon pluginicon noicon'));
$icon = $OUTPUT->pix_icon('spacer', '', 'moodle', array('class' => 'icon pluginicon noicon'));
}
$displayname = $icon . ' ' . $displayname;

Expand Down
8 changes: 4 additions & 4 deletions message/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public function manage_messageoutputs($processors) {
} else if ($processor->enabled) {
$url = new moodle_url('/admin/message.php', array('disable' => $processor->id, 'sesskey' => sesskey()));
$enable->text = html_writer::link($url, html_writer::empty_tag('img',
array('src' => $this->output->pix_url('i/hide'),
'class' => 'icon',
array('src' => $this->output->pix_url('t/hide'),
'class' => 'iconsmall',
'title' => get_string('outputenabled', 'message'),
'alt' => get_string('outputenabled', 'message'),
)
Expand All @@ -84,8 +84,8 @@ public function manage_messageoutputs($processors) {
$name->attributes['class'] = 'dimmed_text';
$url = new moodle_url('/admin/message.php', array('enable' => $processor->id, 'sesskey' => sesskey()));
$enable->text = html_writer::link($url, html_writer::empty_tag('img',
array('src' => $this->output->pix_url('i/show'),
'class' => 'icon',
array('src' => $this->output->pix_url('t/show'),
'class' => 'iconsmall',
'title' => get_string('outputdisabled', 'message'),
'alt' => get_string('outputdisabled', 'message'),
)
Expand Down
Loading

0 comments on commit fa9c0aa

Please sign in to comment.