MDL-40759 icons: convert uses of pix_url to pix_icon

Also change filepicker to use scaled svgs instead of sets of custom pngs. The svgs are taken from font-awesome.
This commit is contained in:
Damyon Wiese 2017-01-19 16:20:27 +08:00
parent 7cf6ef7bbb
commit 663640f5b3
612 changed files with 535 additions and 624 deletions

View file

@ -168,10 +168,10 @@
$visible = ''; $visible = '';
} else if ($blocks[$blockid]->visible) { } else if ($blocks[$blockid]->visible) {
$visible = '<a href="blocks.php?hide='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strhide.'">'. $visible = '<a href="blocks.php?hide='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strhide.'">'.
'<img src="'.$OUTPUT->pix_url('t/hide') . '" class="iconsmall" alt="'.$strhide.'" /></a>'; $OUTPUT->pix_icon('t/hide', $strhide) . '</a>';
} else { } else {
$visible = '<a href="blocks.php?show='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strshow.'">'. $visible = '<a href="blocks.php?show='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strshow.'">'.
'<img src="'.$OUTPUT->pix_url('t/show') . '" class="iconsmall" alt="'.$strshow.'" /></a>'; $OUTPUT->pix_icon('t/show', $strshow) . '</a>';
$class = 'dimmed_text'; $class = 'dimmed_text';
} }
@ -186,10 +186,10 @@
$undeletable = ''; $undeletable = '';
} else if (in_array($blockname, $undeletableblocktypes)) { } else if (in_array($blockname, $undeletableblocktypes)) {
$undeletable = '<a href="blocks.php?unprotect='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strunprotect.'">'. $undeletable = '<a href="blocks.php?unprotect='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strunprotect.'">'.
'<img src="'.$OUTPUT->pix_url('t/unlock') . '" class="iconsmall" alt="'.$strunprotect.'" /></a>'; $OUTPUT->pix_icon('t/unlock', $strunprotect) . '</a>';
} else { } else {
$undeletable = '<a href="blocks.php?protect='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strprotect.'">'. $undeletable = '<a href="blocks.php?protect='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strprotect.'">'.
'<img src="'.$OUTPUT->pix_url('t/lock') . '" class="iconsmall" alt="'.$strprotect.'" /></a>'; $OUTPUT->pix_icon('t/lock', $strprotect) . '</a>';
} }
$row = array( $row = array(

View file

@ -218,7 +218,7 @@ function get_table_row(\core\plugininfo\filter $plugininfo, $state, $isfirstrow,
// Re-order. // Re-order.
$updown = ''; $updown = '';
$spacer = '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" />'; $spacer = $OUTPUT->spacer();
if ($state->active != TEXTFILTER_DISABLED) { if ($state->active != TEXTFILTER_DISABLED) {
if (!$isfirstrow) { if (!$isfirstrow) {
$updown .= $OUTPUT->action_icon(filters_action_url($filter, 'up'), new pix_icon('t/up', get_string('up'), '', array('class' => 'iconsmall'))); $updown .= $OUTPUT->action_icon(filters_action_url($filter, 'up'), new pix_icon('t/up', get_string('up'), '', array('class' => 'iconsmall')));

View file

@ -150,7 +150,7 @@ foreach ($columns as $column) {
} else { } else {
$columndir = $dir == "ASC" ? "DESC" : "ASC"; $columndir = $dir == "ASC" ? "DESC" : "ASC";
$columnicon = $dir == "ASC" ? "down" : "up"; $columnicon = $dir == "ASC" ? "down" : "up";
$columnicon = " <img src=\"" . $OUTPUT->pix_url('t/' . $columnicon) . "\" alt=\"\" />"; $columnicon = " " . $OUTPUT->pix_icon('t/' . $columnicon, get_string('sort'));
} }
$headings[$column] = "<a href=\"?sort=$column&amp;dir=$columndir&amp;\">".$string[$column]."</a>$columnicon"; $headings[$column] = "<a href=\"?sort=$column&amp;dir=$columndir&amp;\">".$string[$column]."</a>$columnicon";
} }

View file

@ -94,7 +94,7 @@
$missing = true; $missing = true;
} else { } else {
// took out hspace="\10\", because it does not validate. don't know what to replace with. // took out hspace="\10\", because it does not validate. don't know what to replace with.
$icon = "<img src=\"" . $OUTPUT->pix_url('icon', $module->name) . "\" class=\"icon\" alt=\"\" />"; $icon = "<img src=\"" . $OUTPUT->image_url('icon', $module->name) . "\" class=\"icon\" alt=\"\" />";
$strmodulename = $icon.' '.get_string('modulename', $module->name); $strmodulename = $icon.' '.get_string('modulename', $module->name);
$missing = false; $missing = false;
} }
@ -130,11 +130,11 @@
$class = ''; $class = '';
} else if ($module->visible) { } else if ($module->visible) {
$visible = "<a href=\"modules.php?hide=$module->name&amp;sesskey=".sesskey()."\" title=\"$strhide\">". $visible = "<a href=\"modules.php?hide=$module->name&amp;sesskey=".sesskey()."\" title=\"$strhide\">".
"<img src=\"" . $OUTPUT->pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"$strhide\" /></a>"; $OUTPUT->pix_icon('t/hide', $strhide) . '</a>';
$class = ''; $class = '';
} else { } else {
$visible = "<a href=\"modules.php?show=$module->name&amp;sesskey=".sesskey()."\" title=\"$strshow\">". $visible = "<a href=\"modules.php?show=$module->name&amp;sesskey=".sesskey()."\" title=\"$strshow\">".
"<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strshow\" /></a>"; $OUTPUT->pix_icon('t/show', $strshow) . '</a>';
$class = 'dimmed_text'; $class = 'dimmed_text';
} }
if ($module->name == "forum") { if ($module->name == "forum") {

View file

@ -1615,7 +1615,7 @@ class core_admin_renderer extends plugin_renderer_base {
if ($this->page->theme->resolve_image_location('icon', $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' => 'icon pluginicon')); $icon = $this->output->pix_icon('icon', '', $plugin->type . '_' . $plugin->name, array('class' => 'icon pluginicon'));
} else { } else {
$icon = $this->output->pix_icon('spacer', '', 'moodle', array('class' => 'icon pluginicon noicon')); $icon = $this->output->spacer('spacer');
} }
$status = $plugin->get_status(); $status = $plugin->get_status();
$row->attributes['class'] .= ' status-'.$status; $row->attributes['class'] .= ' status-'.$status;

View file

@ -370,14 +370,14 @@ if (($action == 'edit') || ($action == 'new')) {
if ($updowncount > 1) { if ($updowncount > 1) {
$updown .= "<a href=\"$sesskeyurl&amp;action=moveup&amp;repos=".$typename."\">"; $updown .= "<a href=\"$sesskeyurl&amp;action=moveup&amp;repos=".$typename."\">";
$updown .= "<img src=\"" . $OUTPUT->pix_url('t/up') . "\" alt=\"up\" /></a>&nbsp;"; $updown .= $OUTPUT->pix_icon('t/up', get_string('moveup')) . "</a>&nbsp;";
} }
else { else {
$updown .= $spacer; $updown .= $spacer;
} }
if ($updowncount < $totalrepositorytypes) { if ($updowncount < $totalrepositorytypes) {
$updown .= "<a href=\"$sesskeyurl&amp;action=movedown&amp;repos=".$typename."\">"; $updown .= "<a href=\"$sesskeyurl&amp;action=movedown&amp;repos=".$typename."\">";
$updown .= "<img src=\"" . $OUTPUT->pix_url('t/down') . "\" alt=\"down\" /></a>"; $updown .= $OUTPUT->pix_icon('t/down', get_string('movedown')) . "</a>&nbsp;";
} }
else { else {
$updown .= $spacer; $updown .= $spacer;

View file

@ -183,8 +183,7 @@ abstract class core_role_capability_table_with_risks extends core_role_capabilit
public function get_risk_icon($type) { public function get_risk_icon($type) {
global $OUTPUT; global $OUTPUT;
$iconurl = $OUTPUT->pix_url('i/' . str_replace('risk', 'risk_', $type)); $text = $OUTPUT->pix_icon('i/' . str_replace('risk', 'risk_', $type), get_string($type . 'short', 'admin'));
$text = '<img src="' . $iconurl . '" alt="' . get_string($type . 'short', 'admin') . '" />';
$action = new popup_action('click', $this->risksurl, 'docspopup'); $action = new popup_action('click', $this->risksurl, 'docspopup');
$riskicon = $OUTPUT->action_link($this->risksurl, $text, $action, array('title'=>get_string($type, 'admin'))); $riskicon = $OUTPUT->action_link($this->risksurl, $text, $action, array('title'=>get_string($type, 'admin')));

View file

@ -93,9 +93,10 @@ class core_role_permissions_table extends core_role_capability_table_base {
foreach ($roles as $id => $name) { foreach ($roles as $id => $name) {
if (isset($needed[$id])) { if (isset($needed[$id])) {
$templatecontext = array("rolename" => $name, "roleid" => $id, "action" => "prevent", "spanclass" => "allowed", $templatecontext = array("rolename" => $name, "roleid" => $id, "action" => "prevent", "spanclass" => "allowed",
"linkclass" => "preventlink", "adminurl" => $adminurl->out(), "imageurl" => ""); "linkclass" => "preventlink", "adminurl" => $adminurl->out(), "icon" => "", "iconalt" => "");
if (isset($overridableroles[$id]) and ($allowoverrides or ($allowsafeoverrides and is_safe_capability($capability)))) { if (isset($overridableroles[$id]) and ($allowoverrides or ($allowsafeoverrides and is_safe_capability($capability)))) {
$templatecontext['imageurl'] = $renderer->pix_url('t/delete'); $templatecontext['icon'] = 't/delete';
$templatecontext['iconalt'] = get_string('delete');
} }
$neededroles[$id] = $renderer->render_from_template('core/permissionmanager_role', $templatecontext); $neededroles[$id] = $renderer->render_from_template('core/permissionmanager_role', $templatecontext);
} }
@ -105,9 +106,10 @@ class core_role_permissions_table extends core_role_capability_table_base {
if (isset($forbidden[$id]) and ($allowoverrides or ($allowsafeoverrides and is_safe_capability($capability)))) { if (isset($forbidden[$id]) and ($allowoverrides or ($allowsafeoverrides and is_safe_capability($capability)))) {
$templatecontext = array("rolename" => $name, "roleid" => $id, "action" => "unprohibit", $templatecontext = array("rolename" => $name, "roleid" => $id, "action" => "unprohibit",
"spanclass" => "forbidden", "linkclass" => "unprohibitlink", "adminurl" => $adminurl->out(), "spanclass" => "forbidden", "linkclass" => "unprohibitlink", "adminurl" => $adminurl->out(),
"imageurl" => ""); "icon" => "", "iconalt" => "");
if (isset($overridableroles[$id]) and prohibit_is_removable($id, $context, $capability->name)) { if (isset($overridableroles[$id]) and prohibit_is_removable($id, $context, $capability->name)) {
$templatecontext['imageurl'] = $renderer->pix_url('t/delete'); $templatecontext['icon'] = 't/delete';
$templatecontext['iconalt'] = get_string('delete');
} }
$forbiddenroles[$id] = $renderer->render_from_template('core/permissionmanager_role', $templatecontext); $forbiddenroles[$id] = $renderer->render_from_template('core/permissionmanager_role', $templatecontext);
} }

View file

@ -216,9 +216,9 @@ die;
function get_action_icon($url, $icon, $alt, $tooltip) { function get_action_icon($url, $icon, $alt, $tooltip) {
global $OUTPUT; global $OUTPUT;
return '<a title="' . $tooltip . '" href="'. $url . '">' . return '<a title="' . $tooltip . '" href="'. $url . '">' .
'<img src="' . $OUTPUT->pix_url('t/' . $icon) . '" class="iconsmall" alt="' . $alt . '" /></a> '; $OUTPUT->pix_icon('t/' . $icon, $alt) . '</a> ';
} }
function get_spacer() { function get_spacer() {
global $OUTPUT; global $OUTPUT;
return '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" /> '; return $OUTPUT->spacer();
} }

View file

@ -193,10 +193,8 @@ function print_report_tree($contextid, $contexts, $systemcontext, $fullname, $al
$strgoto = get_string('gotoassignroles', 'core_role', $a); $strgoto = get_string('gotoassignroles', 'core_role', $a);
$strcheck = get_string('checkuserspermissionshere', 'core_role', $a); $strcheck = get_string('checkuserspermissionshere', 'core_role', $a);
} }
echo ' <a title="' . $strgoto . '" href="' . $raurl . '"><img class="iconsmall" src="' . echo ' <a title="' . $strgoto . '" href="' . $raurl . '">' . $OUTPUT->pix_icon('t/edit', 'core', $stredit) . '</a> ';
$OUTPUT->pix_url('t/edit') . '" alt="' . $stredit . '" /></a> '; echo ' <a title="' . $strcheck . '" href="' . $churl . '">' . $OUTPUT->pix_icon('t/preview', 'core', $strcheckpermissions) . '</a> ';
echo ' <a title="' . $strcheck . '" href="' . $churl . '"><img class="iconsmall" src="' .
$OUTPUT->pix_url('t/preview') . '" alt="' . $strcheckpermissions . '" /></a> ';
echo "</p>\n"; echo "</p>\n";
} }
} }

View file

@ -103,18 +103,9 @@ foreach ($plugins as $plugin => $name) {
// Make enable control. This is a POST request (using a form control rather // Make enable control. This is a POST request (using a form control rather
// than just a link) because it makes a database change. // than just a link) because it makes a database change.
$enablecontrol = html_writer::tag('form', html_writer::div( $params = array('sesskey' => sesskey(), 'plugin' => $plugin, 'action' => $enabledaction);
html_writer::empty_tag('input', array('type' => 'hidden', $url = new moodle_url('/' . $CFG->admin . '/tool/availabilityconditions/', $params);
'name' => 'sesskey', 'value' => sesskey())) . $enablecontrol = html_writer::link($url, $OUTPUT->pix_icon('t/' . $enabledaction, $enabledstr));
html_writer::empty_tag('input', array('type' => 'hidden',
'name' => 'plugin', 'value' => $plugin)) .
html_writer::empty_tag('input', array('type' => 'hidden',
'name' => 'action', 'value' => $enabledaction)) .
html_writer::empty_tag('input', array('type' => 'image',
'src' => $OUTPUT->pix_url('t/' . $enabledaction), 'alt' => $enabledstr,
'title' => $enabledstr))
), array(
'method' => 'post', 'action' => './'));
$table->add_data(array($namespan, $version, $enablecontrol)); $table->add_data(array($namespan, $version, $enablecontrol));
} }

View file

@ -169,14 +169,14 @@ class tool_log_setting_managestores extends admin_setting {
if (isset($enabled[$store])) { if (isset($enabled[$store])) {
$aurl = new moodle_url($url, array('action' => 'disable', 'store' => $store)); $aurl = new moodle_url($url, array('action' => 'disable', 'store' => $store));
$hideshow = "<a href=\"$aurl\">"; $hideshow = "<a href=\"$aurl\">";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"$strdisable\" /></a>"; $hideshow .= $OUTPUT->pix_icon('t/hide', $strdisable) . '</a>';
$isenabled = true; $isenabled = true;
$displayname = "<span>$name</span>"; $displayname = "<span>$name</span>";
} else { } else {
if (isset($available[$store])) { if (isset($available[$store])) {
$aurl = new moodle_url($url, array('action' => 'enable', 'store' => $store)); $aurl = new moodle_url($url, array('action' => 'enable', 'store' => $store));
$hideshow = "<a href=\"$aurl\">"; $hideshow = "<a href=\"$aurl\">";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strenable\" /></a>"; $hideshow .= $OUTPUT->pix_icon('t/show', $strenable) . '</a>';
$isenabled = false; $isenabled = false;
$displayname = "<span class=\"dimmed_text\">$name</span>"; $displayname = "<span class=\"dimmed_text\">$name</span>";
} else { } else {
@ -188,7 +188,7 @@ class tool_log_setting_managestores extends admin_setting {
if ($PAGE->theme->resolve_image_location('icon', $store, false)) { if ($PAGE->theme->resolve_image_location('icon', $store, false)) {
$icon = $OUTPUT->pix_icon('icon', '', $store, array('class' => 'icon pluginicon')); $icon = $OUTPUT->pix_icon('icon', '', $store, array('class' => 'icon pluginicon'));
} else { } else {
$icon = $OUTPUT->pix_icon('spacer', '', 'moodle', array('class' => 'icon pluginicon noicon')); $icon = $OUTPUT->spacer();
} }
// Up/down link (only if store is enabled). // Up/down link (only if store is enabled).
@ -197,16 +197,16 @@ class tool_log_setting_managestores extends admin_setting {
if ($updowncount > 1) { if ($updowncount > 1) {
$aurl = new moodle_url($url, array('action' => 'up', 'store' => $store)); $aurl = new moodle_url($url, array('action' => 'up', 'store' => $store));
$updown .= "<a href=\"$aurl\">"; $updown .= "<a href=\"$aurl\">";
$updown .= "<img src=\"" . $OUTPUT->pix_url('t/up') . "\" alt=\"$strup\" class=\"iconsmall\" /></a>&nbsp;"; $updown .= $OUTPUT->pix_icon('t/up', $strup) . '</a>&nbsp;';
} else { } else {
$updown .= "<img src=\"" . $OUTPUT->pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" />&nbsp;"; $updown .= $OUTPUT->spacer();
} }
if ($updowncount < $storecount) { if ($updowncount < $storecount) {
$aurl = new moodle_url($url, array('action' => 'down', 'store' => $store)); $aurl = new moodle_url($url, array('action' => 'down', 'store' => $store));
$updown .= "<a href=\"$aurl\">"; $updown .= "<a href=\"$aurl\">";
$updown .= "<img src=\"" . $OUTPUT->pix_url('t/down') . "\" alt=\"$strdown\" class=\"iconsmall\" /></a>"; $updown .= $OUTPUT->pix_icon('t/down', $strdown) . '</a>&nbsp;';
} else { } else {
$updown .= "<img src=\"" . $OUTPUT->pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" />"; $updown .= $OUTPUT->spacer();
} }
++$updowncount; ++$updowncount;
} }

View file

@ -55,7 +55,7 @@
<div class="mdl-left"> <div class="mdl-left">
{{^notoggle}} {{^notoggle}}
<a href="#" class="comment-link" id="comment-link-{{cid}}"> <a href="#" class="comment-link" id="comment-link-{{cid}}">
<img src="{{{collapsediconurl}}}" id="comment-img-{{cid}}" alt="{{linktext}}" title="{{linktext}}"><span id="comment-link-text-{{cid}}">{{linktext}} {{#pix}}{{collapsediconkey}}, {{linktext}}{{/pix}}<span id="comment-link-text-{{cid}}">{{linktext}}
{{#displaytotalcount}} {{#displaytotalcount}}
({{count}}) ({{count}})
{{/displaytotalcount}}</span> {{/displaytotalcount}}</span>

View file

@ -64,7 +64,7 @@
<li>{{#pix}}url, tool_lp{{/pix}} <a href="{{url}}" title="{{url}}">{{urlshort}}</a></li> <li>{{#pix}}url, tool_lp{{/pix}} <a href="{{url}}" title="{{url}}">{{urlshort}}</a></li>
{{/url}} {{/url}}
{{#files}} {{#files}}
<li><img src="{{iconurl}}" alt=""> <a href="{{url}}" title="{{filename}}">{{filenameshort}}</a></li> <li>{{#pix}}{{icon}}{{/pix}} <a href="{{url}}" title="{{filename}}">{{filenameshort}}</a></li>
{{/files}} {{/files}}
</ul> </ul>
{{/hasurlorfiles}} {{/hasurlorfiles}}

View file

@ -57,7 +57,7 @@
<li>{{#pix}}url, tool_lp{{/pix}} <a href="{{url}}" title="{{url}}">{{urlshort}}</a></li> <li>{{#pix}}url, tool_lp{{/pix}} <a href="{{url}}" title="{{url}}">{{urlshort}}</a></li>
{{/url}} {{/url}}
{{#files}} {{#files}}
<li><img src="{{iconurl}}" alt=""> <a href="{{url}}">{{filename}}</a></li> <li>{{#pix}}{{icon}}{{/pix}} <a href="{{url}}">{{filename}}</a></li>
{{/files}} {{/files}}
</ul> </ul>
</div> </div>

View file

@ -187,7 +187,7 @@ foreach ($items as $item) {
if (isset($modules[$item->module])) { if (isset($modules[$item->module])) {
$mod = $modules[$item->module]; $mod = $modules[$item->module];
$modname = get_string('modulename', $mod->name); $modname = get_string('modulename', $mod->name);
$name = '<img src="' . $OUTPUT->pix_url('icon', $mod->name) . '" class="icon" alt="' . $modname . '" /> ' . $name; $name = $OUTPUT->activity_icon('icon', $modname, $mod->name) . $name;
} }
} }

View file

@ -102,9 +102,9 @@ if (!$problems) {
$count = $problem->racount; $count = $problem->racount;
$edit = array(); $edit = array();
$aurl = new moodle_url('/admin/roles/define.php', array('roleid'=>$problem->roleid, 'action'=>'edit')); $aurl = new moodle_url('/admin/roles/define.php', array('roleid'=>$problem->roleid, 'action'=>'edit'));
$edit[] = html_writer::link($aurl, html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('t/edit'), 'alt'=>get_string('edit'), 'class'=>'smallicon'))); $edit[] = html_writer::link($aurl, $OUTPUT->pix_icon('t/edit', 'core', get_string('edit')));
$aurl = new moodle_url($PAGE->url, array('roleid'=>$problem->roleid, 'contextlevel'=>$problem->contextlevel, 'action'=>'delete')); $aurl = new moodle_url($PAGE->url, array('roleid'=>$problem->roleid, 'contextlevel'=>$problem->contextlevel, 'action'=>'delete'));
$edit[] = html_writer::link($aurl, html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('t/delete'), 'alt'=>get_string('delete'), 'class'=>'smallicon'))); $edit[] = html_writer::link($aurl, $OUTPUT->pix_icon('t/delete', 'core', get_string('delete')));
$data[] = array($levelname, $rolename, $count, implode('&nbsp;', $edit)); $data[] = array($levelname, $rolename, $count, implode('&nbsp;', $edit));
} }
$table = new html_table(); $table = new html_table();

View file

@ -276,9 +276,7 @@ class manager {
$linkproperties = $config->linkproperties; $linkproperties = $config->linkproperties;
$linkproperties['href'] = $config->link; $linkproperties['href'] = $config->link;
$action .= \html_writer::start_tag('a', $linkproperties); $action .= \html_writer::start_tag('a', $linkproperties);
$action .= \html_writer::img( $action .= $OUTPUT->pix_icon($config->img, $config->title, 'tool_usertours');
$OUTPUT->pix_url($config->img, 'tool_usertours'),
$config->title);
$action .= \html_writer::div($config->title); $action .= \html_writer::div($config->title);
$action .= \html_writer::end_tag('a'); $action .= \html_writer::end_tag('a');
$action .= \html_writer::end_tag('li'); $action .= \html_writer::end_tag('li');

View file

@ -187,7 +187,7 @@
} else { } else {
$columnicon = ($dir == "ASC") ? "sort_asc" : "sort_desc"; $columnicon = ($dir == "ASC") ? "sort_asc" : "sort_desc";
} }
$columnicon = "<img class='iconsort' src=\"" . $OUTPUT->pix_url('t/' . $columnicon) . "\" alt=\"\" />"; $columnicon = $OUTPUT->pix_icon('t/' . $columnicon, '', 'core', ['class' => 'iconsort']);
} }
$$column = "<a href=\"user.php?sort=$column&amp;dir=$columndir\">".$string[$column]."</a>$columnicon"; $$column = "<a href=\"user.php?sort=$column&amp;dir=$columndir\">".$string[$column]."</a>$columnicon";
@ -298,7 +298,8 @@
if (is_mnet_remote_user($user) or $user->id == $USER->id or is_siteadmin($user)) { if (is_mnet_remote_user($user) or $user->id == $USER->id or is_siteadmin($user)) {
// no deleting of self, mnet accounts or admins allowed // no deleting of self, mnet accounts or admins allowed
} else { } else {
$buttons[] = html_writer::link(new moodle_url($returnurl, array('delete'=>$user->id, 'sesskey'=>sesskey())), html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('t/delete'), 'alt'=>$strdelete, 'class'=>'iconsmall')), array('title'=>$strdelete)); $url = new moodle_url($returnurl, array('delete'=>$user->id, 'sesskey'=>sesskey()));
$buttons[] = html_writer::link($url, $OUTPUT->pix_icon('t/delete', $strdelete));
} }
} }
@ -315,17 +316,20 @@
} else { } else {
if ($user->suspended) { if ($user->suspended) {
$buttons[] = html_writer::link(new moodle_url($returnurl, array('unsuspend'=>$user->id, 'sesskey'=>sesskey())), html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('t/show'), 'alt'=>$strunsuspend, 'class'=>'iconsmall')), array('title'=>$strunsuspend)); $url = new moodle_url($returnurl, array('unsuspend'=>$user->id, 'sesskey'=>sesskey()));
$buttons[] = html_writer::link($url, $OUTPUT->pix_icon('t/show', $strunsuspend));
} else { } else {
if ($user->id == $USER->id or is_siteadmin($user)) { if ($user->id == $USER->id or is_siteadmin($user)) {
// no suspending of admins or self! // no suspending of admins or self!
} else { } else {
$buttons[] = html_writer::link(new moodle_url($returnurl, array('suspend'=>$user->id, 'sesskey'=>sesskey())), html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('t/hide'), 'alt'=>$strsuspend, 'class'=>'iconsmall')), array('title'=>$strsuspend)); $url = new moodle_url($returnurl, array('suspend'=>$user->id, 'sesskey'=>sesskey()));
$buttons[] = html_writer::link($url, $OUTPUT->pix_icon('t/hide', $strsuspend));
} }
} }
if (login_is_lockedout($user)) { if (login_is_lockedout($user)) {
$buttons[] = html_writer::link(new moodle_url($returnurl, array('unlock'=>$user->id, 'sesskey'=>sesskey())), html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('t/unlock'), 'alt'=>$strunlock, 'class'=>'iconsmall')), array('title'=>$strunlock)); $url = new moodle_url($returnurl, array('unlock'=>$user->id, 'sesskey'=>sesskey()));
$buttons[] = html_writer::link($url, $OUTPUT->pix_icon('t/unlock', $strunlock));
} }
} }
} }
@ -334,7 +338,8 @@
if (has_capability('moodle/user:update', $sitecontext)) { if (has_capability('moodle/user:update', $sitecontext)) {
// prevent editing of admins by non-admins // prevent editing of admins by non-admins
if (is_siteadmin($USER) or !is_siteadmin($user)) { if (is_siteadmin($USER) or !is_siteadmin($user)) {
$buttons[] = html_writer::link(new moodle_url($securewwwroot.'/user/editadvanced.php', array('id'=>$user->id, 'course'=>$site->id)), html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('t/edit'), 'alt'=>$stredit, 'class'=>'iconsmall')), array('title'=>$stredit)); $url = new moodle_url($securewwwroot.'/user/editadvanced.php', array('id'=>$user->id, 'course'=>$site->id));
$buttons[] = html_writer::link($url, $OUTPUT->pix_icon('t/edit', $stredit));
} }
} }

View file

@ -113,7 +113,13 @@ foreach ($columns as $column) {
$columndir = 'asc'; $columndir = 'asc';
} else { } else {
$columndir = ($dir == 'asc') ? 'desc' : 'asc'; $columndir = ($dir == 'asc') ? 'desc' : 'asc';
$columnicon = ' <img src="'.$OUTPUT->pix_url('t/'.($dir == 'asc' ? 'down' : 'up' )).'" alt="" />'; $icon = 't/down';
$iconstr = 'movedown';
if ($dir != 'asc') {
$icon = 't/up';
$iconstr = 'moveup';
}
$columnicon = ' ' . $OUTPUT->pix_icon($icon, get_string($iconstr));
} }
$table->head[] = '<a href="user_bulk_cohortadd.php?sort='.$column.'&amp;dir='.$columndir.'">'.$strtitle.'</a>'.$columnicon; $table->head[] = '<a href="user_bulk_cohortadd.php?sort='.$column.'&amp;dir='.$columndir.'">'.$strtitle.'</a>'.$columnicon;
$table->align[] = 'left'; $table->align[] = 'left';

View file

@ -57,7 +57,13 @@ foreach ($columns as $column) {
$columndir = 'asc'; $columndir = 'asc';
} else { } else {
$columndir = $dir == 'asc' ? 'desc' : 'asc'; $columndir = $dir == 'asc' ? 'desc' : 'asc';
$columnicon = ' <img src="'.$OUTPUT->pix_url('t/'.($dir == 'asc' ? 'down' : 'up' )).'f" alt="" />'; $icon = 't/down';
$iconstr = 'movedown';
if ($dir != 'asc') {
$icon = 't/up';
$iconstr = 'moveup';
}
$columnicon = ' ' . $OUTPUT->pix_icon($icon, get_string($iconstr));
} }
$table->head[] = '<a href="user_bulk_display.php?sort='.$column.'&amp;dir='.$columndir.'">'.$strtitle.'</a>'.$columnicon; $table->head[] = '<a href="user_bulk_display.php?sort='.$column.'&amp;dir='.$columndir.'">'.$strtitle.'</a>'.$columnicon;
$table->align[] = 'left'; $table->align[] = 'left';

View file

@ -78,7 +78,7 @@ class block_activity_modules extends block_list {
$icon = $OUTPUT->pix_icon('icon', '', 'mod_page', array('class' => 'icon')); $icon = $OUTPUT->pix_icon('icon', '', 'mod_page', array('class' => 'icon'));
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/course/resources.php?id='.$course->id.'">'.$icon.$modfullname.'</a>'; $this->content->items[] = '<a href="'.$CFG->wwwroot.'/course/resources.php?id='.$course->id.'">'.$icon.$modfullname.'</a>';
} else { } else {
$icon = '<img src="'.$OUTPUT->pix_url('icon', $modname) . '" class="icon" alt="" />'; $icon = $OUTPUT->activity_icon('icon', get_string('pluginname', $modname), $modname);
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/mod/'.$modname.'/index.php?id='.$course->id.'">'.$icon.$modfullname.'</a>'; $this->content->items[] = '<a href="'.$CFG->wwwroot.'/mod/'.$modname.'/index.php?id='.$course->id.'">'.$icon.$modfullname.'</a>';
} }
} }

View file

@ -66,8 +66,7 @@ class block_community extends block_list {
return $this->content; return $this->content;
} }
$icon = html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/group'), $icon = $OUTPUT->pix_icon('i/group', get_string('group'));
'class' => 'icon', 'alt' => ""));
$addcourseurl = new moodle_url('/blocks/community/communitycourse.php', $addcourseurl = new moodle_url('/blocks/community/communitycourse.php',
array('add' => true, 'courseid' => $this->page->course->id)); array('add' => true, 'courseid' => $this->page->course->id));
$searchlink = html_writer::tag('a', $icon . get_string('addcourse', 'block_community'), $searchlink = html_writer::tag('a', $icon . get_string('addcourse', 'block_community'),
@ -84,9 +83,7 @@ class block_community extends block_list {
$this->content->icons[] = ''; $this->content->icons[] = '';
foreach ($courses as $course) { foreach ($courses as $course) {
//delete link //delete link
$deleteicon = html_writer::empty_tag('img', $deleteicon = $OUTPUT->pix_icon('t/delete', get_string('removecommunitycourse', 'block_community'));
array('src' => $OUTPUT->pix_url('t/delete'),
'alt' => get_string('removecommunitycourse', 'block_community')));
$deleteurl = new moodle_url('/blocks/community/communitycourse.php', $deleteurl = new moodle_url('/blocks/community/communitycourse.php',
array('remove' => true, array('remove' => true,
'courseid' => $this->page->course->id, 'courseid' => $this->page->course->id,

View file

@ -46,7 +46,7 @@ class block_course_list extends block_list {
$this->content->icons = array(); $this->content->icons = array();
$this->content->footer = ''; $this->content->footer = '';
$icon = '<img src="' . $OUTPUT->pix_url('i/course') . '" class="icon" alt="" />'; $icon = $OUTPUT->pix_icon('i/course', get_string('course'));
$adminseesall = true; $adminseesall = true;
if (isset($CFG->block_course_list_adminview)) { if (isset($CFG->block_course_list_adminview)) {
@ -139,7 +139,7 @@ class block_course_list extends block_list {
return; return;
} }
$icon = '<img src="'.$OUTPUT->pix_url('i/mnethost') . '" class="icon" alt="" />'; $icon = $OUTPUT->pix_icon('i/mnethost', get_string('host', 'mnet'));
// shortcut - the rest is only for logged in users! // shortcut - the rest is only for logged in users!
if (!isloggedin() || isguestuser()) { if (!isloggedin() || isguestuser()) {

View file

@ -75,10 +75,7 @@ class block_course_overview_renderer extends plugin_renderer_base {
$moveurl = new moodle_url('/blocks/course_overview/move.php', $moveurl = new moodle_url('/blocks/course_overview/move.php',
array('sesskey' => sesskey(), 'moveto' => 0, 'courseid' => $movingcourseid)); array('sesskey' => sesskey(), 'moveto' => 0, 'courseid' => $movingcourseid));
// Create move icon, so it can be used. // Create move icon, so it can be used.
$movetofirsticon = html_writer::empty_tag('img', $movetofirsticon = $this->output->pix_icon('movehere', get_string('movetofirst', 'block_course_overview', $courses[$movingcourseid]->fullname));
array('src' => $this->output->pix_url('movehere'),
'alt' => get_string('movetofirst', 'block_course_overview', $courses[$movingcourseid]->fullname),
'title' => get_string('movehere')));
$moveurl = html_writer::link($moveurl, $movetofirsticon); $moveurl = html_writer::link($moveurl, $movetofirsticon);
$html .= html_writer::tag('div', $moveurl, array('class' => 'movehere')); $html .= html_writer::tag('div', $moveurl, array('class' => 'movehere'));
} }
@ -92,10 +89,7 @@ class block_course_overview_renderer extends plugin_renderer_base {
$html .= html_writer::start_tag('div', array('class' => 'course_title')); $html .= html_writer::start_tag('div', array('class' => 'course_title'));
// If user is editing, then add move icons. // If user is editing, then add move icons.
if ($userediting && !$ismovingcourse) { if ($userediting && !$ismovingcourse) {
$moveicon = html_writer::empty_tag('img', $moveicon = $this->output->pix_icon('t/move', get_string('movecourse', 'block_course_overview', $course->fullname));
array('src' => $this->pix_url('t/move')->out(false),
'alt' => get_string('movecourse', 'block_course_overview', $course->fullname),
'title' => get_string('move')));
$moveurl = new moodle_url($this->page->url, array('sesskey' => sesskey(), 'movecourse' => 1, 'courseid' => $course->id)); $moveurl = new moodle_url($this->page->url, array('sesskey' => sesskey(), 'movecourse' => 1, 'courseid' => $course->id));
$moveurl = html_writer::link($moveurl, $moveicon); $moveurl = html_writer::link($moveurl, $moveicon);
$html .= html_writer::tag('div', $moveurl, array('class' => 'move')); $html .= html_writer::tag('div', $moveurl, array('class' => 'move'));
@ -159,10 +153,7 @@ class block_course_overview_renderer extends plugin_renderer_base {
$a = new stdClass(); $a = new stdClass();
$a->movingcoursename = $courses[$movingcourseid]->fullname; $a->movingcoursename = $courses[$movingcourseid]->fullname;
$a->currentcoursename = $course->fullname; $a->currentcoursename = $course->fullname;
$movehereicon = html_writer::empty_tag('img', $movehereicon = $this->output->pix_icon('movehere', get_string('moveafterhere', 'block_course_overview', $a));
array('src' => $this->output->pix_url('movehere'),
'alt' => get_string('moveafterhere', 'block_course_overview', $a),
'title' => get_string('movehere')));
$moveurl = html_writer::link($moveurl, $movehereicon); $moveurl = html_writer::link($moveurl, $movehereicon);
$html .= html_writer::tag('div', $moveurl, array('class' => 'movehere')); $html .= html_writer::tag('div', $moveurl, array('class' => 'movehere'));
} }

View file

@ -53,8 +53,7 @@ class block_feedback extends block_list {
$courseid = SITEID; $courseid = SITEID;
} }
$icon = '<img src="'.$OUTPUT->pix_url('icon', 'feedback') . '" class="icon" alt="" />'; $icon = $OUTPUT->activity_icon('icon', get_string('pluginname', 'mod_feedback'), 'mod_feedback');
if (empty($this->instance->pageid)) { if (empty($this->instance->pageid)) {
$this->instance->pageid = SITEID; $this->instance->pageid = SITEID;

View file

@ -74,7 +74,7 @@ class block_messages extends block_base {
$this->content->text .= fullname($user).'</a></div>'; $this->content->text .= fullname($user).'</a></div>';
$link = '/message/index.php?usergroup=unread&id='.$user->id; $link = '/message/index.php?usergroup=unread&id='.$user->id;
$anchortagcontents = '<img class="iconsmall" src="'.$OUTPUT->pix_url('t/message') . '" alt="" />&nbsp;'.$user->count; $anchortagcontents = $OUTPUT->pix_icon('t/message', fullname($user)) . '&nbsp;' . $user->count;
$action = null; // popup is gone now $action = null; // popup is gone now
$anchortag = $OUTPUT->action_link($link, $anchortagcontents, $action); $anchortag = $OUTPUT->action_link($link, $anchortagcontents, $action);

View file

@ -139,8 +139,7 @@ class block_mnet_hosts extends block_list {
if ($hosts) { if ($hosts) {
foreach ($hosts as $host) { foreach ($hosts as $host) {
$icon = '<img src="'.$OUTPUT->pix_url('i/'.$host->application.'_host') . '"'. $icon = $OUTPUT->pix_icon('i/'.$host->application.'_host', get_string('server', 'block_mnet_hosts')) . '&nbsp;';
' class="icon" alt="'.get_string('server', 'block_mnet_hosts').'" />&nbsp;';
if ($host->id == $USER->mnethostid) { if ($host->id == $USER->mnethostid) {
$this->content->items[]="<a title=\"" .s($host->name). $this->content->items[]="<a title=\"" .s($host->name).

View file

@ -123,7 +123,7 @@ class block_online_users extends block_base {
$this->content->text .= $OUTPUT->user_picture($user, array('size'=>16, 'alttext'=>false, 'link'=>false)) .$user->fullname.'</a></div>'; $this->content->text .= $OUTPUT->user_picture($user, array('size'=>16, 'alttext'=>false, 'link'=>false)) .$user->fullname.'</a></div>';
} }
if ($canshowicon and ($USER->id != $user->id) and !isguestuser($user)) { // Only when logged in and messaging active etc if ($canshowicon and ($USER->id != $user->id) and !isguestuser($user)) { // Only when logged in and messaging active etc
$anchortagcontents = '<img class="iconsmall" src="'.$OUTPUT->pix_url('t/message') . '" alt="'. get_string('messageselectadd') .'" />'; $anchortagcontents = $OUTPUT->pix_icon('t/message', get_string('messageselectadd'));
$anchorurl = new moodle_url('/message/index.php', array('id' => $user->id)); $anchorurl = new moodle_url('/message/index.php', array('id' => $user->id));
$anchortag = html_writer::link($anchorurl, $anchortagcontents, $anchortag = html_writer::link($anchorurl, $anchortagcontents,
array('title' => get_string('messageselectadd'))); array('title' => get_string('messageselectadd')));

View file

@ -59,7 +59,7 @@ class block_participants extends block_list {
} }
} }
$icon = '<img src="'.$OUTPUT->pix_url('i/users') . '" class="icon" alt="" />'; $icon = $OUTPUT->pix_icon('i/users', '');
$this->content->items[] = '<a title="'.get_string('listofallpeople').'" href="'. $this->content->items[] = '<a title="'.get_string('listofallpeople').'" href="'.
$CFG->wwwroot.'/user/index.php?contextid='.$currentcontext->id.'">'.$icon.get_string('participants').'</a>'; $CFG->wwwroot.'/user/index.php?contextid='.$currentcontext->id.'">'.$icon.get_string('participants').'</a>';

View file

@ -96,7 +96,7 @@ class block_site_main_menu extends block_list {
} }
if ($ismoving) { if ($ismoving) {
$this->content->icons[] = '<img src="'.$OUTPUT->pix_url('t/move') . '" class="iconsmall" alt="" />'; $this->content->icons[] = $OUTPUT->pix_icon('t/move', get_string('move'));
$this->content->items[] = $USER->activitycopyname.'&nbsp;(<a href="'.$CFG->wwwroot.'/course/mod.php?cancelcopy=true&amp;sesskey='.sesskey().'">'.$strcancel.'</a>)'; $this->content->items[] = $USER->activitycopyname.'&nbsp;(<a href="'.$CFG->wwwroot.'/course/mod.php?cancelcopy=true&amp;sesskey='.sesskey().'">'.$strcancel.'</a>)';
} }
@ -129,7 +129,7 @@ class block_site_main_menu extends block_list {
continue; continue;
} }
$this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?moveto='.$mod->id.'&amp;sesskey='.sesskey().'">'. $this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?moveto='.$mod->id.'&amp;sesskey='.sesskey().'">'.
'<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->pix_url('movehere') . '" alt="'.$strmovehere.'" /></a>'; '<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->image_url('movehere') . '" alt="'.$strmovehere.'" /></a>';
$this->content->icons[] = ''; $this->content->icons[] = '';
} }
if ($mod->indent > 0) { if ($mod->indent > 0) {
@ -149,7 +149,7 @@ class block_site_main_menu extends block_list {
if ($ismoving) { if ($ismoving) {
$this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?movetosection='.$section->id.'&amp;sesskey='.sesskey().'">'. $this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?movetosection='.$section->id.'&amp;sesskey='.sesskey().'">'.
'<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->pix_url('movehere') . '" alt="'.$strmovehere.'" /></a>'; '<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->image_url('movehere') . '" alt="'.$strmovehere.'" /></a>';
$this->content->icons[] = ''; $this->content->icons[] = '';
} }

View file

@ -91,7 +91,7 @@ class block_social_activities extends block_list {
} }
if ($ismoving) { if ($ismoving) {
$this->content->icons[] = '&nbsp;<img align="bottom" src="'.$OUTPUT->pix_url('t/move') . '" class="iconsmall" alt="" />'; $this->content->icons[] = '&nbsp;' . $OUTPUT->pix_icon('t/move', get_string('move'));
$this->content->items[] = $USER->activitycopyname.'&nbsp;(<a href="'.$CFG->wwwroot.'/course/mod.php?cancelcopy=true&amp;sesskey='.sesskey().'">'.$strcancel.'</a>)'; $this->content->items[] = $USER->activitycopyname.'&nbsp;(<a href="'.$CFG->wwwroot.'/course/mod.php?cancelcopy=true&amp;sesskey='.sesskey().'">'.$strcancel.'</a>)';
} }
@ -124,7 +124,7 @@ class block_social_activities extends block_list {
continue; continue;
} }
$this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?moveto='.$mod->id.'&amp;sesskey='.sesskey().'">'. $this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?moveto='.$mod->id.'&amp;sesskey='.sesskey().'">'.
'<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->pix_url('movehere') . '" alt="'.$strmovehere.'" /></a>'; '<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->image_url('movehere') . '" alt="'.$strmovehere.'" /></a>';
$this->content->icons[] = ''; $this->content->icons[] = '';
} }
if (!$mod->url) { if (!$mod->url) {
@ -141,7 +141,7 @@ class block_social_activities extends block_list {
if ($ismoving) { if ($ismoving) {
$this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?movetosection='.$section->id.'&amp;sesskey='.sesskey().'">'. $this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?movetosection='.$section->id.'&amp;sesskey='.sesskey().'">'.
'<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->pix_url('movehere') . '" alt="'.$strmovehere.'" /></a>'; '<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->image_url('movehere') . '" alt="'.$strmovehere.'" /></a>';
$this->content->icons[] = ''; $this->content->icons[] = '';
} }

View file

@ -394,7 +394,11 @@ function calendar_get_mini($courses, $groups, $users, $calmonth = false, $calyea
$dayhref->set_anchor('event_'.$event->id); $dayhref->set_anchor('event_'.$event->id);
$popupcontent .= html_writer::start_tag('div'); $popupcontent .= html_writer::start_tag('div');
if ($component == 'moodle') {
$popupcontent .= $OUTPUT->pix_icon($popupicon, $popupalt, $component); $popupcontent .= $OUTPUT->pix_icon($popupicon, $popupalt, $component);
} else {
$popupcontent .= $OUTPUT->activity_icon($popupicon, $popupalt, $component);
}
// Show ical source if needed. // Show ical source if needed.
if (!empty($event->subscription) && $CFG->calendar_showicalsource) { if (!empty($event->subscription) && $CFG->calendar_showicalsource) {
$a = new stdClass(); $a = new stdClass();
@ -689,18 +693,17 @@ function calendar_add_event_metadata($event) {
} else { } else {
$eventtype = ''; $eventtype = '';
} }
$icon = $OUTPUT->pix_url('icon', $event->modulename) . ''; $event->icon = $OUTPUT->activity_icon('icon', $event->modulename, $eventtype);
$event->icon = '<img src="'.$icon.'" alt="'.$eventtype.'" title="'.$modulename.'" class="icon" />';
$event->referer = '<a href="'.$CFG->wwwroot.'/mod/'.$event->modulename.'/view.php?id='.$module->id.'">'.$event->name.'</a>'; $event->referer = '<a href="'.$CFG->wwwroot.'/mod/'.$event->modulename.'/view.php?id='.$module->id.'">'.$event->name.'</a>';
$event->courselink = calendar_get_courselink($module->course); $event->courselink = calendar_get_courselink($module->course);
$event->cmid = $module->id; $event->cmid = $module->id;
} else if($event->courseid == SITEID) { // Site event } else if($event->courseid == SITEID) { // Site event
$event->icon = '<img src="'.$OUTPUT->pix_url('i/siteevent') . '" alt="'.get_string('globalevent', 'calendar').'" class="icon" />'; $event->icon = $OUTPUT->pix_icon('i/siteevent', get_string('globalevent', 'calendar'));
$event->cssclass = 'calendar_event_global'; $event->cssclass = 'calendar_event_global';
} else if($event->courseid != 0 && $event->courseid != SITEID && $event->groupid == 0) { // Course event } else if($event->courseid != 0 && $event->courseid != SITEID && $event->groupid == 0) { // Course event
$event->icon = '<img src="'.$OUTPUT->pix_url('i/courseevent') . '" alt="'.get_string('courseevent', 'calendar').'" class="icon" />'; $event->icon = $OUTPUT->pix_icon('i/courseevent', get_string('courseevent', 'calendar'));
$event->courselink = calendar_get_courselink($event->courseid); $event->courselink = calendar_get_courselink($event->courseid);
$event->cssclass = 'calendar_event_course'; $event->cssclass = 'calendar_event_course';
} else if ($event->groupid) { // Group event } else if ($event->groupid) { // Group event
@ -709,12 +712,11 @@ function calendar_add_event_metadata($event) {
} else { } else {
$groupname = ''; $groupname = '';
} }
$event->icon = html_writer::empty_tag('image', array('src' => $OUTPUT->pix_url('i/groupevent'), $event->icon = $OUTPUT->pix_icon('i/groupevent', get_string('groupevent', 'calendar'));
'alt' => get_string('groupevent', 'calendar'), 'title' => $groupname, 'class' => 'icon'));
$event->courselink = calendar_get_courselink($event->courseid) . ', ' . $groupname; $event->courselink = calendar_get_courselink($event->courseid) . ', ' . $groupname;
$event->cssclass = 'calendar_event_group'; $event->cssclass = 'calendar_event_group';
} else if($event->userid) { // User event } else if($event->userid) { // User event
$event->icon = '<img src="'.$OUTPUT->pix_url('i/userevent') . '" alt="'.get_string('userevent', 'calendar').'" class="icon" />'; $event->icon = $OUTPUT->pix_icon('i/userevent', get_string('userevent', 'calendar'));
$event->cssclass = 'calendar_event_user'; $event->cssclass = 'calendar_event_user';
} }
return $event; return $event;

View file

@ -240,15 +240,13 @@ class core_calendar_renderer extends plugin_renderer_base {
$commands = html_writer::start_tag('div', array('class' => 'commands pull-xs-right')); $commands = html_writer::start_tag('div', array('class' => 'commands pull-xs-right'));
$commands .= html_writer::start_tag('a', array('href' => $editlink)); $commands .= html_writer::start_tag('a', array('href' => $editlink));
$url = $this->output->pix_url('t/edit');
$str = get_string('tt_editevent', 'calendar'); $str = get_string('tt_editevent', 'calendar');
$commands .= html_writer::empty_tag('img', array('src' => $url, 'alt' => $str, 'title' => $str, 'class' => 'icon')); $commands .= $this->output->pix_icon('t/edit', $str);
$commands .= html_writer::end_tag('a'); $commands .= html_writer::end_tag('a');
if ($deletelink != null) { if ($deletelink != null) {
$commands .= html_writer::start_tag('a', array('href' => $deletelink)); $commands .= html_writer::start_tag('a', array('href' => $deletelink));
$url = $this->output->pix_url('t/delete');
$str = get_string('tt_deleteevent', 'calendar'); $str = get_string('tt_deleteevent', 'calendar');
$commands .= html_writer::empty_tag('img', array('src' => $url, 'alt' => $str, 'title' => $str, 'class' => 'icon')); $commands .= $this->output->pix_icon('t/delete', $str);
$commands .= html_writer::end_tag('a'); $commands .= html_writer::end_tag('a');
} }
$commands .= html_writer::end_tag('div'); $commands .= html_writer::end_tag('div');

View file

@ -159,24 +159,24 @@ foreach($cohorts['cohorts'] as $cohort) {
if ($cohortmanager) { if ($cohortmanager) {
if ($cohort->visible) { if ($cohort->visible) {
$showhideurl->param('hide', 1); $showhideurl->param('hide', 1);
$visibleimg = html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/hide'), 'alt' => get_string('hide'), 'class' => 'iconsmall')); $visibleimg = $OUTPUT->pix_icon('t/hide', get_string('hide'));
$buttons[] = html_writer::link($showhideurl, $visibleimg, array('title' => get_string('hide'))); $buttons[] = html_writer::link($showhideurl, $visibleimg, array('title' => get_string('hide')));
} else { } else {
$showhideurl->param('show', 1); $showhideurl->param('show', 1);
$visibleimg = html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/show'), 'alt' => get_string('show'), 'class' => 'iconsmall')); $visibleimg = $OUTPUT->pix_icon('t/show', get_string('show'));
$buttons[] = html_writer::link($showhideurl, $visibleimg, array('title' => get_string('show'))); $buttons[] = html_writer::link($showhideurl, $visibleimg, array('title' => get_string('show')));
} }
$buttons[] = html_writer::link(new moodle_url('/cohort/edit.php', $urlparams + array('delete' => 1)), $buttons[] = html_writer::link(new moodle_url('/cohort/edit.php', $urlparams + array('delete' => 1)),
html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/delete'), 'alt' => get_string('delete'), 'class' => 'iconsmall')), $OUTPUT->pix_icon('t/delete', get_string('delete')),
array('title' => get_string('delete'))); array('title' => get_string('delete')));
$buttons[] = html_writer::link(new moodle_url('/cohort/edit.php', $urlparams), $buttons[] = html_writer::link(new moodle_url('/cohort/edit.php', $urlparams),
html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/edit'), 'alt' => get_string('edit'), 'class' => 'iconsmall')), $OUTPUT->pix_icon('t/edit', get_string('edit')),
array('title' => get_string('edit'))); array('title' => get_string('edit')));
$editcolumnisempty = false; $editcolumnisempty = false;
} }
if ($cohortcanassign) { if ($cohortcanassign) {
$buttons[] = html_writer::link(new moodle_url('/cohort/assign.php', $urlparams), $buttons[] = html_writer::link(new moodle_url('/cohort/assign.php', $urlparams),
html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/users'), 'alt' => get_string('assign', 'core_cohort'), 'class' => 'iconsmall')), $OUTPUT->pix_icon('i/users', get_string('assign', 'core_cohort')),
array('title' => get_string('assign', 'core_cohort'))); array('title' => get_string('assign', 'core_cohort')));
$editcolumnisempty = false; $editcolumnisempty = false;
} }

View file

@ -94,8 +94,8 @@ class comment_area_exporter extends \core\external\exporter {
'count' => array( 'count' => array(
'type' => PARAM_INT, 'type' => PARAM_INT,
), ),
'collapsediconurl' => array( 'collapsediconkey' => array(
'type' => PARAM_URL, 'type' => PARAM_RAW,
), ),
'displaytotalcount' => array( 'displaytotalcount' => array(
'type' => PARAM_BOOL, 'type' => PARAM_BOOL,
@ -126,7 +126,7 @@ class comment_area_exporter extends \core\external\exporter {
$values['autostart'] = $this->comment->get_autostart(); $values['autostart'] = $this->comment->get_autostart();
$values['canpost'] = $this->comment->can_post(); $values['canpost'] = $this->comment->can_post();
$values['canview'] = $this->comment->can_view(); $values['canview'] = $this->comment->can_view();
$values['collapsediconurl'] = $output->pix_url(right_to_left() ? 't/collapsed_rtl' : 't/collapsed')->out(false); $values['collapsediconkey'] = right_to_left() ? 't/collapsed_rtl' : 't/collapsed';
$values['count'] = $this->comment->count(); $values['count'] = $this->comment->count();
$values['displaycancel'] = $this->comment->get_displaycancel(); $values['displaycancel'] = $this->comment->get_displaycancel();
$values['displaytotalcount'] = $this->comment->get_displaytotalcount(); $values['displaytotalcount'] = $this->comment->get_displaytotalcount();

View file

@ -200,7 +200,7 @@ M.core_comment = {
list[i].content = '<div class="comment-delete">' + list[i].content = '<div class="comment-delete">' +
'<a href="#" role="button" id ="comment-delete-' + this.client_id + '-' + list[i].id + '"' + '<a href="#" role="button" id ="comment-delete-' + this.client_id + '-' + list[i].id + '"' +
' title="' + deleteStr + '">' + ' title="' + deleteStr + '">' +
'<img alt="' + deleteStr + '" src="' + M.util.image_url('t/delete', 'core') + '" />' + '<span data-replace-icon="t/delete" data-component="core" data-title=""/>' +
'</a>' + '</a>' +
'</div>' + list[i].content; '</div>' + list[i].content;
} }
@ -380,7 +380,9 @@ M.core_comment = {
} else { } else {
collapsedimage = 't/collapsed'; collapsedimage = 't/collapsed';
} }
if (img) {
img.set('src', M.util.image_url(collapsedimage, 'core')); img.set('src', M.util.image_url(collapsedimage, 'core'));
}
if (ta) { if (ta) {
ta.set('value',''); ta.set('value','');
} }

View file

@ -467,7 +467,7 @@ class comment {
'role' => 'button', 'role' => 'button',
'aria-expanded' => 'false') 'aria-expanded' => 'false')
); );
$html .= html_writer::empty_tag('img', array('id' => 'comment-img-'.$this->cid, 'src' => $OUTPUT->pix_url($collapsedimage), 'alt' => $this->linktext, 'title' => $this->linktext)); $html .= $OUTPUT->pix_icon($collapsedimage, $this->linktext);
$html .= html_writer::tag('span', $this->linktext.' '.$countstring, array('id' => 'comment-link-text-'.$this->cid)); $html .= html_writer::tag('span', $this->linktext.' '.$countstring, array('id' => 'comment-link-text-'.$this->cid));
$html .= html_writer::end_tag('a'); $html .= html_writer::end_tag('a');
} }

View file

@ -277,12 +277,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
$class = empty($item['pixattr']['class']) ? '' : $item['pixattr']['class']; $class = empty($item['pixattr']['class']) ? '' : $item['pixattr']['class'];
$alt = empty($item['pixattr']['alt']) ? '' : $item['pixattr']['alt']; $alt = empty($item['pixattr']['alt']) ? '' : $item['pixattr']['alt'];
$controls[$key] = html_writer::link( $controls[$key] = html_writer::link(
new moodle_url($url), new moodle_url($url), $this->output->pix_icon($icon, $alt),
html_writer::empty_tag('img', array(
'src' => $this->output->pix_url($icon),
'class' => "icon " . $class,
'alt' => $alt
)),
$attr); $attr);
} }

View file

@ -23,8 +23,7 @@
$streditsummary = get_string('editsummary'); $streditsummary = get_string('editsummary');
$introcontent .= '<div class="editinglink"><a title="'.$streditsummary.'" '. $introcontent .= '<div class="editinglink"><a title="'.$streditsummary.'" '.
' href="modedit.php?update='.$cm->id.'&amp;sesskey='.sesskey().'">'. ' href="modedit.php?update='.$cm->id.'&amp;sesskey='.sesskey().'">'.
'<img src="'.$OUTPUT->pix_url('t/edit') . '" '. $OUTPUT->pix_icon('t/edit', $streditsummary) . '</a></div>';
' class="icon edit" alt="'.$streditsummary.'" /></a></div>';
} }
echo $OUTPUT->box($introcontent, 'generalbox', 'intro'); echo $OUTPUT->box($introcontent, 'generalbox', 'intro');
} }

View file

@ -531,11 +531,8 @@ class core_course_renderer extends plugin_renderer_base {
'type' => 'hidden', 'name' => 'modulename', 'value' => $mod->name)); 'type' => 'hidden', 'name' => 'modulename', 'value' => $mod->name));
$output .= html_writer::empty_tag('input', array( $output .= html_writer::empty_tag('input', array(
'type' => 'hidden', 'name' => 'completionstate', 'value' => $newstate)); 'type' => 'hidden', 'name' => 'completionstate', 'value' => $newstate));
$output .= html_writer::empty_tag('input', array( $output .= html_writer::tag('button',
'type' => 'image', $this->output->pix_icon('i/completion-' . $completionicon, $imgalt));
'src' => $this->output->pix_url('i/completion-'.$completionicon),
'alt' => $imgalt, 'title' => $imgtitle,
'aria-live' => 'polite'));
$output .= html_writer::end_tag('div'); $output .= html_writer::end_tag('div');
$output .= html_writer::end_tag('form'); $output .= html_writer::end_tag('form');
} else { } else {
@ -1107,8 +1104,7 @@ class core_course_renderer extends plugin_renderer_base {
if ($chelper->get_show_courses() < self::COURSECAT_SHOW_COURSES_EXPANDED) { if ($chelper->get_show_courses() < self::COURSECAT_SHOW_COURSES_EXPANDED) {
if ($course->has_summary() || $course->has_course_contacts() || $course->has_course_overviewfiles()) { if ($course->has_summary() || $course->has_course_contacts() || $course->has_course_overviewfiles()) {
$url = new moodle_url('/course/info.php', array('id' => $course->id)); $url = new moodle_url('/course/info.php', array('id' => $course->id));
$image = html_writer::empty_tag('img', array('src' => $this->output->pix_url('i/info'), $image = $this->output->pix_icon('i/info', $this->strings->summary);
'alt' => $this->strings->summary));
$content .= html_writer::link($url, $image, array('title' => $this->strings->summary)); $content .= html_writer::link($url, $image, array('title' => $this->strings->summary));
// Make sure JS file to expand course content is included. // Make sure JS file to expand course content is included.
$this->coursecat_include_js(); $this->coursecat_include_js();

View file

@ -229,13 +229,13 @@ foreach ($instances as $instance) {
$aurl = new moodle_url($url, array('action'=>'up', 'instance'=>$instance->id)); $aurl = new moodle_url($url, array('action'=>'up', 'instance'=>$instance->id));
$updown[] = $OUTPUT->action_icon($aurl, new pix_icon('t/up', $strup, 'core', array('class' => 'iconsmall'))); $updown[] = $OUTPUT->action_icon($aurl, new pix_icon('t/up', $strup, 'core', array('class' => 'iconsmall')));
} else { } else {
$updown[] = html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('spacer'), 'alt'=>'', 'class'=>'iconsmall')); $updown[] = $OUTPUT->spacer();
} }
if ($updowncount < $icount) { if ($updowncount < $icount) {
$aurl = new moodle_url($url, array('action'=>'down', 'instance'=>$instance->id)); $aurl = new moodle_url($url, array('action'=>'down', 'instance'=>$instance->id));
$updown[] = $OUTPUT->action_icon($aurl, new pix_icon('t/down', $strdown, 'core', array('class' => 'iconsmall'))); $updown[] = $OUTPUT->action_icon($aurl, new pix_icon('t/down', $strdown, 'core', array('class' => 'iconsmall')));
} else { } else {
$updown[] = html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('spacer'), 'alt'=>'', 'class'=>'iconsmall')); $updown[] = $OUTPUT->spacer();
} }
++$updowncount; ++$updowncount;
@ -253,7 +253,7 @@ foreach ($instances as $instance) {
$edit[] = $OUTPUT->action_icon($aurl, new pix_icon('t/show', $strenable, 'core', array('class' => 'iconsmall'))); $edit[] = $OUTPUT->action_icon($aurl, new pix_icon('t/show', $strenable, 'core', array('class' => 'iconsmall')));
} else { } else {
// plugin specific state - do not mess with it! // plugin specific state - do not mess with it!
$edit[] = html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('t/show'), 'alt'=>'', 'class'=>'iconsmall')); $edit[] = $OUTPUT->pix_icon('t/show', get_string('show'));
} }
} }

View file

@ -187,16 +187,13 @@ class core_enrol_renderer extends plugin_renderer_base {
* @return string * @return string
*/ */
public function user_roles_and_actions($userid, $roles, $assignableroles, $canassign, $pageurl) { public function user_roles_and_actions($userid, $roles, $assignableroles, $canassign, $pageurl) {
$iconenrolremove = $this->output->pix_url('t/delete');
// Get list of roles. // Get list of roles.
$rolesoutput = ''; $rolesoutput = '';
foreach ($roles as $roleid=>$role) { foreach ($roles as $roleid=>$role) {
if ($canassign and (is_siteadmin() or isset($assignableroles[$roleid])) and !$role['unchangeable']) { if ($canassign and (is_siteadmin() or isset($assignableroles[$roleid])) and !$role['unchangeable']) {
$strunassign = get_string('unassignarole', 'role', $role['text']); $strunassign = get_string('unassignarole', 'role', $role['text']);
$icon = html_writer::empty_tag('img', array('alt'=>$strunassign, 'src'=>$iconenrolremove)); $icon = $this->output->pix_icon('t/delete', $strunassign);
$url = new moodle_url($pageurl, array('action'=>'unassign', 'roleid'=>$roleid, 'user'=>$userid)); $url = new moodle_url($pageurl, array('action'=>'unassign', 'roleid'=>$roleid, 'user'=>$userid));
$rolesoutput .= html_writer::tag('div', $role['text'] . html_writer::link($url, $icon, array('class'=>'unassignrolelink', 'rel'=>$roleid, 'title'=>$strunassign)), array('class'=>'role role_'.$roleid)); $rolesoutput .= html_writer::tag('div', $role['text'] . html_writer::link($url, $icon, array('class'=>'unassignrolelink', 'rel'=>$roleid, 'title'=>$strunassign)), array('class'=>'role role_'.$roleid));
} else { } else {
@ -235,14 +232,12 @@ class core_enrol_renderer extends plugin_renderer_base {
* @return string * @return string
*/ */
public function user_groups_and_actions($userid, $groups, $allgroups, $canmanagegroups, $pageurl) { public function user_groups_and_actions($userid, $groups, $allgroups, $canmanagegroups, $pageurl) {
$iconenrolremove = $this->output->pix_url('t/delete');
$groupicon = $this->output->pix_icon('i/group', get_string('addgroup', 'group')); $groupicon = $this->output->pix_icon('i/group', get_string('addgroup', 'group'));
$groupoutput = ''; $groupoutput = '';
foreach($groups as $groupid=>$name) { foreach($groups as $groupid=>$name) {
if ($canmanagegroups and groups_remove_member_allowed($groupid, $userid)) { if ($canmanagegroups and groups_remove_member_allowed($groupid, $userid)) {
$icon = html_writer::empty_tag('img', array('alt'=>get_string('removefromgroup', 'group', $name), 'src'=>$iconenrolremove)); $icon = $this->output->pix_icon('t/delete', get_string('removefromgroup', 'group', $name));
$url = new moodle_url($pageurl, array('action'=>'removemember', 'group'=>$groupid, 'user'=>$userid)); $url = new moodle_url($pageurl, array('action'=>'removemember', 'group'=>$groupid, 'user'=>$userid));
$groupoutput .= html_writer::tag('div', $name . html_writer::link($url, $icon), array('class'=>'group', 'rel'=>$groupid)); $groupoutput .= html_writer::tag('div', $name . html_writer::link($url, $icon), array('class'=>'group', 'rel'=>$groupid));
} else { } else {
@ -641,11 +636,9 @@ class course_enrolment_table extends html_table implements renderable {
$direction = $this->sortdirection; $direction = $this->sortdirection;
} }
if ($direction === 'ASC') { if ($direction === 'ASC') {
return html_writer::empty_tag('img', array('alt' => '', 'class' => 'iconsort', return $output->pix_icon('t/sort_asc', get_string('sort'));
'src' => $output->pix_url('t/sort_asc')));
} else { } else {
return html_writer::empty_tag('img', array('alt' => '', 'class' => 'iconsort', return $output->pix_icon('t/sort_desc', get_string('sort'));
'src' => $output->pix_url('t/sort_desc')));
} }
} }

View file

@ -147,7 +147,6 @@ class stored_file_exporter extends \core\external\exporter {
} }
$icon = $this->file->is_directory() ? file_folder_icon() : file_file_icon($this->file); $icon = $this->file->is_directory() ? file_folder_icon() : file_file_icon($this->file);
$iconurl = $output->pix_url($icon, 'core');
$url = moodle_url::make_pluginfile_url( $url = moodle_url::make_pluginfile_url(
$this->file->get_contextid(), $this->file->get_contextid(),
@ -163,7 +162,6 @@ class stored_file_exporter extends \core\external\exporter {
'filenameshort' => $filenameshort, 'filenameshort' => $filenameshort,
'filesizeformatted' => display_size((int) $this->file->get_filesize()), 'filesizeformatted' => display_size((int) $this->file->get_filesize()),
'icon' => $icon, 'icon' => $icon,
'iconurl' => $iconurl->out(false),
'url' => $url->out(false), 'url' => $url->out(false),
'timecreatedformatted' => userdate($this->file->get_timecreated()), 'timecreatedformatted' => userdate($this->file->get_timecreated()),
'timemodifiedformatted' => userdate($this->file->get_timemodified()), 'timemodifiedformatted' => userdate($this->file->get_timemodified()),

View file

@ -204,30 +204,32 @@ class core_files_renderer extends plugin_renderer_base {
<div class="fp-toolbar"> <div class="fp-toolbar">
<div class="fp-btn-add"> <div class="fp-btn-add">
<a role="button" title="' . $straddfile . '" href="#"> <a role="button" title="' . $straddfile . '" href="#">
<img src="' . $this->pix_url('a/add_file') . '" alt="' . $straddfiletext . '" /> ' . $this->pix_icon('a/add_file', $straddfiletext) . '
</a> </a>
</div> </div>
<div class="fp-btn-mkdir"> <div class="fp-btn-mkdir">
<a role="button" title="' . $strmakedir . '" href="#"> <a role="button" title="' . $strmakedir . '" href="#">
<img src="' . $this->pix_url('a/create_folder') . '" alt="' . $strcreatefolder . '" /> ' . $this->pix_icon('a/create_folder', $strcreatefolder) . '
</a> </a>
</div> </div>
<div class="fp-btn-download"> <div class="fp-btn-download">
<a role="button" title="' . $strdownload . '" href="#"> <a role="button" title="' . $strdownload . '" href="#">
<img src="' . $this->pix_url('a/download_all').'" alt="' . $strdownloadallfiles . '" /> ' . $this->pix_icon('a/download_all', $strdownloadallfiles) . '
</a> </a>
</div> </div>
<img class="fp-img-downloading" src="'.$this->pix_url('i/loading_small').'" alt="" /> <span class="fp-img-downloading">
' . $this->pix_icon('i/loading_small', '') . '
</span>
</div> </div>
<div class="fp-viewbar"> <div class="fp-viewbar">
<a title="'. get_string('displayicons', 'repository') .'" class="fp-vb-icons" href="#"> <a title="'. get_string('displayicons', 'repository') .'" class="fp-vb-icons" href="#">
<img alt="'. get_string('displayasicons', 'repository') .'" src="'. $this->pix_url('fp/view_icon_active', 'theme') .'" /> ' . $this->pix_icon('fp/view_icon_active', get_string('displayasicons', 'repository'), 'theme') . '
</a> </a>
<a title="'. get_string('displaydetails', 'repository') .'" class="fp-vb-details" href="#"> <a title="'. get_string('displaydetails', 'repository') .'" class="fp-vb-details" href="#">
<img alt="'. get_string('displayasdetails', 'repository') .'" src="'. $this->pix_url('fp/view_list_active', 'theme') .'" /> ' . $this->pix_icon('fp/view_list_active', get_string('displayasdetails', 'repository'), 'theme') . '
</a> </a>
<a title="'. get_string('displaytree', 'repository') .'" class="fp-vb-tree" href="#"> <a title="'. get_string('displaytree', 'repository') .'" class="fp-vb-tree" href="#">
<img alt="'. get_string('displayastree', 'repository') .'" src="'. $this->pix_url('fp/view_tree_active', 'theme') .'" /> ' . $this->pix_icon('fp/view_tree_active', get_string('displayastree', 'repository'), 'theme') . '
</a> </a>
</div> </div>
</div> </div>
@ -393,7 +395,7 @@ class core_files_renderer extends plugin_renderer_base {
$rv = ' $rv = '
<div class="filemanager fp-select"> <div class="filemanager fp-select">
<div class="fp-select-loading"> <div class="fp-select-loading">
<img src="'.$this->pix_url('i/loading_small').'" /> ' . $this->pix_icon('i/loading_small', '') . '
</div> </div>
<form class="form-horizontal"> <form class="form-horizontal">
<button class="fp-file-download">'.get_string('download').'</button> <button class="fp-file-download">'.get_string('download').'</button>
@ -590,35 +592,35 @@ class core_files_renderer extends plugin_renderer_base {
</div> </div>
<div class="fp-tb-refresh"> <div class="fp-tb-refresh">
<a title="'. get_string('refresh', 'repository') .'" href="#"> <a title="'. get_string('refresh', 'repository') .'" href="#">
<img alt="" src="'.$this->pix_url('a/refresh').'" /> ' . $this->pix_icon('a/refresh', '') . '
</a> </a>
</div> </div>
<div class="fp-tb-logout"> <div class="fp-tb-logout">
<a title="'. get_string('logout', 'repository') .'" href="#"> <a title="'. get_string('logout', 'repository') .'" href="#">
<img alt="" src="'.$this->pix_url('a/logout').'" /> ' . $this->pix_icon('a/logout', '') . '
</a> </a>
</div> </div>
<div class="fp-tb-manage"> <div class="fp-tb-manage">
<a title="'. get_string('settings', 'repository') .'" href="#"> <a title="'. get_string('settings', 'repository') .'" href="#">
<img alt="" src="'.$this->pix_url('a/setting').'" /> ' . $this->pix_icon('a/setting', '') . '
</a> </a>
</div> </div>
<div class="fp-tb-help"> <div class="fp-tb-help">
<a title="'. get_string('help', 'repository') .'" href="#"> <a title="'. get_string('help', 'repository') .'" href="#">
<img alt="" src="'.$this->pix_url('a/help').'" /> ' . $this->pix_icon('a/help', '') . '
</a> </a>
</div> </div>
<div class="fp-tb-message"></div> <div class="fp-tb-message"></div>
</div> </div>
<div class="fp-viewbar"> <div class="fp-viewbar">
<a role="button" title="'. get_string('displayicons', 'repository') .'" class="fp-vb-icons" href="#"> <a role="button" title="'. get_string('displayicons', 'repository') .'" class="fp-vb-icons" href="#">
<img alt="" src="'. $this->pix_url('fp/view_icon_active', 'theme') .'" /> ' . $this->pix_icon('fp/view_icon_active', '', 'theme') . '
</a> </a>
<a role="button" title="'. get_string('displaydetails', 'repository') .'" class="fp-vb-details" href="#"> <a role="button" title="'. get_string('displaydetails', 'repository') .'" class="fp-vb-details" href="#">
<img alt="" src="'. $this->pix_url('fp/view_list_active', 'theme') .'" /> ' . $this->pix_icon('fp/view_list_active', '', 'theme') . '
</a> </a>
<a role="button" title="'. get_string('displaytree', 'repository') .'" class="fp-vb-tree" href="#"> <a role="button" title="'. get_string('displaytree', 'repository') .'" class="fp-vb-tree" href="#">
<img alt="" src="'. $this->pix_url('fp/view_tree_active', 'theme') .'" /> ' . $this->pix_icon('fp/view_tree_active', '', 'theme') . '
</a> </a>
</div> </div>
<div class="fp-clear-left"></div> <div class="fp-clear-left"></div>
@ -710,7 +712,7 @@ class core_files_renderer extends plugin_renderer_base {
<div class="fp-nextpage"> <div class="fp-nextpage">
<div class="fp-nextpage-link"><a href="#">'.get_string('more').'</a></div> <div class="fp-nextpage-link"><a href="#">'.get_string('more').'</a></div>
<div class="fp-nextpage-loading"> <div class="fp-nextpage-loading">
<img src="'.$this->pix_url('i/loading_small').'" /> ' . $this->pix_icon('i/loading_small', '') . '
</div> </div>
</div>'; </div>';
return $rv; return $rv;
@ -748,7 +750,7 @@ class core_files_renderer extends plugin_renderer_base {
$rv = ' $rv = '
<div class="file-picker fp-select"> <div class="file-picker fp-select">
<div class="fp-select-loading"> <div class="fp-select-loading">
<img src="'.$this->pix_url('i/loading_small').'" /> ' . $this->pix_icon('i/loading_small', '') . '
</div> </div>
<form class="form-horizontal"> <form class="form-horizontal">
<div class="fp-forminset"> <div class="fp-forminset">
@ -877,7 +879,7 @@ class core_files_renderer extends plugin_renderer_base {
return ' return '
<div class="fp-content-loading"> <div class="fp-content-loading">
<div class="fp-content-center"> <div class="fp-content-center">
<img src="'.$this->pix_url('i/loading_small').'" /> ' . $this->pix_icon('i/loading_small', '') . '
</div> </div>
</div>'; </div>';
} }

View file

@ -29,7 +29,6 @@ Y.extend(AUTOLINKER, Y.Base, {
// display a progress indicator // display a progress indicator
var title = '', var title = '',
content = Y.Node.create('<div id="glossaryfilteroverlayprogress">' + content = Y.Node.create('<div id="glossaryfilteroverlayprogress">' +
'<img src="' + M.cfg.loadingicon + '" class="spinner" />' +
'</div>'), '</div>'),
o = new Y.Overlay({ o = new Y.Overlay({
headerContent: title, headerContent: title,
@ -37,6 +36,13 @@ Y.extend(AUTOLINKER, Y.Base, {
}), }),
fullurl, fullurl,
cfg; cfg;
window.require(['core/templates'], function(Templates) {
Templates.renderPix('i/loading', 'core').then(function(html) {
content.append(html);
});
});
self.overlay = o; self.overlay = o;
o.render(Y.one(document.body)); o.render(Y.one(document.body));

View file

@ -1 +1 @@
YUI.add("moodle-filter_glossary-autolinker",function(e,t){var n="Glossary filter autolinker",r="width",i="height",s="menubar",o="location",u="scrollbars",a="resizable",f="toolbar",l="status",c="directories",h="fullscreen",p="dependent",d;d=function(){d.superclass.constructor.apply(this,arguments)},e.extend(d,e.Base,{overlay:null,alertpanels:{},initializer:function(){var t=this;require(["core/event"],function(n){e.delegate("click",function(r){r.preventDefault();var i="",s=e.Node.create('<div id="glossaryfilteroverlayprogress"><img src="'+M.cfg.loadingicon+'" class="spinner" />'+"</div>"),o=new e.Overlay({headerContent:i,bodyContent:s}),u,a;t.overlay=o,o.render(e.one(document.body)),u=this.getAttribute("href").replace("showentry.php","showentry_ajax.php"),a={method:"get",context:t,on:{success:function(e,t){this.display_callback(t.responseText,n)},failure:function(e,t){var n=t.statusText;M.cfg.developerdebug&&(t.statusText+=" ("+u+")"),new M.core.exception({message:n})}}},e.io(u,a)},e.one(document.body),"a.glossary.autolink.concept")})},display_callback:function(t,n){var r,i,s,o,u,a;try{r=e.JSON.parse(t);if(r.success){this.overlay.hide();for(i in r.entries)u=r.entries[i].definition+r.entries[i].attachments,s=new M.core.alert({title:r.entries[i].concept,draggable:!0,message:u,modal:!1,yesLabel:M.util.get_string("ok","moodle")}),n.notifyFilterContentUpdated(s.get("boundingBox").getDOMNode()),e.Node.one("#id_yuialertconfirm-"+s.get("COUNT")).focus(),o="#moodle-dialogue-"+s.get("COUNT"),s.on("complete",this._deletealertpanel,this,o),e.Object.isEmpty(this.alertpanels)||(a=this._getLatestWindowPosition(),e.Node.one(o).setXY([a[0]+10,a[1]+10])),this.alertpanels[o]=e.Node.one(o).getXY();return!0}r.error&&new M.core.ajaxException(r)}catch(f){new M.core.exception(f)}return!1},_getLatestWindowPosition:function(){var t=[0,0];return e.Object.each(this.alertpanels,function(e){e[0]>t[0]&&(t=e)}),t},_deletealertpanel:function(e,t){delete this.alertpanels[t]}},{NAME:n,ATTRS:{url:{validator:e.Lang.isString,value:M.cfg.wwwroot+"/mod/glossary/showentry.php"},name:{validator:e.Lang.isString,value:"glossaryconcept"},options:{getter:function(){return{width:this.get(r),height:this.get(i),menubar:this.get(s),location:this.get(o),scrollbars:this.get(u),resizable:this.get(a),toolbar:this.get(f),status:this.get(l),directories:this.get(c),fullscreen:this.get(h),dependent:this.get(p)}},readOnly:!0},width:{value:600},height:{value:450},menubar:{value:!1},location:{value:!1},scrollbars:{value:!0},resizable:{value:!0},toolbar:{value:!0},status:{value:!0},directories:{value:!1},fullscreen:{value:!1},dependent:{value:!0}}}),M.filter_glossary=M.filter_glossary||{},M.filter_glossary.init_filter_autolinking=function(e){return new d(e)}},"@VERSION@",{requires:["base","node","io-base","json-parse","event-delegate","overlay","moodle-core-event","moodle-core-notification-alert","moodle-core-notification-exception","moodle-core-notification-ajaxexception"]}); YUI.add("moodle-filter_glossary-autolinker",function(e,t){var n="Glossary filter autolinker",r="width",i="height",s="menubar",o="location",u="scrollbars",a="resizable",f="toolbar",l="status",c="directories",h="fullscreen",p="dependent",d;d=function(){d.superclass.constructor.apply(this,arguments)},e.extend(d,e.Base,{overlay:null,alertpanels:{},initializer:function(){var t=this;require(["core/event"],function(n){e.delegate("click",function(r){r.preventDefault();var i="",s=e.Node.create('<div id="glossaryfilteroverlayprogress"></div>'),o=new e.Overlay({headerContent:i,bodyContent:s}),u,a;window.require(["core/templates"],function(e){e.renderPix("i/loading","core").then(function(e){s.append(e)})}),t.overlay=o,o.render(e.one(document.body)),u=this.getAttribute("href").replace("showentry.php","showentry_ajax.php"),a={method:"get",context:t,on:{success:function(e,t){this.display_callback(t.responseText,n)},failure:function(e,t){var n=t.statusText;M.cfg.developerdebug&&(t.statusText+=" ("+u+")"),new M.core.exception({message:n})}}},e.io(u,a)},e.one(document.body),"a.glossary.autolink.concept")})},display_callback:function(t,n){var r,i,s,o,u,a;try{r=e.JSON.parse(t);if(r.success){this.overlay.hide();for(i in r.entries)u=r.entries[i].definition+r.entries[i].attachments,s=new M.core.alert({title:r.entries[i].concept,draggable:!0,message:u,modal:!1,yesLabel:M.util.get_string("ok","moodle")}),n.notifyFilterContentUpdated(s.get("boundingBox").getDOMNode()),e.Node.one("#id_yuialertconfirm-"+s.get("COUNT")).focus(),o="#moodle-dialogue-"+s.get("COUNT"),s.on("complete",this._deletealertpanel,this,o),e.Object.isEmpty(this.alertpanels)||(a=this._getLatestWindowPosition(),e.Node.one(o).setXY([a[0]+10,a[1]+10])),this.alertpanels[o]=e.Node.one(o).getXY();return!0}r.error&&new M.core.ajaxException(r)}catch(f){new M.core.exception(f)}return!1},_getLatestWindowPosition:function(){var t=[0,0];return e.Object.each(this.alertpanels,function(e){e[0]>t[0]&&(t=e)}),t},_deletealertpanel:function(e,t){delete this.alertpanels[t]}},{NAME:n,ATTRS:{url:{validator:e.Lang.isString,value:M.cfg.wwwroot+"/mod/glossary/showentry.php"},name:{validator:e.Lang.isString,value:"glossaryconcept"},options:{getter:function(){return{width:this.get(r),height:this.get(i),menubar:this.get(s),location:this.get(o),scrollbars:this.get(u),resizable:this.get(a),toolbar:this.get(f),status:this.get(l),directories:this.get(c),fullscreen:this.get(h),dependent:this.get(p)}},readOnly:!0},width:{value:600},height:{value:450},menubar:{value:!1},location:{value:!1},scrollbars:{value:!0},resizable:{value:!0},toolbar:{value:!0},status:{value:!0},directories:{value:!1},fullscreen:{value:!1},dependent:{value:!0}}}),M.filter_glossary=M.filter_glossary||{},M.filter_glossary.init_filter_autolinking=function(e){return new d(e)}},"@VERSION@",{requires:["base","node","io-base","json-parse","event-delegate","overlay","moodle-core-event","moodle-core-notification-alert","moodle-core-notification-exception","moodle-core-notification-ajaxexception"]});

View file

@ -29,7 +29,6 @@ Y.extend(AUTOLINKER, Y.Base, {
// display a progress indicator // display a progress indicator
var title = '', var title = '',
content = Y.Node.create('<div id="glossaryfilteroverlayprogress">' + content = Y.Node.create('<div id="glossaryfilteroverlayprogress">' +
'<img src="' + M.cfg.loadingicon + '" class="spinner" />' +
'</div>'), '</div>'),
o = new Y.Overlay({ o = new Y.Overlay({
headerContent: title, headerContent: title,
@ -37,6 +36,13 @@ Y.extend(AUTOLINKER, Y.Base, {
}), }),
fullurl, fullurl,
cfg; cfg;
window.require(['core/templates'], function(Templates) {
Templates.renderPix('i/loading', 'core').then(function(html) {
content.append(html);
});
});
self.overlay = o; self.overlay = o;
o.render(Y.one(document.body)); o.render(Y.one(document.body));

View file

@ -27,7 +27,6 @@ Y.extend(AUTOLINKER, Y.Base, {
// display a progress indicator // display a progress indicator
var title = '', var title = '',
content = Y.Node.create('<div id="glossaryfilteroverlayprogress">' + content = Y.Node.create('<div id="glossaryfilteroverlayprogress">' +
'<img src="' + M.cfg.loadingicon + '" class="spinner" />' +
'</div>'), '</div>'),
o = new Y.Overlay({ o = new Y.Overlay({
headerContent: title, headerContent: title,
@ -35,6 +34,13 @@ Y.extend(AUTOLINKER, Y.Base, {
}), }),
fullurl, fullurl,
cfg; cfg;
window.require(['core/templates'], function(Templates) {
Templates.renderPix('i/loading', 'core').then(function(html) {
content.append(html);
});
});
self.overlay = o; self.overlay = o;
o.render(Y.one(document.body)); o.render(Y.one(document.body));

View file

@ -64,7 +64,7 @@ class core_grading_renderer extends plugin_renderer_base {
*/ */
public function management_action_icon(moodle_url $url, $text, $icon) { public function management_action_icon(moodle_url $url, $text, $icon) {
$img = html_writer::empty_tag('img', array('src' => $this->output->pix_url($icon), 'class' => 'action-icon')); $img = $this->output->pix_icon($icon, '');
$txt = html_writer::tag('div', $text, array('class' => 'action-text')); $txt = html_writer::tag('div', $text, array('class' => 'action-text'));
return html_writer::link($url, $img . $txt, array('class' => 'action')); return html_writer::link($url, $img . $txt, array('class' => 'action'));
} }
@ -93,7 +93,7 @@ class core_grading_renderer extends plugin_renderer_base {
*/ */
public function pick_action_icon(moodle_url $url, $text, $icon = '', $class = '') { public function pick_action_icon(moodle_url $url, $text, $icon = '', $class = '') {
$img = html_writer::empty_tag('img', array('src' => $this->output->pix_url($icon), 'class' => 'action-icon')); $img = $this->output->pix_icon($icon, '');
$txt = html_writer::tag('div', $text, array('class' => 'action-text')); $txt = html_writer::tag('div', $text, array('class' => 'action-text'));
return html_writer::link($url, $img . $txt, array('class' => 'action '.$class)); return html_writer::link($url, $img . $txt, array('class' => 'action '.$class));
} }

View file

@ -736,8 +736,8 @@ class grade_report_grader extends grade_report {
if (empty($suspendedstring)) { if (empty($suspendedstring)) {
$suspendedstring = get_string('userenrolmentsuspended', 'grades'); $suspendedstring = get_string('userenrolmentsuspended', 'grades');
} }
$usercell->text .= html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('i/enrolmentsuspended'), 'title'=>$suspendedstring, $icon = $OUTPUT->pix_icon('i/enrolmentsuspended', $suspendedstring);
'alt'=>$suspendedstring, 'class'=>'usersuspendedicon')); $usercell->text .= html_writer::tag('span', $icon, array('class'=>'usersuspendedicon'));
} }
$userrow->cells[] = $usercell; $userrow->cells[] = $usercell;

View file

@ -170,8 +170,8 @@ if (!empty($CFG->customfrontpageinclude)) {
if ($editing && has_capability('moodle/course:update', $context)) { if ($editing && has_capability('moodle/course:update', $context)) {
$streditsummary = get_string('editsummary'); $streditsummary = get_string('editsummary');
echo "<a title=\"$streditsummary\" " . echo "<a title=\"$streditsummary\" " .
" href=\"course/editsection.php?id=$section->id\"><img src=\"" . $OUTPUT->pix_url('t/edit') . "\" ". " href=\"course/editsection.php?id=$section->id\">" . $OUTPUT->pix_icon('t/edit', $streditsummary) .
" class=\"iconsmall\" alt=\"$streditsummary\" /></a><br /><br />"; "</a><br /><br />";
} }
$courserenderer = $PAGE->get_renderer('core', 'course'); $courserenderer = $PAGE->get_renderer('core', 'course');

View file

@ -5947,13 +5947,13 @@ class admin_setting_manageenrols extends admin_setting {
if (isset($active_enrols[$enrol])) { if (isset($active_enrols[$enrol])) {
$aurl = new moodle_url($url, array('action'=>'disable', 'enrol'=>$enrol)); $aurl = new moodle_url($url, array('action'=>'disable', 'enrol'=>$enrol));
$hideshow = "<a href=\"$aurl\">"; $hideshow = "<a href=\"$aurl\">";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"$strdisable\" /></a>"; $hideshow .= $OUTPUT->pix_icon('t/hide', $strdisable) . '</a>';
$enabled = true; $enabled = true;
$displayname = $name; $displayname = $name;
} else if (isset($enrols_available[$enrol])) { } else if (isset($enrols_available[$enrol])) {
$aurl = new moodle_url($url, array('action'=>'enable', 'enrol'=>$enrol)); $aurl = new moodle_url($url, array('action'=>'enable', 'enrol'=>$enrol));
$hideshow = "<a href=\"$aurl\">"; $hideshow = "<a href=\"$aurl\">";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strenable\" /></a>"; $hideshow .= $OUTPUT->pix_icon('t/show', $strenable) . '</a>';
$enabled = false; $enabled = false;
$displayname = $name; $displayname = $name;
$class = 'dimmed_text'; $class = 'dimmed_text';
@ -5974,16 +5974,16 @@ class admin_setting_manageenrols extends admin_setting {
if ($updowncount > 1) { if ($updowncount > 1) {
$aurl = new moodle_url($url, array('action'=>'up', 'enrol'=>$enrol)); $aurl = new moodle_url($url, array('action'=>'up', 'enrol'=>$enrol));
$updown .= "<a href=\"$aurl\">"; $updown .= "<a href=\"$aurl\">";
$updown .= "<img src=\"" . $OUTPUT->pix_url('t/up') . "\" alt=\"$strup\" class=\"iconsmall\" /></a>&nbsp;"; $updown .= $OUTPUT->pix_icon('t/up', $strup) . '</a>&nbsp;';
} else { } else {
$updown .= "<img src=\"" . $OUTPUT->pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" />&nbsp;"; $updown .= $OUTPUT->spacer() . '&nbsp;';
} }
if ($updowncount < $enrolcount) { if ($updowncount < $enrolcount) {
$aurl = new moodle_url($url, array('action'=>'down', 'enrol'=>$enrol)); $aurl = new moodle_url($url, array('action'=>'down', 'enrol'=>$enrol));
$updown .= "<a href=\"$aurl\">"; $updown .= "<a href=\"$aurl\">";
$updown .= "<img src=\"" . $OUTPUT->pix_url('t/down') . "\" alt=\"$strdown\" class=\"iconsmall\" /></a>"; $updown .= $OUTPUT->pix_icon('t/down', $strdown) . '</a>&nbsp;';
} else { } else {
$updown .= "<img src=\"" . $OUTPUT->pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" />"; $updown .= $OUTPUT->spacer() . '&nbsp;';
} }
++$updowncount; ++$updowncount;
} }
@ -6508,15 +6508,13 @@ class admin_setting_manageauths extends admin_setting {
// hide/show link // hide/show link
if (in_array($auth, $authsenabled)) { if (in_array($auth, $authsenabled)) {
$hideshow = "<a href=\"$url&amp;action=disable&amp;auth=$auth\">"; $hideshow = "<a href=\"$url&amp;action=disable&amp;auth=$auth\">";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"disable\" /></a>"; $hideshow .= $OUTPUT->pix_icon('t/hide', get_string('disable')) . '</a>';
// $hideshow = "<a href=\"$url&amp;action=disable&amp;auth=$auth\"><input type=\"checkbox\" checked /></a>";
$enabled = true; $enabled = true;
$displayname = $name; $displayname = $name;
} }
else { else {
$hideshow = "<a href=\"$url&amp;action=enable&amp;auth=$auth\">"; $hideshow = "<a href=\"$url&amp;action=enable&amp;auth=$auth\">";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"enable\" /></a>"; $hideshow .= $OUTPUT->pix_icon('t/show', get_string('enable')) . '</a>';
// $hideshow = "<a href=\"$url&amp;action=enable&amp;auth=$auth\"><input type=\"checkbox\" /></a>";
$enabled = false; $enabled = false;
$displayname = $name; $displayname = $name;
$class = 'dimmed_text'; $class = 'dimmed_text';
@ -6529,17 +6527,17 @@ class admin_setting_manageauths extends admin_setting {
if ($enabled) { if ($enabled) {
if ($updowncount > 1) { if ($updowncount > 1) {
$updown .= "<a href=\"$url&amp;action=up&amp;auth=$auth\">"; $updown .= "<a href=\"$url&amp;action=up&amp;auth=$auth\">";
$updown .= "<img src=\"" . $OUTPUT->pix_url('t/up') . "\" alt=\"up\" class=\"iconsmall\" /></a>&nbsp;"; $updown .= $OUTPUT->pix_icon('t/up', get_string('moveup')) . '</a>&nbsp;';
} }
else { else {
$updown .= "<img src=\"" . $OUTPUT->pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" />&nbsp;"; $updown .= $OUTPUT->spacer() . '&nbsp;';
} }
if ($updowncount < $authcount) { if ($updowncount < $authcount) {
$updown .= "<a href=\"$url&amp;action=down&amp;auth=$auth\">"; $updown .= "<a href=\"$url&amp;action=down&amp;auth=$auth\">";
$updown .= "<img src=\"" . $OUTPUT->pix_url('t/down') . "\" alt=\"down\" class=\"iconsmall\" /></a>"; $updown .= $OUTPUT->pix_icon('t/down', get_string('movedown')) . '</a>&nbsp;';
} }
else { else {
$updown .= "<img src=\"" . $OUTPUT->pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" />"; $updown .= $OUTPUT->spacer() . '&nbsp;';
} }
++ $updowncount; ++ $updowncount;
} }
@ -6696,15 +6694,13 @@ class admin_setting_manageeditors extends admin_setting {
$class = ''; $class = '';
if (in_array($editor, $active_editors)) { if (in_array($editor, $active_editors)) {
$hideshow = "<a href=\"$url&amp;action=disable&amp;editor=$editor\">"; $hideshow = "<a href=\"$url&amp;action=disable&amp;editor=$editor\">";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"disable\" /></a>"; $hideshow .= $OUTPUT->pix_icon('t/hide', get_string('disable')) . '</a>';
// $hideshow = "<a href=\"$url&amp;action=disable&amp;editor=$editor\"><input type=\"checkbox\" checked /></a>";
$enabled = true; $enabled = true;
$displayname = $name; $displayname = $name;
} }
else { else {
$hideshow = "<a href=\"$url&amp;action=enable&amp;editor=$editor\">"; $hideshow = "<a href=\"$url&amp;action=enable&amp;editor=$editor\">";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"enable\" /></a>"; $hideshow .= $OUTPUT->pix_icon('t/show', get_string('enable')) . '</a>';
// $hideshow = "<a href=\"$url&amp;action=enable&amp;editor=$editor\"><input type=\"checkbox\" /></a>";
$enabled = false; $enabled = false;
$displayname = $name; $displayname = $name;
$class = 'dimmed_text'; $class = 'dimmed_text';
@ -6715,17 +6711,17 @@ class admin_setting_manageeditors extends admin_setting {
if ($enabled) { if ($enabled) {
if ($updowncount > 1) { if ($updowncount > 1) {
$updown .= "<a href=\"$url&amp;action=up&amp;editor=$editor\">"; $updown .= "<a href=\"$url&amp;action=up&amp;editor=$editor\">";
$updown .= "<img src=\"" . $OUTPUT->pix_url('t/up') . "\" alt=\"up\" class=\"iconsmall\" /></a>&nbsp;"; $updown .= $OUTPUT->pix_icon('t/up', get_string('moveup')) . '</a>&nbsp;';
} }
else { else {
$updown .= "<img src=\"" . $OUTPUT->pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" />&nbsp;"; $updown .= $OUTPUT->spacer() . '&nbsp;';
} }
if ($updowncount < $editorcount) { if ($updowncount < $editorcount) {
$updown .= "<a href=\"$url&amp;action=down&amp;editor=$editor\">"; $updown .= "<a href=\"$url&amp;action=down&amp;editor=$editor\">";
$updown .= "<img src=\"" . $OUTPUT->pix_url('t/down') . "\" alt=\"down\" class=\"iconsmall\" /></a>"; $updown .= $OUTPUT->pix_icon('t/down', get_string('movedown')) . '</a>&nbsp;';
} }
else { else {
$updown .= "<img src=\"" . $OUTPUT->pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" />"; $updown .= $OUTPUT->spacer() . '&nbsp;';
} }
++ $updowncount; ++ $updowncount;
} }
@ -6875,14 +6871,14 @@ class admin_setting_manageantiviruses extends admin_setting {
if (in_array($antivirus, $activeantiviruses)) { if (in_array($antivirus, $activeantiviruses)) {
$hideshowurl = $baseurl; $hideshowurl = $baseurl;
$hideshowurl->params(array('action' => 'disable', 'antivirus' => $antivirus)); $hideshowurl->params(array('action' => 'disable', 'antivirus' => $antivirus));
$hideshowimg = html_writer::img($OUTPUT->pix_url('t/hide'), 'disable', array('class' => 'iconsmall')); $hideshowimg = $OUTPUT->pix_icon('t/hide', get_string('disable'));
$hideshow = html_writer::link($hideshowurl, $hideshowimg); $hideshow = html_writer::link($hideshowurl, $hideshowimg);
$enabled = true; $enabled = true;
$displayname = $name; $displayname = $name;
} else { } else {
$hideshowurl = $baseurl; $hideshowurl = $baseurl;
$hideshowurl->params(array('action' => 'enable', 'antivirus' => $antivirus)); $hideshowurl->params(array('action' => 'enable', 'antivirus' => $antivirus));
$hideshowimg = html_writer::img($OUTPUT->pix_url('t/show'), 'enable', array('class' => 'iconsmall')); $hideshowimg = $OUTPUT->pix_icon('t/show', get_string('enable'));
$hideshow = html_writer::link($hideshowurl, $hideshowimg); $hideshow = html_writer::link($hideshowurl, $hideshowimg);
$enabled = false; $enabled = false;
$displayname = $name; $displayname = $name;
@ -6895,18 +6891,18 @@ class admin_setting_manageantiviruses extends admin_setting {
if ($updowncount > 1) { if ($updowncount > 1) {
$updownurl = $baseurl; $updownurl = $baseurl;
$updownurl->params(array('action' => 'up', 'antivirus' => $antivirus)); $updownurl->params(array('action' => 'up', 'antivirus' => $antivirus));
$updownimg = html_writer::img($OUTPUT->pix_url('t/up'), 'up', array('class' => 'iconsmall')); $updownimg = $OUTPUT->pix_icon('t/up', get_string('moveup'));
$updown = html_writer::link($updownurl, $updownimg); $updown = html_writer::link($updownurl, $updownimg);
} else { } else {
$updown .= html_writer::img($OUTPUT->pix_url('spacer'), '', array('class' => 'iconsmall')); $updownimg = $OUTPUT->spacer();
} }
if ($updowncount < $antiviruscount) { if ($updowncount < $antiviruscount) {
$updownurl = $baseurl; $updownurl = $baseurl;
$updownurl->params(array('action' => 'down', 'antivirus' => $antivirus)); $updownurl->params(array('action' => 'down', 'antivirus' => $antivirus));
$updownimg = html_writer::img($OUTPUT->pix_url('t/down'), 'down', array('class' => 'iconsmall')); $updownimg = $OUTPUT->pix_icon('t/down', get_string('movedown'));
$updown = html_writer::link($updownurl, $updownimg); $updown = html_writer::link($updownurl, $updownimg);
} else { } else {
$updown .= html_writer::img($OUTPUT->pix_url('spacer'), '', array('class' => 'iconsmall')); $updownimg = $OUTPUT->spacer();
} }
++ $updowncount; ++ $updowncount;
} }
@ -7012,14 +7008,14 @@ class admin_setting_managelicenses extends admin_setting {
if ($value->enabled == 1) { if ($value->enabled == 1) {
$hideshow = html_writer::link($url.'&action=disable&license='.$value->shortname, $hideshow = html_writer::link($url.'&action=disable&license='.$value->shortname,
html_writer::tag('img', '', array('src'=>$OUTPUT->pix_url('t/hide'), 'class'=>'iconsmall', 'alt'=>'disable'))); $OUTPUT->pix_icon('t/hide', get_string('disable')));
} else { } else {
$hideshow = html_writer::link($url.'&action=enable&license='.$value->shortname, $hideshow = html_writer::link($url.'&action=enable&license='.$value->shortname,
html_writer::tag('img', '', array('src'=>$OUTPUT->pix_url('t/show'), 'class'=>'iconsmall', 'alt'=>'enable'))); $OUTPUT->pix_icon('t/show', get_string('enable')));
} }
if ($value->shortname == $CFG->sitedefaultlicense) { if ($value->shortname == $CFG->sitedefaultlicense) {
$displayname .= ' '.html_writer::tag('img', '', array('src'=>$OUTPUT->pix_url('t/locked'), 'class'=>'iconsmall', 'alt'=>get_string('default'), 'title'=>get_string('default'))); $displayname .= ' '.$OUTPUT->pix_icon('t/locked', get_string('default'));
$hideshow = ''; $hideshow = '';
} }
@ -8623,14 +8619,14 @@ class admin_setting_managerepository extends admin_setting {
if ($updowncount > 1) { if ($updowncount > 1) {
$updown .= "<a href=\"$this->baseurl&amp;action=moveup&amp;repos=".$typename."\">"; $updown .= "<a href=\"$this->baseurl&amp;action=moveup&amp;repos=".$typename."\">";
$updown .= "<img src=\"" . $OUTPUT->pix_url('t/up') . "\" alt=\"up\" class=\"iconsmall\" /></a>&nbsp;"; $updown .= $OUTPUT->pix_icon('t/up', get_string('moveup')) . '</a>&nbsp;';
} }
else { else {
$updown .= $spacer; $updown .= $spacer;
} }
if ($updowncount < $totalrepositorytypes) { if ($updowncount < $totalrepositorytypes) {
$updown .= "<a href=\"$this->baseurl&amp;action=movedown&amp;repos=".$typename."\">"; $updown .= "<a href=\"$this->baseurl&amp;action=movedown&amp;repos=".$typename."\">";
$updown .= "<img src=\"" . $OUTPUT->pix_url('t/down') . "\" alt=\"down\" class=\"iconsmall\" /></a>"; $updown .= $OUTPUT->pix_icon('t/down', get_string('movedown')) . '</a>&nbsp;';
} }
else { else {
$updown .= $spacer; $updown .= $spacer;
@ -9424,11 +9420,11 @@ class admin_setting_managewebserviceprotocols extends admin_setting {
// hide/show link // hide/show link
if (in_array($protocol, $active_protocols)) { if (in_array($protocol, $active_protocols)) {
$hideshow = "<a href=\"$url&amp;action=disable&amp;webservice=$protocol\">"; $hideshow = "<a href=\"$url&amp;action=disable&amp;webservice=$protocol\">";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"$strdisable\" /></a>"; $hideshow .= $OUTPUT->pix_icon('t/hide', $strdisable) . '</a>';
$displayname = "<span>$name</span>"; $displayname = "<span>$name</span>";
} else { } else {
$hideshow = "<a href=\"$url&amp;action=enable&amp;webservice=$protocol\">"; $hideshow = "<a href=\"$url&amp;action=enable&amp;webservice=$protocol\">";
$hideshow .= "<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strenable\" /></a>"; $hideshow .= $OUTPUT->pix_icon('t/show', $strenable) . '</a>';
$displayname = "<span class=\"dimmed_text\">$name</span>"; $displayname = "<span class=\"dimmed_text\">$name</span>";
} }

View file

@ -1077,7 +1077,7 @@ function print_arrow($direction='up', $strsort=null, $return=false) {
$strsort = get_string('sort' . $sortdir, 'grades'); $strsort = get_string('sort' . $sortdir, 'grades');
} }
$return = ' <img src="'.$OUTPUT->pix_url('t/' . $direction) . '" alt="'.$strsort.'" /> '; $return = ' ' . $OUTPUT->pix_icon('t/' . $direction, $strsort) . ' ';
if ($return) { if ($return) {
return $return; return $return;
@ -5043,7 +5043,7 @@ function message_contact_link($userid, $linktype='add', $return=false, $script=n
$iconpath = 't/addcontact'; $iconpath = 't/addcontact';
} }
$img = '<img src="'.$OUTPUT->pix_url($iconpath).'" class="iconsmall" alt="'.$safealttext.'" />'; $img = $OUTPUT->pix_icon($iconpath, $safealttext);
} }
$output = '<span class="'.$linktype.'contact">'. $output = '<span class="'.$linktype.'contact">'.
@ -5116,9 +5116,9 @@ function message_history_link($userid1, $userid2, $return=false, $keywords='', $
} }
if ($linktext == 'icon') { // Icon only if ($linktext == 'icon') { // Icon only
$fulllink = '<img src="'.$OUTPUT->pix_url('t/messages') . '" class="iconsmall" alt="'.$strmessagehistory.'" />'; $fulllink = $OUTPUT->pix_icon('t/messages', $strmessagehistory);
} else if ($linktext == 'both') { // Icon and standard name } else if ($linktext == 'both') { // Icon and standard name
$fulllink = '<img src="'.$OUTPUT->pix_url('t/messages') . '" class="iconsmall" alt="" />'; $fulllink = $OUTPUT->pix_icon('t/messages', '');
$fulllink .= '&nbsp;'.$strmessagehistory; $fulllink .= '&nbsp;'.$strmessagehistory;
} else if ($linktext) { // Custom name } else if ($linktext) { // Custom name
$fulllink = $linktext; $fulllink = $linktext;

View file

@ -143,12 +143,12 @@ class tiynce_subplugins_settings extends admin_setting {
$displayname = html_writer::tag('span', $name, array('class'=>'error')); $displayname = html_writer::tag('span', $name, array('class'=>'error'));
} else if ($plugininfo->is_enabled()) { } else if ($plugininfo->is_enabled()) {
$url = new moodle_url('/lib/editor/tinymce/subplugins.php', array('sesskey'=>sesskey(), 'return'=>'settings', 'disable'=>$name)); $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('t/hide'), 'class'=>'iconsmall', 'alt'=>$strdisable)); $hideshow = $OUTPUT->pix_icon('t/hide', $strdisable);
$hideshow = html_writer::link($url, $hideshow); $hideshow = html_writer::link($url, $hideshow);
$displayname = $namestr; $displayname = $namestr;
} else { } else {
$url = new moodle_url('/lib/editor/tinymce/subplugins.php', array('sesskey'=>sesskey(), 'return'=>'settings', 'enable'=>$name)); $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('t/show'), 'class'=>'iconsmall', 'alt'=>$strenable)); $hideshow = $OUTPUT->pix_icon('t/show', $strenable);
$hideshow = html_writer::link($url, $hideshow); $hideshow = html_writer::link($url, $hideshow);
$displayname = $namestr; $displayname = $namestr;
$class = 'dimmed_text'; $class = 'dimmed_text';

View file

@ -690,11 +690,11 @@ function file_get_drafarea_files($draftitemid, $filepath = '/') {
if ($file->is_directory()) { if ($file->is_directory()) {
$item->filesize = 0; $item->filesize = 0;
$item->icon = $OUTPUT->pix_url(file_folder_icon(24))->out(false); $item->icon = $OUTPUT->image_url(file_folder_icon(24))->out(false);
$item->type = 'folder'; $item->type = 'folder';
$foldername = explode('/', trim($item->filepath, '/')); $foldername = explode('/', trim($item->filepath, '/'));
$item->fullname = trim(array_pop($foldername), '/'); $item->fullname = trim(array_pop($foldername), '/');
$item->thumbnail = $OUTPUT->pix_url(file_folder_icon(90))->out(false); $item->thumbnail = $OUTPUT->image_url(file_folder_icon(90))->out(false);
} else { } else {
// do NOT use file browser here! // do NOT use file browser here!
$item->mimetype = get_mimetype_description($file); $item->mimetype = get_mimetype_description($file);
@ -705,8 +705,8 @@ function file_get_drafarea_files($draftitemid, $filepath = '/') {
} }
$itemurl = moodle_url::make_draftfile_url($draftitemid, $item->filepath, $item->filename); $itemurl = moodle_url::make_draftfile_url($draftitemid, $item->filepath, $item->filename);
$item->url = $itemurl->out(); $item->url = $itemurl->out();
$item->icon = $OUTPUT->pix_url(file_file_icon($file, 24))->out(false); $item->icon = $OUTPUT->image_url(file_file_icon($file, 24))->out(false);
$item->thumbnail = $OUTPUT->pix_url(file_file_icon($file, 90))->out(false); $item->thumbnail = $OUTPUT->image_url(file_file_icon($file, 90))->out(false);
if ($imageinfo = $file->get_imageinfo()) { if ($imageinfo = $file->get_imageinfo()) {
$item->realthumbnail = $itemurl->out(false, array('preview' => 'thumb', 'oid' => $file->get_timemodified())); $item->realthumbnail = $itemurl->out(false, array('preview' => 'thumb', 'oid' => $file->get_timemodified()));
$item->realicon = $itemurl->out(false, array('preview' => 'tinyicon', 'oid' => $file->get_timemodified())); $item->realicon = $itemurl->out(false, array('preview' => 'tinyicon', 'oid' => $file->get_timemodified()));
@ -1450,7 +1450,8 @@ function mimeinfo($element, $filename) {
foreach ($filenames as $filename) { foreach ($filenames as $filename) {
foreach ($iconpostfixes as $size => $postfix) { foreach ($iconpostfixes as $size => $postfix) {
$fullname = $CFG->dirroot.'/pix/f/'.$filename.$postfix; $fullname = $CFG->dirroot.'/pix/f/'.$filename.$postfix;
if ($iconsize >= $size && (file_exists($fullname.'.png') || file_exists($fullname.'.gif'))) { if ($iconsize >= $size &&
(file_exists($fullname.'.svg') || file_exists($fullname.'.png') || file_exists($fullname.'.gif'))) {
return $filename.$postfix; return $filename.$postfix;
} }
} }
@ -1508,7 +1509,7 @@ function mimeinfo_from_type($element, $mimetype) {
* Usage: * Usage:
* <code> * <code>
* // $file - instance of stored_file or file_info * // $file - instance of stored_file or file_info
* $icon = $OUTPUT->pix_url(file_file_icon($file))->out(); * $icon = $OUTPUT->image_url(file_file_icon($file))->out();
* echo html_writer::empty_tag('img', array('src' => $icon, 'alt' => get_mimetype_description($file))); * echo html_writer::empty_tag('img', array('src' => $icon, 'alt' => get_mimetype_description($file)));
* </code> * </code>
* or * or
@ -1557,12 +1558,12 @@ function file_file_icon($file, $size = null) {
* *
* Usage: * Usage:
* <code> * <code>
* $icon = $OUTPUT->pix_url(file_folder_icon())->out(); * $icon = $OUTPUT->image_url(file_folder_icon())->out();
* echo html_writer::empty_tag('img', array('src' => $icon)); * echo html_writer::empty_tag('img', array('src' => $icon));
* </code> * </code>
* or * or
* <code> * <code>
* echo $OUTPUT->pix_icon(file_folder_icon(32)); * echo $OUTPUT->pix_icon(file_folder_icon(32), '');
* </code> * </code>
* *
* @param int $iconsize The size of the icon. Defaults to 16 can also be 24, 32, 48, 64, 72, 80, 96, 128, 256 * @param int $iconsize The size of the icon. Defaults to 16 can also be 24, 32, 48, 64, 72, 80, 96, 128, 256
@ -1588,12 +1589,12 @@ function file_folder_icon($iconsize = null) {
/** /**
* Returns the relative icon path for a given mime type * Returns the relative icon path for a given mime type
* *
* This function should be used in conjunction with $OUTPUT->pix_url to produce * This function should be used in conjunction with $OUTPUT->image_url to produce
* a return the full path to an icon. * a return the full path to an icon.
* *
* <code> * <code>
* $mimetype = 'image/jpg'; * $mimetype = 'image/jpg';
* $icon = $OUTPUT->pix_url(file_mimetype_icon($mimetype))->out(); * $icon = $OUTPUT->image_url(file_mimetype_icon($mimetype))->out();
* echo html_writer::empty_tag('img', array('src' => $icon, 'alt' => get_mimetype_description($mimetype))); * echo html_writer::empty_tag('img', array('src' => $icon, 'alt' => get_mimetype_description($mimetype)));
* </code> * </code>
* *
@ -1611,12 +1612,12 @@ function file_mimetype_icon($mimetype, $size = NULL) {
/** /**
* Returns the relative icon path for a given file name * Returns the relative icon path for a given file name
* *
* This function should be used in conjunction with $OUTPUT->pix_url to produce * This function should be used in conjunction with $OUTPUT->image_url to produce
* a return the full path to an icon. * a return the full path to an icon.
* *
* <code> * <code>
* $filename = '.jpg'; * $filename = '.jpg';
* $icon = $OUTPUT->pix_url(file_extension_icon($filename))->out(); * $icon = $OUTPUT->image_url(file_extension_icon($filename))->out();
* echo html_writer::empty_tag('img', array('src' => $icon, 'alt' => '...')); * echo html_writer::empty_tag('img', array('src' => $icon, 'alt' => '...'));
* </code> * </code>
* *
@ -4088,7 +4089,7 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null) {
// also if login is required for profile images and is not logged in or guest // also if login is required for profile images and is not logged in or guest
// do not use require_login() because it is expensive and not suitable here anyway // do not use require_login() because it is expensive and not suitable here anyway
$theme = theme_config::load($themename); $theme = theme_config::load($themename);
redirect($theme->pix_url('u/'.$filename, 'moodle')); // intentionally not cached redirect($theme->image_url('u/'.$filename, 'moodle')); // intentionally not cached
} }
if (!$file = $fs->get_file($context->id, 'user', 'icon', 0, '/', $filename.'.png')) { if (!$file = $fs->get_file($context->id, 'user', 'icon', 0, '/', $filename.'.png')) {

View file

@ -1486,8 +1486,8 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless {
}else { }else {
$this->updateAttributes(array('class'=>'mform')); $this->updateAttributes(array('class'=>'mform'));
} }
$this->_reqHTML = '<img class="req" title="'.get_string('requiredelement', 'form').'" alt="'.get_string('requiredelement', 'form').'" src="'.$OUTPUT->pix_url('req') .'" />'; $this->_reqHTML = '<span class="req">' . $OUTPUT->pix_icon('req', get_string('requiredelement', 'form')) . '</span>';
$this->_advancedHTML = '<img class="adv" title="'.get_string('advancedelement', 'form').'" alt="'.get_string('advancedelement', 'form').'" src="'.$OUTPUT->pix_url('adv') .'" />'; $this->_advancedHTML = '<span class="adv">' . $OUTPUT->pix_icon('adv', get_string('advancedelement', 'form')) . '</span>';
$this->setRequiredNote(get_string('somefieldsrequired', 'form', $OUTPUT->pix_icon('req', get_string('requiredelement', 'form')))); $this->setRequiredNote(get_string('somefieldsrequired', 'form', $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'))));
} }

View file

@ -131,7 +131,7 @@ class google_docs {
'url' => "{$gdoc->link[0]->attributes()->href}", 'url' => "{$gdoc->link[0]->attributes()->href}",
'source' => $source, 'source' => $source,
'date' => strtotime($gdoc->updated), 'date' => strtotime($gdoc->updated),
'thumbnail' => (string) $OUTPUT->pix_url(file_extension_icon($title, 32)) 'thumbnail' => (string) $OUTPUT->image_url(file_extension_icon($title, 32))
); );
} }
core_date::set_default_server_timezone(); core_date::set_default_server_timezone();

View file

@ -594,13 +594,13 @@ abstract class list_item {
public function image_icon($action, $url, $icon) { public function image_icon($action, $url, $icon) {
global $OUTPUT; global $OUTPUT;
return '<a title="' . s($action) .'" href="'.$url.'"> return '<a title="' . s($action) .'" href="'.$url.'">' .
<img src="' . $OUTPUT->pix_url('t/'.$icon) . '" class="iconsmall" alt="' . s($action). '" /></a> '; $OUTPUT->pix_icon('t/' . $icon, $action) . '</a> ';
} }
public function image_spacer() { public function image_spacer() {
global $OUTPUT; global $OUTPUT;
return '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" />'; return $OUTPUT->spacer();
} }
/** /**

View file

@ -1381,18 +1381,18 @@ class cm_info implements IteratorAggregate {
} else if (!empty($this->icon)) { } else if (!empty($this->icon)) {
if (substr($this->icon, 0, 4) === 'mod/') { if (substr($this->icon, 0, 4) === 'mod/') {
list($modname, $iconname) = explode('/', substr($this->icon, 4), 2); list($modname, $iconname) = explode('/', substr($this->icon, 4), 2);
$icon = $output->pix_url($iconname, $modname); $icon = $output->image_url($iconname, $modname);
} else { } else {
if (!empty($this->iconcomponent)) { if (!empty($this->iconcomponent)) {
// Icon has specified component // Icon has specified component
$icon = $output->pix_url($this->icon, $this->iconcomponent); $icon = $output->image_url($this->icon, $this->iconcomponent);
} else { } else {
// Icon does not have specified component, use default // Icon does not have specified component, use default
$icon = $output->pix_url($this->icon); $icon = $output->image_url($this->icon);
} }
} }
} else { } else {
$icon = $output->pix_url('icon', $this->modname); $icon = $output->image_url('icon', $this->modname);
} }
return $icon; return $icon;
} }
@ -2356,19 +2356,19 @@ class cached_cm_info {
/** /**
* Name of icon for this activity. Normally, this should be used together with $iconcomponent * Name of icon for this activity. Normally, this should be used together with $iconcomponent
* to define the icon, as per pix_url function. * to define the icon, as per image_url function.
* For backward compatibility, if this value is of the form 'mod/forum/icon' then an icon * For backward compatibility, if this value is of the form 'mod/forum/icon' then an icon
* within that module will be used. * within that module will be used.
* @see cm_info::get_icon_url() * @see cm_info::get_icon_url()
* @see renderer_base::pix_url() * @see renderer_base::image_url()
* @var string * @var string
*/ */
public $icon; public $icon;
/** /**
* Component for icon for this activity, as per pix_url; leave blank to use default 'moodle' * Component for icon for this activity, as per image_url; leave blank to use default 'moodle'
* component * component
* @see renderer_base::pix_url() * @see renderer_base::image_url()
* @var string * @var string
*/ */
public $iconcomponent; public $iconcomponent;

View file

@ -359,7 +359,7 @@ class user_picture implements renderable {
$size = (int)$this->size; $size = (int)$this->size;
} }
$defaulturl = $renderer->pix_url('u/'.$filename); // default image $defaulturl = $renderer->image_url('u/'.$filename); // default image
if ((!empty($CFG->forcelogin) and !isloggedin()) || if ((!empty($CFG->forcelogin) and !isloggedin()) ||
(!empty($CFG->forceloginforprofileimage) && (!isloggedin() || isguestuser()))) { (!empty($CFG->forceloginforprofileimage) && (!isloggedin() || isguestuser()))) {
@ -682,7 +682,7 @@ class pix_icon implements renderable, templatable {
} }
} }
$attributes['src'] = $output->pix_url($this->pix, $this->component)->out(false); $attributes['src'] = $output->image_url($this->pix, $this->component)->out(false);
$templatecontext = array(); $templatecontext = array();
foreach ($attributes as $name => $value) { foreach ($attributes as $name => $value) {
$templatecontext[] = array('name' => $name, 'value' => $value); $templatecontext[] = array('name' => $name, 'value' => $value);
@ -3149,7 +3149,7 @@ class block_contents {
/** /**
* @var array A (possibly empty) array of editing controls. Each element of * @var array A (possibly empty) array of editing controls. Each element of
* this array should be an array('url' => $url, 'icon' => $icon, 'caption' => $caption). * this array should be an array('url' => $url, 'icon' => $icon, 'caption' => $caption).
* $icon is the icon name. Fed to $OUTPUT->pix_url. * $icon is the icon name. Fed to $OUTPUT->image_url.
*/ */
public $controls = array(); public $controls = array();

View file

@ -1572,7 +1572,7 @@ class theme_config {
$replaced[$match[0]] = true; $replaced[$match[0]] = true;
$imagename = $match[2]; $imagename = $match[2];
$component = rtrim($match[1], '|'); $component = rtrim($match[1], '|');
$imageurl = $this->pix_url($imagename, $component)->out(false); $imageurl = $this->image_url($imagename, $component)->out(false);
// we do not need full url because the image.php is always in the same dir // we do not need full url because the image.php is always in the same dir
$imageurl = preg_replace('|^http.?://[^/]+|', '', $imageurl); $imageurl = preg_replace('|^http.?://[^/]+|', '', $imageurl);
$css = str_replace($match[0], $imageurl, $css); $css = str_replace($match[0], $imageurl, $css);

View file

@ -955,13 +955,13 @@ class core_renderer extends renderer_base {
// Special case for site home page - please do not remove // Special case for site home page - please do not remove
return '<div class="sitelink">' . return '<div class="sitelink">' .
'<a title="Moodle" href="http://moodle.org/">' . '<a title="Moodle" href="http://moodle.org/">' .
'<img src="' . $this->pix_url('moodlelogo') . '" alt="'.get_string('moodlelogo').'" /></a></div>'; '<img src="' . $this->image_url('moodlelogo') . '" alt="'.get_string('moodlelogo').'" /></a></div>';
} else if (!empty($CFG->target_release) && $CFG->target_release != $CFG->release) { } else if (!empty($CFG->target_release) && $CFG->target_release != $CFG->release) {
// Special case for during install/upgrade. // Special case for during install/upgrade.
return '<div class="sitelink">'. return '<div class="sitelink">'.
'<a title="Moodle" href="http://docs.moodle.org/en/Administrator_documentation" onclick="this.target=\'_blank\'">' . '<a title="Moodle" href="http://docs.moodle.org/en/Administrator_documentation" onclick="this.target=\'_blank\'">' .
'<img src="' . $this->pix_url('moodlelogo') . '" alt="'.get_string('moodlelogo').'" /></a></div>'; '<img src="' . $this->image_url('moodlelogo') . '" alt="'.get_string('moodlelogo').'" /></a></div>';
} else if ($this->page->course->id == $SITE->id || strpos($this->page->pagetype, 'course-view') === 0) { } else if ($this->page->course->id == $SITE->id || strpos($this->page->pagetype, 'course-view') === 0) {
return '<div class="homelink"><a href="' . $CFG->wwwroot . '/">' . return '<div class="homelink"><a href="' . $CFG->wwwroot . '/">' .
@ -2095,9 +2095,7 @@ class core_renderer extends renderer_base {
* @return string HTML fragment * @return string HTML fragment
*/ */
protected function render_pix_emoticon(pix_emoticon $emoticon) { protected function render_pix_emoticon(pix_emoticon $emoticon) {
$attributes = $emoticon->attributes; return $this->render_pix_icon($emoticon);
$attributes['src'] = $this->pix_url($emoticon->pix, $emoticon->component);
return html_writer::empty_tag('img', $attributes);
} }
/** /**
@ -3974,7 +3972,7 @@ EOD;
* @return string The favicon URL * @return string The favicon URL
*/ */
public function favicon() { public function favicon() {
return $this->pix_url('favicon', 'theme'); return $this->image_url('favicon', 'theme');
} }
/** /**

View file

@ -316,7 +316,6 @@ class page_requirements_manager {
$this->M_cfg = array( $this->M_cfg = array(
'wwwroot' => $CFG->httpswwwroot, // Yes, really. See above. 'wwwroot' => $CFG->httpswwwroot, // Yes, really. See above.
'sesskey' => sesskey(), 'sesskey' => sesskey(),
'loadingicon' => $renderer->pix_url('i/loading_small', 'moodle')->out(false),
'themerev' => theme_get_revision(), 'themerev' => theme_get_revision(),
'slasharguments' => (int)(!empty($CFG->slasharguments)), 'slasharguments' => (int)(!empty($CFG->slasharguments)),
'theme' => $page->theme->name, 'theme' => $page->theme->name,

View file

@ -351,7 +351,7 @@ class portfolio_add_button {
break; break;
case PORTFOLIO_ADD_ICON_FORM: case PORTFOLIO_ADD_ICON_FORM:
$formoutput .= $selectoutput; $formoutput .= $selectoutput;
$formoutput .= "\n" . '<input class="portfolio-add-icon" type="image" src="' . $OUTPUT->pix_url('t/portfolioadd') . '" alt=' . $addstr .'" />'; $formoutput .= "\n" . '<button class="portfolio-add-icon">' . $OUTPUT->pix_icon('t/portfolioadd', $addstr) . '</button>';
$formoutput .= "\n" . '</form>'; $formoutput .= "\n" . '</form>';
break; break;
case PORTFOLIO_ADD_ICON_LINK: case PORTFOLIO_ADD_ICON_LINK:

View file

@ -64,9 +64,8 @@ function rss_get_link($contextid, $userid, $componentname, $id, $tooltiptext='')
static $rsspath = ''; static $rsspath = '';
$rsspath = rss_get_url($contextid, $userid, $componentname, $id); $rsspath = rss_get_url($contextid, $userid, $componentname, $id);
$rsspix = $OUTPUT->pix_url('i/rss');
return '<a href="'. $rsspath .'"><img src="'. $rsspix .'" title="'. strip_tags($tooltiptext) .'" alt="'.get_string('rss').'" /></a>'; return '<a href="'. $rsspath .'">' . $OUTPUT->pix_icon('i/rss', $tooltiptext) . '</a>';
} }
/** /**
@ -281,7 +280,7 @@ function rss_standard_header($title = NULL, $link = NULL, $description = NULL) {
*/ */
//write image info //write image info
$rsspix = $OUTPUT->pix_url('i/rsssitelogo'); $rsspix = $OUTPUT->image_url('i/rsssitelogo');
//write the info //write the info
$result .= rss_start_tag('image', 2, true); $result .= rss_start_tag('image', 2, true);

View file

@ -1177,16 +1177,14 @@ class flexible_table {
'aria-expanded' => 'false', 'aria-expanded' => 'false',
'aria-controls' => $ariacontrols); 'aria-controls' => $ariacontrols);
return html_writer::link($this->baseurl->out(false, array($this->request[TABLE_VAR_SHOW] => $column)), return html_writer::link($this->baseurl->out(false, array($this->request[TABLE_VAR_SHOW] => $column)),
html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/switch_plus'), 'alt' => get_string('show'))), $OUTPUT->pix_icon('t/switch_plus', get_string('show')), $linkattributes);
$linkattributes);
} else if ($this->headers[$index] !== NULL) { } else if ($this->headers[$index] !== NULL) {
$linkattributes = array('title' => get_string('hide') . ' ' . strip_tags($this->headers[$index]), $linkattributes = array('title' => get_string('hide') . ' ' . strip_tags($this->headers[$index]),
'aria-expanded' => 'true', 'aria-expanded' => 'true',
'aria-controls' => $ariacontrols); 'aria-controls' => $ariacontrols);
return html_writer::link($this->baseurl->out(false, array($this->request[TABLE_VAR_HIDE] => $column)), return html_writer::link($this->baseurl->out(false, array($this->request[TABLE_VAR_HIDE] => $column)),
html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/switch_minus'), 'alt' => get_string('hide'))), $OUTPUT->pix_icon('t/switch_minus', get_string('hide')), $linkattributes);
$linkattributes);
} }
} }
@ -1295,11 +1293,9 @@ class flexible_table {
} }
if ($order == SORT_ASC) { if ($order == SORT_ASC) {
return html_writer::empty_tag('img', return $OUTPUT->pix_icon('t/sort_asc', get_string('asc'));
array('src' => $OUTPUT->pix_url('t/sort_asc'), 'alt' => get_string('asc'), 'class' => 'iconsort'));
} else { } else {
return html_writer::empty_tag('img', return $OUTPUT->pix_icon('t/sort_desc', get_string('desc'));
array('src' => $OUTPUT->pix_url('t/sort_desc'), 'alt' => get_string('desc'), 'class' => 'iconsort'));
} }
} }

View file

@ -47,7 +47,9 @@
<span style="display:inline-block;" class="{{spanclass}}">&nbsp;{{rolename}}&nbsp; <span style="display:inline-block;" class="{{spanclass}}">&nbsp;{{rolename}}&nbsp;
{{#imageurl}} {{#imageurl}}
<a href="{{adminurl}}roles/permissions.php" class="{{linkclass}}" data-role-id="{{roleid}}" data-action="{{action}}"> <a href="{{adminurl}}roles/permissions.php" class="{{linkclass}}" data-role-id="{{roleid}}" data-action="{{action}}">
<img src="{{imageurl}}" alt="{{action}}" /> {{#icon}}
{{#pix}}{{icon}}, 'core', {{iconalt}}{{/pix}}
{{/icon}}
</a> </a>
{{/imageurl}} {{/imageurl}}
</span> </span>

View file

@ -2574,7 +2574,7 @@ function navmenulist($course, $sections, $modinfo, $strsection, $strjumpto, $wid
$class = 'activity '.$mod->modname; $class = 'activity '.$mod->modname;
$class .= ($cmid == $mod->id) ? ' selected' : ''; $class .= ($cmid == $mod->id) ? ' selected' : '';
$menu[] = '<li class="'.$class.'">'. $menu[] = '<li class="'.$class.'">'.
'<img src="'.$OUTPUT->pix_url('icon', $mod->modname) . '" alt="" />'. $OUTPUT->activity_icon('icon', '', $mod->modname).
'<a href="'.$CFG->wwwroot.'/mod/'.$url.'">'.$mod->name.'</a></li>'; '<a href="'.$CFG->wwwroot.'/mod/'.$url.'">'.$mod->name.'</a></li>';
} }
@ -2618,8 +2618,7 @@ function print_grade_menu($courseid, $name, $current, $includenograde=true, $ret
} }
$output .= html_writer::select($grades, $name, $current, false); $output .= html_writer::select($grades, $name, $current, false);
$helppix = $OUTPUT->pix_url('help'); $linkobject = '<span class="helplink">' . $OUTPUT->pix_icon('help', $strscales) . '</span>';
$linkobject = '<span class="helplink"><img class="iconhelp" alt="'.$strscales.'" src="'.$helppix.'" /></span>';
$link = new moodle_url('/course/scales.php', array('id' => $courseid, 'list' => 1)); $link = new moodle_url('/course/scales.php', array('id' => $courseid, 'list' => 1));
$action = new popup_action('click', $link, 'ratingscales', array('height' => 400, 'width' => 500)); $action = new popup_action('click', $link, 'ratingscales', array('height' => 400, 'width' => 500));
$output .= $OUTPUT->action_link($link, $linkobject, $action, array('title' => $strscales)); $output .= $OUTPUT->action_link($link, $linkobject, $action, array('title' => $strscales));

View file

@ -73,9 +73,9 @@ class popup_notification implements templatable, renderable {
$context->shortenedsubject = shorten_text($context->subject, 125); $context->shortenedsubject = shorten_text($context->subject, 125);
if (!empty($context->component) && substr($context->component, 0, 4) == 'mod_') { if (!empty($context->component) && substr($context->component, 0, 4) == 'mod_') {
$iconurl = $output->pix_url('icon', $context->component); $iconurl = $output->image_url('icon', $context->component);
} else { } else {
$iconurl = $output->pix_url('i/marker', 'core'); $iconurl = $output->image_url('i/marker', 'core');
} }
$context->iconurl = $iconurl->out(); $context->iconurl = $iconurl->out();

View file

@ -73,23 +73,11 @@ class core_message_renderer extends plugin_renderer_base {
$enable->text = html_writer::nonempty_tag('span', get_string('outputnotconfigured', 'message'), array('class' => 'error')); $enable->text = html_writer::nonempty_tag('span', get_string('outputnotconfigured', 'message'), array('class' => 'error'));
} else if ($processor->enabled) { } else if ($processor->enabled) {
$url = new moodle_url('/admin/message.php', array('disable' => $processor->id, 'sesskey' => sesskey())); $url = new moodle_url('/admin/message.php', array('disable' => $processor->id, 'sesskey' => sesskey()));
$enable->text = html_writer::link($url, html_writer::empty_tag('img', $enable->text = html_writer::link($url, $this->output->pix_icon('t/hide', get_string('outputenabled', 'message')));
array('src' => $this->output->pix_url('t/hide'),
'class' => 'iconsmall',
'title' => get_string('outputenabled', 'message'),
'alt' => get_string('outputenabled', 'message'),
)
));
} else { } else {
$row->attributes['class'] = 'dimmed_text'; $row->attributes['class'] = 'dimmed_text';
$url = new moodle_url('/admin/message.php', array('enable' => $processor->id, 'sesskey' => sesskey())); $url = new moodle_url('/admin/message.php', array('enable' => $processor->id, 'sesskey' => sesskey()));
$enable->text = html_writer::link($url, html_writer::empty_tag('img', $enable->text = html_writer::link($url, $this->output->pix_icon('t/show', get_string('outputdisabled', 'message')));
array('src' => $this->output->pix_url('t/show'),
'class' => 'iconsmall',
'title' => get_string('outputdisabled', 'message'),
'alt' => get_string('outputdisabled', 'message'),
)
));
} }
// Settings // Settings
$settings = new html_table_cell(); $settings = new html_table_cell();

View file

@ -57,7 +57,7 @@ $course = $DB->get_record('mnetservice_enrol_courses', array('id'=>$courseid, 'h
echo $OUTPUT->header(); echo $OUTPUT->header();
// course name // course name
$icon = html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/course'), 'alt' => get_string('category'))); $icon = $OUTPUT->pix_icon('i/course', get_string('category'));
echo $OUTPUT->heading($icon . s($course->fullname)); echo $OUTPUT->heading($icon . s($course->fullname));
// collapsible course summary // collapsible course summary

View file

@ -83,7 +83,7 @@ $table->head = array(
get_string('action') get_string('action')
); );
$table->attributes['class'] = 'generaltable remotecourses'; $table->attributes['class'] = 'generaltable remotecourses';
$icon = html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/course'), 'alt' => get_string('category'))); $icon = $OUTPUT->pix_icon('i/course', get_string('category'));
$prevcat = null; $prevcat = null;
foreach ($courses as $course) { foreach ($courses as $course) {
$course = (object)$course; $course = (object)$course;

View file

@ -855,8 +855,7 @@ class assign_grading_table extends table_sql implements renderable {
if (!$this->assignment->is_active_user($row->id)) { if (!$this->assignment->is_active_user($row->id)) {
$suspendedstring = get_string('userenrolmentsuspended', 'grades'); $suspendedstring = get_string('userenrolmentsuspended', 'grades');
$fullname .= ' ' . html_writer::empty_tag('img', array('src' => $this->output->pix_url('i/enrolmentsuspended'), $fullname .= ' ' . $this->output->pix_icon('i/enrolmentsuspended', $suspendedstring);
'title' => $suspendedstring, 'alt' => $suspendedstring, 'class' => 'usersuspendedicon'));
$fullname = html_writer::tag('span', $fullname, array('class' => 'usersuspended')); $fullname = html_writer::tag('span', $fullname, array('class' => 'usersuspended'));
} }
return $fullname; return $fullname;

View file

@ -1074,8 +1074,7 @@ function assign_print_recent_mod_activity($activity, $courseid, $detail, $modnam
if ($detail) { if ($detail) {
$modname = $modnames[$activity->type]; $modname = $modnames[$activity->type];
echo '<div class="title">'; echo '<div class="title">';
echo '<img src="' . $OUTPUT->pix_url('icon', 'assign') . '" '. echo $OUTPUT->activity_icon('icon', $modname, 'assign');
'class="icon" alt="' . $modname . '">';
echo '<a href="' . $CFG->wwwroot . '/mod/assign/view.php?id=' . $activity->cmid . '">'; echo '<a href="' . $CFG->wwwroot . '/mod/assign/view.php?id=' . $activity->cmid . '">';
echo $activity->name; echo $activity->name;
echo '</a>'; echo '</a>';

View file

@ -180,21 +180,18 @@ foreach ($overrides as $override) {
// Edit. // Edit.
$editurlstr = $overrideediturl->out(true, array('id' => $override->id)); $editurlstr = $overrideediturl->out(true, array('id' => $override->id));
$iconstr = '<a title="' . get_string('edit') . '" href="'. $editurlstr . '">' . $iconstr = '<a title="' . get_string('edit') . '" href="'. $editurlstr . '">' .
'<img src="' . $OUTPUT->pix_url('t/edit') . '" class="iconsmall" alt="' . $OUTPUT->pix_icon('t/edit', get_string('edit')) . '</a> ';
get_string('edit') . '" /></a> ';
// Duplicate. // Duplicate.
$copyurlstr = $overrideediturl->out(true, $copyurlstr = $overrideediturl->out(true,
array('id' => $override->id, 'action' => 'duplicate')); array('id' => $override->id, 'action' => 'duplicate'));
$iconstr .= '<a title="' . get_string('copy') . '" href="' . $copyurlstr . '">' . $iconstr .= '<a title="' . get_string('copy') . '" href="' . $copyurlstr . '">' .
'<img src="' . $OUTPUT->pix_url('t/copy') . '" class="iconsmall" alt="' . $OUTPUT->pix_icon('t/copy', get_string('copy')) . '</a> ';
get_string('copy') . '" /></a> ';
} }
// Delete. // Delete.
$deleteurlstr = $overridedeleteurl->out(true, $deleteurlstr = $overridedeleteurl->out(true,
array('id' => $override->id, 'sesskey' => sesskey())); array('id' => $override->id, 'sesskey' => sesskey()));
$iconstr .= '<a title="' . get_string('delete') . '" href="' . $deleteurlstr . '">' . $iconstr .= '<a title="' . get_string('delete') . '" href="' . $deleteurlstr . '">' .
'<img src="' . $OUTPUT->pix_url('t/delete') . '" class="iconsmall" alt="' . $OUTPUT->pix_icon('t/delete', get_string('delete')) . '</a> ';
get_string('delete') . '" /></a> ';
if ($groupmode) { if ($groupmode) {
$usergroupstr = '<a href="' . $groupurl->out(true, $usergroupstr = '<a href="' . $groupurl->out(true,
@ -203,19 +200,19 @@ foreach ($overrides as $override) {
// Move up. // Move up.
if ($override->sortorder > 1) { if ($override->sortorder > 1) {
$iconstr .= '<a title="'.get_string('moveup').'" href="overrides.php?cmid=' . $cmid . $iconstr .= '<a title="'.get_string('moveup').'" href="overrides.php?cmid=' . $cmid .
'&amp;id=' . $override->id .'&amp;action=movegroupoverride&amp;dir=up&amp;sesskey='.sesskey().'"> '&amp;id=' . $override->id .'&amp;action=movegroupoverride&amp;dir=up&amp;sesskey='.sesskey().'">' .
<img src="'.$OUTPUT->pix_url('t/up') . '" alt="'.get_string('moveup').'" class="iconsmall" /></a> '; $OUTPUT->pix_icon('t/up', get_string('moveup')) . '</a> ';
} else { } else {
$iconstr .= '<img src="'.$OUTPUT->pix_url('spacer') . '" alt="" class="iconsmall" /> '; $iconstr .= $OUTPUT->spacer() . ' ';
} }
// Move down. // Move down.
if ($override->sortorder < $overridecountgroup) { if ($override->sortorder < $overridecountgroup) {
$iconstr .= '<a title="'.get_string('movedown').'" href="overrides.php?cmid='.$cmid. $iconstr .= '<a title="'.get_string('movedown').'" href="overrides.php?cmid='.$cmid.
'&amp;id=' . $override->id . '&amp;action=movegroupoverride&amp;dir=down&amp;sesskey='.sesskey().'"> '&amp;id=' . $override->id . '&amp;action=movegroupoverride&amp;dir=down&amp;sesskey='.sesskey().'">' .
<img src="'.$OUTPUT->pix_url('t/down') . '" alt="'.get_string('movedown').'" class="iconsmall" /></a> '; $OUTPUT->pix_icon('t/down', get_string('movedown')) . '</a> ';
} else { } else {
$iconstr .= '<img src="'.$OUTPUT->pix_url('spacer') . '" alt="" class="iconsmall" /> '; $iconstr .= $OUTPUT->spacer() . ' ';
} }

View file

@ -140,8 +140,7 @@ class mod_assign_renderer extends plugin_renderer_base {
if ($summary->suspendeduser) { if ($summary->suspendeduser) {
$supendedclass = ' usersuspended'; $supendedclass = ' usersuspended';
$suspendedstring = get_string('userenrolmentsuspended', 'grades'); $suspendedstring = get_string('userenrolmentsuspended', 'grades');
$suspendedicon = ' ' . html_writer::empty_tag('img', array('src' => $this->pix_url('i/enrolmentsuspended'), $suspendedicon = ' ' . $this->pix_icon('i/enrolmentsuspended', $suspendedstring);
'title' => $suspendedstring, 'alt' => $suspendedstring, 'class' => 'usersuspendedicon'));
} }
$o .= $this->output->container_start('usersummary'); $o .= $this->output->container_start('usersummary');
$o .= $this->output->box_start('boxaligncenter usersummarysection'.$supendedclass); $o .= $this->output->box_start('boxaligncenter usersummarysection'.$supendedclass);

View file

@ -52,8 +52,7 @@ class data_field_checkbox extends data_field_base {
if ($this->field->required) { if ($this->field->required) {
$str .= '$nbsp;' . get_string('requiredelement', 'form'); $str .= '$nbsp;' . get_string('requiredelement', 'form');
$str .= '</span></legend>'; $str .= '</span></legend>';
$image = html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'), $image = $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
$str .= html_writer::div($image, 'inline-req'); $str .= html_writer::div($image, 'inline-req');
} else { } else {
$str .= '</span></legend>'; $str .= '</span></legend>';

View file

@ -71,8 +71,7 @@ class data_field_file extends data_field_base {
if ($this->field->required) { if ($this->field->required) {
$html .= '&nbsp;' . get_string('requiredelement', 'form') . '</span></legend>'; $html .= '&nbsp;' . get_string('requiredelement', 'form') . '</span></legend>';
$image = html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'), $image = $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
$html .= html_writer::div($image, 'inline-req'); $html .= html_writer::div($image, 'inline-req');
} else { } else {
$html .= '</span></legend>'; $html .= '</span></legend>';

View file

@ -65,8 +65,7 @@ class data_field_latlong extends data_field_base {
$classes = 'mod-data-input form-control-static'; $classes = 'mod-data-input form-control-static';
$str .= '<label for="field_'.$this->field->id.'_0" class="' . $classes . '">' . get_string('latitude', 'data'); $str .= '<label for="field_'.$this->field->id.'_0" class="' . $classes . '">' . get_string('latitude', 'data');
if ($this->field->required) { if ($this->field->required) {
$str .= html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'), $str .= $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
} }
$classes = 'form-control m-x-1'; $classes = 'form-control m-x-1';
$str .= '</label></td><td>'; $str .= '</label></td><td>';
@ -77,8 +76,7 @@ class data_field_latlong extends data_field_base {
$str .= '<tr><td align="right"><label for="field_'.$this->field->id.'_1" class="' . $classes . '">'; $str .= '<tr><td align="right"><label for="field_'.$this->field->id.'_1" class="' . $classes . '">';
$str .= get_string('longitude', 'data'); $str .= get_string('longitude', 'data');
if ($this->field->required) { if ($this->field->required) {
$str .= html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'), $str .= $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
} }
$classes = 'form-control m-x-1'; $classes = 'form-control m-x-1';
$str .= '</label></td><td><input class="' . $classes . '" type="text" '; $str .= '</label></td><td><input class="' . $classes . '" type="text" ';

View file

@ -58,8 +58,7 @@ class data_field_menu extends data_field_base {
$str .= '<label for="' . 'field_' . $this->field->id . '">'; $str .= '<label for="' . 'field_' . $this->field->id . '">';
$str .= html_writer::span($this->field->name, 'accesshide'); $str .= html_writer::span($this->field->name, 'accesshide');
if ($this->field->required) { if ($this->field->required) {
$image = html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'), $image = $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
$str .= html_writer::div($image, 'inline-req'); $str .= html_writer::div($image, 'inline-req');
} }
$str .= '</label>'; $str .= '</label>';

View file

@ -56,8 +56,7 @@ class data_field_multimenu extends data_field_base {
$str .= html_writer::span($this->field->name); $str .= html_writer::span($this->field->name);
if ($this->field->required) { if ($this->field->required) {
$str .= '<div class="inline-req">'; $str .= '<div class="inline-req">';
$str .= html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'), $str .= $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
$str .= '</div>'; $str .= '</div>';
} }
$str .= '</label>'; $str .= '</label>';

View file

@ -76,8 +76,7 @@ class data_field_picture extends data_field_base {
if ($this->field->required) { if ($this->field->required) {
$str .= '&nbsp;' . get_string('requiredelement', 'form') . '</span></legend>'; $str .= '&nbsp;' . get_string('requiredelement', 'form') . '</span></legend>';
$image = html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'), $image = $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
$str .= html_writer::div($image, 'inline-req'); $str .= html_writer::div($image, 'inline-req');
} else { } else {
$str .= '</span></legend>'; $str .= '</span></legend>';

View file

@ -53,8 +53,7 @@ class data_field_radiobutton extends data_field_base {
if ($this->field->required) { if ($this->field->required) {
$str .= '&nbsp;' . get_string('requiredelement', 'form') . '</span></legend>'; $str .= '&nbsp;' . get_string('requiredelement', 'form') . '</span></legend>';
$image = html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'), $image = $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
$str .= html_writer::div($image, 'inline-req'); $str .= html_writer::div($image, 'inline-req');
} else { } else {
$str .= '</span></legend>'; $str .= '</span></legend>';

View file

@ -64,8 +64,7 @@ class data_field_textarea extends data_field_base {
$str .= '<label for="field_' . $this->field->id . '" class="accesshide">'; $str .= '<label for="field_' . $this->field->id . '" class="accesshide">';
$str .= html_writer::span($this->field->name); $str .= html_writer::span($this->field->name);
if ($this->field->required) { if ($this->field->required) {
$image = html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'), $image = $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
$str .= html_writer::div($image, 'inline-req'); $str .= html_writer::div($image, 'inline-req');
} }
$str .= '</label>'; $str .= '</label>';

View file

@ -69,8 +69,7 @@ class data_field_url extends data_field_base {
$label = '<label for="' . $fieldid . '"><span class="accesshide">' . $this->field->name . '</span>'; $label = '<label for="' . $fieldid . '"><span class="accesshide">' . $this->field->name . '</span>';
if ($this->field->required) { if ($this->field->required) {
$image = html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'), $image = $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
if ($autolinkable) { if ($autolinkable) {
$label .= html_writer::div(get_string('requiredelement', 'form'), 'accesshide'); $label .= html_writer::div(get_string('requiredelement', 'form'), 'accesshide');
} else { } else {

View file

@ -304,8 +304,7 @@ class data_field_base { // Base class for Database Field Types (see field/*/
$str = '<div title="' . s($this->field->description) . '">'; $str = '<div title="' . s($this->field->description) . '">';
$str .= '<label for="field_'.$this->field->id.'"><span class="accesshide">'.$this->field->name.'</span>'; $str .= '<label for="field_'.$this->field->id.'"><span class="accesshide">'.$this->field->name.'</span>';
if ($this->field->required) { if ($this->field->required) {
$image = html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'), $image = $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
$str .= html_writer::div($image, 'inline-req'); $str .= html_writer::div($image, 'inline-req');
} }
$str .= '</label><input class="basefieldinput form-control d-inline mod-data-input" ' . $str .= '</label><input class="basefieldinput form-control d-inline mod-data-input" ' .
@ -505,8 +504,8 @@ class data_field_base { // Base class for Database Field Types (see field/*/
$params = array('d'=>$this->data->id, 'fid'=>$this->field->id, 'mode'=>'display', 'sesskey'=>sesskey()); $params = array('d'=>$this->data->id, 'fid'=>$this->field->id, 'mode'=>'display', 'sesskey'=>sesskey());
$link = new moodle_url('/mod/data/field.php', $params); $link = new moodle_url('/mod/data/field.php', $params);
$str = '<a href="'.$link->out().'">'; $str = '<a href="'.$link->out().'">';
$str .= '<img src="'.$OUTPUT->pix_url('field/'.$this->type, 'data') . '" '; $str = $OUTPUT->pix_icon('field/' . $this->type, $this->type, 'data');
$str .= 'height="'.$this->iconheight.'" width="'.$this->iconwidth.'" alt="'.$this->type.'" title="'.$this->type.'" /></a>'; $str .= '</a>';
return $str; return $str;
} }
@ -1303,9 +1302,11 @@ function data_print_template($template, $records, $data, $search='', $page=0, $r
$patterns[]='##delete##'; $patterns[]='##delete##';
if (data_user_can_manage_entry($record, $data, $context)) { if (data_user_can_manage_entry($record, $data, $context)) {
$replacement[] = '<a href="'.$CFG->wwwroot.'/mod/data/edit.php?d=' $replacement[] = '<a href="'.$CFG->wwwroot.'/mod/data/edit.php?d='
.$data->id.'&amp;rid='.$record->id.'&amp;sesskey='.sesskey().'"><img src="'.$OUTPUT->pix_url('t/edit') . '" class="iconsmall" alt="'.get_string('edit').'" title="'.get_string('edit').'" /></a>'; .$data->id.'&amp;rid='.$record->id.'&amp;sesskey='.sesskey().'">' .
$OUTPUT->pix_icon('t/edit', get_string('edit')) . '</a>';
$replacement[] = '<a href="'.$CFG->wwwroot.'/mod/data/view.php?d=' $replacement[] = '<a href="'.$CFG->wwwroot.'/mod/data/view.php?d='
.$data->id.'&amp;delete='.$record->id.'&amp;sesskey='.sesskey().'"><img src="'.$OUTPUT->pix_url('t/delete') . '" class="iconsmall" alt="'.get_string('delete').'" title="'.get_string('delete').'" /></a>'; .$data->id.'&amp;delete='.$record->id.'&amp;sesskey='.sesskey().'">' .
$OUTPUT->pix_icon('t/delete', get_string('delete')) . '</a>';
} else { } else {
$replacement[] = ''; $replacement[] = '';
$replacement[] = ''; $replacement[] = '';
@ -1316,9 +1317,7 @@ function data_print_template($template, $records, $data, $search='', $page=0, $r
$moreurl .= '&amp;filter=1'; $moreurl .= '&amp;filter=1';
} }
$patterns[]='##more##'; $patterns[]='##more##';
$replacement[] = '<a href="'.$moreurl.'"><img src="'.$OUTPUT->pix_url('t/preview'). $replacement[] = '<a href="'.$moreurl.'">' . $OUTPUT->pix_icon('t/preview', get_string('more', 'data')) . '</a>';
'" class="iconsmall" alt="'.get_string('more', 'data').'" title="'.get_string('more', 'data').
'" /></a>';
$patterns[]='##moreurl##'; $patterns[]='##moreurl##';
$replacement[] = $moreurl; $replacement[] = $moreurl;

View file

@ -69,13 +69,13 @@ foreach ($presets as &$preset) {
$preset->description = $preset->name; $preset->description = $preset->name;
if (data_user_can_delete_preset($context, $preset) && $preset->name != 'Image gallery') { if (data_user_can_delete_preset($context, $preset) && $preset->name != 'Image gallery') {
$delurl = new moodle_url('/mod/data/preset.php', array('d'=> $data->id, 'action'=>'confirmdelete', 'fullname'=>$preset->userid.'/'.$preset->shortname, 'sesskey'=>sesskey())); $delurl = new moodle_url('/mod/data/preset.php', array('d'=> $data->id, 'action'=>'confirmdelete', 'fullname'=>$preset->userid.'/'.$preset->shortname, 'sesskey'=>sesskey()));
$delicon = html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('t/delete'), 'class'=>'iconsmall', 'alt'=>$strdelete.' '.$preset->description)); $delicon = $OUTPUT->pix_icon('t/delete', $strdelete . ' ' . $preset->description);
$preset->description .= html_writer::link($delurl, $delicon); $preset->description .= html_writer::link($delurl, $delicon);
} }
} }
if ($preset->userid > 0 && data_user_can_delete_preset($context, $preset)) { if ($preset->userid > 0 && data_user_can_delete_preset($context, $preset)) {
$delurl = new moodle_url('/mod/data/preset.php', array('d'=> $data->id, 'action'=>'confirmdelete', 'fullname'=>$preset->userid.'/'.$preset->shortname, 'sesskey'=>sesskey())); $delurl = new moodle_url('/mod/data/preset.php', array('d'=> $data->id, 'action'=>'confirmdelete', 'fullname'=>$preset->userid.'/'.$preset->shortname, 'sesskey'=>sesskey()));
$delicon = html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('t/delete'), 'class'=>'iconsmall', 'alt'=>$strdelete.' '.$preset->description)); $delicon = $OUTPUT->pix_icon('t/delete', $strdelete . ' ' . $preset->description);
$preset->description .= html_writer::link($delurl, $delicon); $preset->description .= html_writer::link($delurl, $delicon);
} }
} }

View file

@ -325,8 +325,7 @@ class mod_feedback_complete_form extends moodleform {
// Add red asterisks on required fields. // Add red asterisks on required fields.
if ($item->required) { if ($item->required) {
$required = '<img class="req" title="'.get_string('requiredelement', 'form').'" alt="'. $required = $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
get_string('requiredelement', 'form').'" src="'.$OUTPUT->pix_url('req') .'" />';
$element->setLabel($element->getLabel() . $required); $element->setLabel($element->getLabel() . $required);
$this->hasrequired = true; $this->hasrequired = true;
} }
@ -549,7 +548,7 @@ class mod_feedback_complete_form extends moodleform {
($this->mode == self::MODE_COMPLETE || $this->mode == self::MODE_PRINT || $this->mode == self::MODE_VIEW_TEMPLATE)) { ($this->mode == self::MODE_COMPLETE || $this->mode == self::MODE_PRINT || $this->mode == self::MODE_VIEW_TEMPLATE)) {
$element = $mform->addElement('static', 'requiredfields', '', $element = $mform->addElement('static', 'requiredfields', '',
get_string('somefieldsrequired', 'form', get_string('somefieldsrequired', 'form',
'<img alt="'.get_string('requiredelement', 'form').'" src="'.$OUTPUT->pix_url('req') .'" />')); $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'))));
$element->setAttributes($element->getAttributes() + ['class' => 'requirednote']); $element->setAttributes($element->getAttributes() + ['class' => 'requirednote']);
} }

View file

@ -492,8 +492,7 @@ function feedback_print_recent_mod_activity($activity, $courseid, $detail, $modn
if ($detail) { if ($detail) {
$modname = $modnames[$activity->type]; $modname = $modnames[$activity->type];
echo '<div class="title">'; echo '<div class="title">';
echo "<img src=\"" . $OUTPUT->pix_url('icon', $activity->type) . "\" ". echo $OUTPUT->activity_icon('icon', $modname, $activity->type);
"class=\"icon\" alt=\"$modname\" />";
echo "<a href=\"$CFG->wwwroot/mod/feedback/view.php?id={$activity->cmid}\">{$activity->name}</a>"; echo "<a href=\"$CFG->wwwroot/mod/feedback/view.php?id={$activity->cmid}\">{$activity->name}</a>";
echo '</div>'; echo '</div>';
} }

View file

@ -241,8 +241,9 @@ if ($generalforums) {
$unreadlink = '-'; $unreadlink = '-';
} else if ($unread = forum_tp_count_forum_unread_posts($cm, $course)) { } else if ($unread = forum_tp_count_forum_unread_posts($cm, $course)) {
$unreadlink = '<span class="unread"><a href="view.php?f='.$forum->id.'">'.$unread.'</a>'; $unreadlink = '<span class="unread"><a href="view.php?f='.$forum->id.'">'.$unread.'</a>';
$icon = $OUTPUT->pix_icon('t/markasread', $strmarkallread);
$unreadlink .= '<a title="'.$strmarkallread.'" href="markposts.php?f='. $unreadlink .= '<a title="'.$strmarkallread.'" href="markposts.php?f='.
$forum->id.'&amp;mark=read&amp;sesskey=' . sesskey() . '"><img src="'.$OUTPUT->pix_url('t/markasread') . '" alt="'.$strmarkallread.'" class="iconsmall" /></a></span>'; $forum->id.'&amp;mark=read&amp;sesskey=' . sesskey() . '">' . $icon . '</a></span>';
} else { } else {
$unreadlink = '<span class="read">0</span>'; $unreadlink = '<span class="read">0</span>';
} }
@ -371,8 +372,9 @@ if ($course->id != SITEID) { // Only real courses have learning forums
$unreadlink = '-'; $unreadlink = '-';
} else if ($unread = forum_tp_count_forum_unread_posts($cm, $course)) { } else if ($unread = forum_tp_count_forum_unread_posts($cm, $course)) {
$unreadlink = '<span class="unread"><a href="view.php?f='.$forum->id.'">'.$unread.'</a>'; $unreadlink = '<span class="unread"><a href="view.php?f='.$forum->id.'">'.$unread.'</a>';
$icon = $OUTPUT->pix_icon('t/markasread', $strmarkallread);
$unreadlink .= '<a title="'.$strmarkallread.'" href="markposts.php?f='. $unreadlink .= '<a title="'.$strmarkallread.'" href="markposts.php?f='.
$forum->id.'&amp;mark=read&sesskey=' . sesskey() . '"><img src="'.$OUTPUT->pix_url('t/markasread') . '" alt="'.$strmarkallread.'" class="iconsmall" /></a></span>'; $forum->id.'&amp;mark=read&sesskey=' . sesskey() . '">' . $icon . '</a></span>';
} else { } else {
$unreadlink = '<span class="read">0</span>'; $unreadlink = '<span class="read">0</span>';
} }

View file

@ -3791,7 +3791,7 @@ function forum_print_discussion_header(&$post, $forum, $group = -1, $datestring
echo '</a>'; echo '</a>';
echo '<a title="'.$strmarkalldread.'" href="'.$CFG->wwwroot.'/mod/forum/markposts.php?f='. echo '<a title="'.$strmarkalldread.'" href="'.$CFG->wwwroot.'/mod/forum/markposts.php?f='.
$forum->id.'&amp;d='.$post->discussion.'&amp;mark=read&amp;returnpage=view.php&amp;sesskey=' . sesskey() . '">' . $forum->id.'&amp;d='.$post->discussion.'&amp;mark=read&amp;returnpage=view.php&amp;sesskey=' . sesskey() . '">' .
'<img src="'.$OUTPUT->pix_url('t/markasread') . '" class="iconsmall" alt="'.$strmarkalldread.'" /></a>'; $OUTPUT->pix_icon('t/markasread', $strmarkalldread) . '</a>';
echo '</span>'; echo '</span>';
} else { } else {
echo '<span class="read">'; echo '<span class="read">';
@ -5473,7 +5473,7 @@ function forum_print_latest_discussions($course, $forum, $maxdiscussions = -1, $
echo '<a title="'.get_string('markallread', 'forum'). echo '<a title="'.get_string('markallread', 'forum').
'" href="'.$CFG->wwwroot.'/mod/forum/markposts.php?f='. '" href="'.$CFG->wwwroot.'/mod/forum/markposts.php?f='.
$forum->id.'&amp;mark=read&amp;returnpage=view.php&amp;sesskey=' . sesskey() . '">'. $forum->id.'&amp;mark=read&amp;returnpage=view.php&amp;sesskey=' . sesskey() . '">'.
'<img src="'.$OUTPUT->pix_url('t/markasread') . '" class="iconsmall" alt="'.get_string('markallread', 'forum').'" /></a>'; $OUTPUT->pix_icon('t/markasread', get_string('markallread', 'forum')) . '</a>';
} }
echo '</th>'; echo '</th>';
} }
@ -5997,7 +5997,7 @@ function forum_print_recent_mod_activity($activity, $courseid, $detail, $modname
$output .= html_writer::start_div($class); $output .= html_writer::start_div($class);
if ($detail) { if ($detail) {
$aname = s($activity->name); $aname = s($activity->name);
$output .= html_writer::img($OUTPUT->pix_url('icon', $activity->type), $aname, ['class' => 'icon']); $output .= $OUTPUT->activity_icon('icon', $aname, $activity->type);
} }
$discussionurl = new moodle_url('/mod/forum/discuss.php', ['d' => $content->discussion]); $discussionurl = new moodle_url('/mod/forum/discuss.php', ['d' => $content->discussion]);
$discussionurl->set_anchor('p' . $activity->content->id); $discussionurl->set_anchor('p' . $activity->content->id);

View file

@ -263,8 +263,10 @@ echo $OUTPUT->heading(format_string($glossary->name), 2);
</td> </td>
<td style="width:19%" align="center" class="action"> <td style="width:19%" align="center" class="action">
<?php <?php
echo "<a href=\"editcategories.php?id=$cm->id&amp;action=delete&amp;mode=cat&amp;hook=$category->id\"><img alt=\"" . get_string("delete") . "\"src=\"" . $OUTPUT->pix_url('t/delete') . "\" class=\"iconsmall\" /></a> "; echo "<a href=\"editcategories.php?id=$cm->id&amp;action=delete&amp;mode=cat&amp;hook=$category->id\">" .
echo "<a href=\"editcategories.php?id=$cm->id&amp;action=edit&amp;mode=cat&amp;hook=$category->id\"><img alt=\"" . get_string("edit") . "\" src=\"" . $OUTPUT->pix_url('t/edit') . "\" class=\"iconsmall\" /></a>"; $OUTPUT->pix_icon('t/delete', get_string('delete')). "</a> ";
echo "<a href=\"editcategories.php?id=$cm->id&amp;action=edit&amp;mode=cat&amp;hook=$category->id\">" .
$OUTPUT->pix_icon('t/edit', get_string('edit')). "</a> ";
?> ?>
</td> </td>
</tr> </tr>

View file

@ -1236,8 +1236,7 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode='',$h
$return .= '<a class="icon" title="' . get_string('disapprove', 'glossary'). $return .= '<a class="icon" title="' . get_string('disapprove', 'glossary').
'" href="approve.php?newstate=0&amp;eid='.$entry->id.'&amp;mode='.$mode. '" href="approve.php?newstate=0&amp;eid='.$entry->id.'&amp;mode='.$mode.
'&amp;hook='.urlencode($hook).'&amp;sesskey='.sesskey(). '&amp;hook='.urlencode($hook).'&amp;sesskey='.sesskey().
'"><img src="'.$OUTPUT->pix_url('t/block').'" class="smallicon" alt="'. '">' . $OUTPUT->pix_icon('t/block', get_string('disapprove', 'glossary')) . '</a>';
get_string('disapprove','glossary').$altsuffix.'" /></a>';
} }
$iscurrentuser = ($entry->userid == $USER->id); $iscurrentuser = ($entry->userid == $USER->id);
@ -1250,15 +1249,15 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode='',$h
$output = true; $output = true;
$return .= '<a class="icon" title="'.get_string('exporttomainglossary','glossary') . '" ' . $return .= '<a class="icon" title="'.get_string('exporttomainglossary','glossary') . '" ' .
'href="exportentry.php?id='.$entry->id.'&amp;prevmode='.$mode.'&amp;hook='.urlencode($hook).'">' . 'href="exportentry.php?id='.$entry->id.'&amp;prevmode='.$mode.'&amp;hook='.urlencode($hook).'">' .
'<img src="'.$OUTPUT->pix_url('export', 'glossary').'" class="smallicon" ' . $OUTPUT->pix_icon('export', get_string('exporttomainglossary', 'glossary'), 'glossary') . '</a>';
'alt="'.get_string('exporttomainglossary','glossary').$altsuffix.'" /></a>';
} }
} }
$icon = 't/delete';
$iconcomponent = 'moodle';
if ( $entry->sourceglossaryid ) { if ( $entry->sourceglossaryid ) {
$icon = $OUTPUT->pix_url('minus', 'glossary'); // graphical metaphor (minus) for deleting an imported entry $icon = 'minus'; // graphical metaphor (minus) for deleting an imported entry
} else { $iconcomponent = 'glossary';
$icon = $OUTPUT->pix_url('t/delete');
} }
//Decide if an entry is editable: //Decide if an entry is editable:
@ -1269,14 +1268,11 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode='',$h
$output = true; $output = true;
$url = "deleteentry.php?id=$cm->id&amp;mode=delete&amp;entry=$entry->id&amp;prevmode=$mode&amp;hook=".urlencode($hook); $url = "deleteentry.php?id=$cm->id&amp;mode=delete&amp;entry=$entry->id&amp;prevmode=$mode&amp;hook=".urlencode($hook);
$return .= "<a class='icon' title=\"" . get_string("delete") . "\" " . $return .= "<a class='icon' title=\"" . get_string("delete") . "\" " .
"href=\"$url\"><img src=\""; "href=\"$url\">" . $OUTPUT->pix_icon($icon, get_string('delete'), $iconcomponent) . '</a>';
$return .= $icon;
$return .= "\" class=\"smallicon\" alt=\"" . get_string("delete") .$altsuffix."\" /></a>";
$url = "edit.php?cmid=$cm->id&amp;id=$entry->id&amp;mode=$mode&amp;hook=".urlencode($hook); $url = "edit.php?cmid=$cm->id&amp;id=$entry->id&amp;mode=$mode&amp;hook=".urlencode($hook);
$return .= "<a class='icon' title=\"" . get_string("edit") . "\" href=\"$url\">" . $return .= "<a class='icon' title=\"" . get_string("edit") . "\" href=\"$url\">" .
"<img src=\"" . $OUTPUT->pix_url('t/edit') . "\" class=\"smallicon\" " . $OUTPUT->pix_icon('t/edit', get_string('edit')) . '</a>';
"alt=\"" . get_string("edit") .$altsuffix. "\" /></a>";
} elseif ( $importedentry ) { } elseif ( $importedentry ) {
$return .= "<font size=\"-1\">" . get_string("exportedentry","glossary") . "</font>"; $return .= "<font size=\"-1\">" . get_string("exportedentry","glossary") . "</font>";
} }
@ -2050,7 +2046,7 @@ function glossary_print_sorting_links($cm, $mode, $sortkey = '',$sortorder = '')
$neworder = '&amp;sortorder=asc'; $neworder = '&amp;sortorder=asc';
$newordertitle = get_string('changeto', 'glossary', $asc); $newordertitle = get_string('changeto', 'glossary', $asc);
} }
$icon = " <img src=\"".$OUTPUT->pix_url($sortorder, 'glossary')."\" class=\"icon\" alt=\"$newordertitle\" />"; $icon = " " . $OUTPUT->pix_icon($sortorder, $newordertitle, 'glossary');
} else { } else {
if ( $sortkey != 'CREATION' and $sortkey != 'UPDATE' and if ( $sortkey != 'CREATION' and $sortkey != 'UPDATE' and
$sortkey != 'FIRSTNAME' and $sortkey != 'LASTNAME' ) { $sortkey != 'FIRSTNAME' and $sortkey != 'LASTNAME' ) {
@ -2059,7 +2055,7 @@ function glossary_print_sorting_links($cm, $mode, $sortkey = '',$sortorder = '')
} else { } else {
$newordertitle = $desc; $newordertitle = $desc;
$neworder = '&amp;sortorder=desc'; $neworder = '&amp;sortorder=desc';
$icon = ' <img src="'.$OUTPUT->pix_url('asc', 'glossary').'" class="icon" alt="'.$newordertitle.'" />'; $icon = " " . $OUTPUT->pix_icon('asc', $newordertitle, 'glossary');
} }
} }
$ficon = ''; $ficon = '';

View file

@ -62,7 +62,8 @@ if ($ADMIN->fulltree) {
$recformat = $DB->get_record('glossary_formats', array('id'=>$formatid)); $recformat = $DB->get_record('glossary_formats', array('id'=>$formatid));
$str .= '<tr>'; $str .= '<tr>';
$str .= '<td>' . $formatname . '</td>'; $str .= '<td>' . $formatname . '</td>';
$eicon = "<a title=\"".get_string("edit")."\" href=\"$CFG->wwwroot/mod/glossary/formats.php?id=$formatid&amp;mode=edit\"><img class=\"iconsmall\" src=\"".$OUTPUT->pix_url('t/edit')."\" alt=\"".get_string("edit")."\" /></a>"; $eicon = "<a title=\"".get_string("edit")."\" href=\"$CFG->wwwroot/mod/glossary/formats.php?id=$formatid&amp;mode=edit\">";
$eicon .= $OUTPUT->pix_icon('t/edit', get_string('edit')). "</a>";
if ( $recformat->visible ) { if ( $recformat->visible ) {
$vtitle = get_string("hide"); $vtitle = get_string("hide");
$vicon = "t/hide"; $vicon = "t/hide";
@ -70,9 +71,11 @@ if ($ADMIN->fulltree) {
$vtitle = get_string("show"); $vtitle = get_string("show");
$vicon = "t/show"; $vicon = "t/show";
} }
$vicon = "<a title=\"".$vtitle."\" href=\"$CFG->wwwroot/mod/glossary/formats.php?id=$formatid&amp;mode=visible&amp;sesskey=".sesskey()."\"><img class=\"iconsmall\" src=\"".$OUTPUT->pix_url($vicon)."\" alt=\"$vtitle\" /></a>"; $url = "$CFG->wwwroot/mod/glossary/formats.php?id=$formatid&amp;mode=visible&amp;sesskey=".sesskey();
$viconlink = "<a title=\"$vtitle\" href=\"$url\">";
$viconlink .= $OUTPUT->pix_icon($vicon, $vtitle) . "</a>";
$str .= '<td align="center">'.$eicon.'&nbsp;&nbsp;'.$vicon.'</td>'; $str .= '<td align="center">' . $eicon . '&nbsp;&nbsp;' . $viconlink . '</td>';
$str .= '</tr>'; $str .= '</tr>';
} }
$str .= '</table>'; $str .= '</table>';

View file

@ -195,21 +195,18 @@ foreach ($overrides as $override) {
// Edit. // Edit.
$editurlstr = $overrideediturl->out(true, array('id' => $override->id)); $editurlstr = $overrideediturl->out(true, array('id' => $override->id));
$iconstr = '<a title="' . get_string('edit') . '" href="'. $editurlstr . '">' . $iconstr = '<a title="' . get_string('edit') . '" href="'. $editurlstr . '">' .
'<img src="' . $OUTPUT->pix_url('t/edit') . '" class="iconsmall" alt="' . $OUTPUT->pix_icon('t/edit', get_string('edit')) . '</a> ';
get_string('edit') . '" /></a> ';
// Duplicate. // Duplicate.
$copyurlstr = $overrideediturl->out(true, $copyurlstr = $overrideediturl->out(true,
array('id' => $override->id, 'action' => 'duplicate')); array('id' => $override->id, 'action' => 'duplicate'));
$iconstr .= '<a title="' . get_string('copy') . '" href="' . $copyurlstr . '">' . $iconstr .= '<a title="' . get_string('copy') . '" href="' . $copyurlstr . '">' .
'<img src="' . $OUTPUT->pix_url('t/copy') . '" class="iconsmall" alt="' . $OUTPUT->pix_icon('t/copy', get_string('copy')) . '</a> ';
get_string('copy') . '" /></a> ';
} }
// Delete. // Delete.
$deleteurlstr = $overridedeleteurl->out(true, $deleteurlstr = $overridedeleteurl->out(true,
array('id' => $override->id, 'sesskey' => sesskey())); array('id' => $override->id, 'sesskey' => sesskey()));
$iconstr .= '<a title="' . get_string('delete') . '" href="' . $deleteurlstr . '">' . $iconstr .= '<a title="' . get_string('delete') . '" href="' . $deleteurlstr . '">' .
'<img src="' . $OUTPUT->pix_url('t/delete') . '" class="iconsmall" alt="' . $OUTPUT->pix_icon('t/delete', get_string('delete')) . '</a> ';
get_string('delete') . '" /></a> ';
if ($groupmode) { if ($groupmode) {
$usergroupstr = '<a href="' . $groupurl->out(true, $usergroupstr = '<a href="' . $groupurl->out(true,

View file

@ -406,30 +406,30 @@ class mod_lesson_renderer extends plugin_renderer_base {
$url = new moodle_url('/mod/lesson/lesson.php', $url = new moodle_url('/mod/lesson/lesson.php',
array('id' => $this->page->cm->id, 'action' => 'move', 'pageid' => $page->id, 'sesskey' => sesskey())); array('id' => $this->page->cm->id, 'action' => 'move', 'pageid' => $page->id, 'sesskey' => sesskey()));
$label = get_string('movepagenamed', 'lesson', format_string($page->title)); $label = get_string('movepagenamed', 'lesson', format_string($page->title));
$img = html_writer::img($this->output->pix_url('t/move'), $label, array('class' => 'iconsmall')); $img = $this->output->pix_icon('t/move', $label);
$actions[] = html_writer::link($url, $img, array('title' => $label)); $actions[] = html_writer::link($url, $img, array('title' => $label));
} }
$url = new moodle_url('/mod/lesson/editpage.php', array('id' => $this->page->cm->id, 'pageid' => $page->id, 'edit' => 1)); $url = new moodle_url('/mod/lesson/editpage.php', array('id' => $this->page->cm->id, 'pageid' => $page->id, 'edit' => 1));
$label = get_string('updatepagenamed', 'lesson', format_string($page->title)); $label = get_string('updatepagenamed', 'lesson', format_string($page->title));
$img = html_writer::img($this->output->pix_url('t/edit'), $label, array('class' => 'iconsmall')); $img = $this->output->pix_icon('t/edit', $label);
$actions[] = html_writer::link($url, $img, array('title' => $label)); $actions[] = html_writer::link($url, $img, array('title' => $label));
// Duplicate action. // Duplicate action.
$url = new moodle_url('/mod/lesson/lesson.php', array('id' => $this->page->cm->id, 'pageid' => $page->id, $url = new moodle_url('/mod/lesson/lesson.php', array('id' => $this->page->cm->id, 'pageid' => $page->id,
'action' => 'duplicate', 'sesskey' => sesskey())); 'action' => 'duplicate', 'sesskey' => sesskey()));
$label = get_string('duplicatepagenamed', 'lesson', format_string($page->title)); $label = get_string('duplicatepagenamed', 'lesson', format_string($page->title));
$img = html_writer::img($this->output->pix_url('e/copy', 'mod_lesson'), $label, array('class' => 'iconsmall')); $img = $this->output->pix_icon('e/copy', $label, 'mod_lesson');
$actions[] = html_writer::link($url, $img, array('title' => $label)); $actions[] = html_writer::link($url, $img, array('title' => $label));
$url = new moodle_url('/mod/lesson/view.php', array('id' => $this->page->cm->id, 'pageid' => $page->id)); $url = new moodle_url('/mod/lesson/view.php', array('id' => $this->page->cm->id, 'pageid' => $page->id));
$label = get_string('previewpagenamed', 'lesson', format_string($page->title)); $label = get_string('previewpagenamed', 'lesson', format_string($page->title));
$img = html_writer::img($this->output->pix_url('t/preview'), $label, array('class' => 'iconsmall')); $img = $this->output->pix_icon('t/preview', $label);
$actions[] = html_writer::link($url, $img, array('title' => $label)); $actions[] = html_writer::link($url, $img, array('title' => $label));
$url = new moodle_url('/mod/lesson/lesson.php', $url = new moodle_url('/mod/lesson/lesson.php',
array('id' => $this->page->cm->id, 'action' => 'confirmdelete', 'pageid' => $page->id, 'sesskey' => sesskey())); array('id' => $this->page->cm->id, 'action' => 'confirmdelete', 'pageid' => $page->id, 'sesskey' => sesskey()));
$label = get_string('deletepagenamed', 'lesson', format_string($page->title)); $label = get_string('deletepagenamed', 'lesson', format_string($page->title));
$img = html_writer::img($this->output->pix_url('t/delete'), $label, array('class' => 'iconsmall')); $img = $this->output->pix_icon('t/delete', $label);
$actions[] = html_writer::link($url, $img, array('title' => $label)); $actions[] = html_writer::link($url, $img, array('title' => $label));
if ($printaddpage) { if ($printaddpage) {

View file

@ -2673,7 +2673,7 @@ function get_tool_type_icon_url(stdClass $type) {
} }
if (empty($iconurl)) { if (empty($iconurl)) {
$iconurl = $OUTPUT->pix_url('icon', 'lti')->out(); $iconurl = $OUTPUT->image_url('icon', 'lti')->out();
} }
return $iconurl; return $iconurl;
@ -2754,7 +2754,7 @@ function get_tool_proxy_urls(stdClass $proxy) {
global $OUTPUT; global $OUTPUT;
$urls = array( $urls = array(
'icon' => $OUTPUT->pix_url('icon', 'lti')->out(), 'icon' => $OUTPUT->image_url('icon', 'lti')->out(),
'edit' => get_tool_proxy_edit_url($proxy), 'edit' => get_tool_proxy_edit_url($proxy),
); );

View file

@ -244,12 +244,14 @@ class mod_lti_mod_form extends moodleform_mod {
array('sesskey' => sesskey(), 'course' => $COURSE->id)); array('sesskey' => sesskey(), 'course' => $COURSE->id));
$ajaxurl = new moodle_url('/mod/lti/ajax.php'); $ajaxurl = new moodle_url('/mod/lti/ajax.php');
// All these icon uses are incorrect. LTI JS needs updating to use AMD modules and templates so it can use
// the mustache pix helper - until then LTI will have inconsistent icons.
$jsinfo = (object)array( $jsinfo = (object)array(
'edit_icon_url' => (string)$OUTPUT->pix_url('t/edit'), 'edit_icon_url' => (string)$OUTPUT->image_url('t/edit'),
'add_icon_url' => (string)$OUTPUT->pix_url('t/add'), 'add_icon_url' => (string)$OUTPUT->image_url('t/add'),
'delete_icon_url' => (string)$OUTPUT->pix_url('t/delete'), 'delete_icon_url' => (string)$OUTPUT->image_url('t/delete'),
'green_check_icon_url' => (string)$OUTPUT->pix_url('i/valid'), 'green_check_icon_url' => (string)$OUTPUT->image_url('i/valid'),
'warning_icon_url' => (string)$OUTPUT->pix_url('warning', 'lti'), 'warning_icon_url' => (string)$OUTPUT->image_url('warning', 'lti'),
'instructor_tool_type_edit_url' => $editurl->out(false), 'instructor_tool_type_edit_url' => $editurl->out(false),
'ajax_url' => $ajaxurl->out(true), 'ajax_url' => $ajaxurl->out(true),
'courseId' => $COURSE->id 'courseId' => $COURSE->id

View file

@ -965,9 +965,7 @@ class edit_renderer extends \plugin_renderer_base {
* @return string HTML to output. * @return string HTML to output.
*/ */
public function question_bank_loading() { public function question_bank_loading() {
return html_writer::div(html_writer::empty_tag('img', return $this->pix_icon('i/loading', get_string('loading'));
array('alt' => 'loading', 'class' => 'loading-icon', 'src' => $this->pix_url('i/loading'))),
'questionbankloading');
} }
/** /**

Some files were not shown because too many files have changed in this diff Show more