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 = '';
} else if ($blocks[$blockid]->visible) {
$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 {
$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';
}
@ -186,10 +186,10 @@
$undeletable = '';
} else if (in_array($blockname, $undeletableblocktypes)) {
$undeletable = '<a href="blocks.php?unprotect='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strunprotect.'">'.
'<img src="'.$OUTPUT->pix_url('t/unlock') . '" class="iconsmall" alt="'.$strunprotect.'" /></a>';
$OUTPUT->pix_icon('t/unlock', $strunprotect) . '</a>';
} else {
$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(

View File

@ -218,7 +218,7 @@ function get_table_row(\core\plugininfo\filter $plugininfo, $state, $isfirstrow,
// Re-order.
$updown = '';
$spacer = '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" />';
$spacer = $OUTPUT->spacer();
if ($state->active != TEXTFILTER_DISABLED) {
if (!$isfirstrow) {
$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 {
$columndir = $dir == "ASC" ? "DESC" : "ASC";
$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";
}

View File

@ -94,7 +94,7 @@
$missing = true;
} else {
// 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);
$missing = false;
}
@ -130,11 +130,11 @@
$class = '';
} else if ($module->visible) {
$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 = '';
} else {
$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';
}
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)) {
$icon = $this->output->pix_icon('icon', '', $plugin->type . '_' . $plugin->name, array('class' => 'icon pluginicon'));
} else {
$icon = $this->output->pix_icon('spacer', '', 'moodle', array('class' => 'icon pluginicon noicon'));
$icon = $this->output->spacer('spacer');
}
$status = $plugin->get_status();
$row->attributes['class'] .= ' status-'.$status;

View File

@ -370,14 +370,14 @@ if (($action == 'edit') || ($action == 'new')) {
if ($updowncount > 1) {
$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 {
$updown .= $spacer;
}
if ($updowncount < $totalrepositorytypes) {
$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 {
$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) {
global $OUTPUT;
$iconurl = $OUTPUT->pix_url('i/' . str_replace('risk', 'risk_', $type));
$text = '<img src="' . $iconurl . '" alt="' . get_string($type . 'short', 'admin') . '" />';
$text = $OUTPUT->pix_icon('i/' . str_replace('risk', 'risk_', $type), get_string($type . 'short', 'admin'));
$action = new popup_action('click', $this->risksurl, 'docspopup');
$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) {
if (isset($needed[$id])) {
$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)))) {
$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);
}
@ -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)))) {
$templatecontext = array("rolename" => $name, "roleid" => $id, "action" => "unprohibit",
"spanclass" => "forbidden", "linkclass" => "unprohibitlink", "adminurl" => $adminurl->out(),
"imageurl" => "");
"icon" => "", "iconalt" => "");
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);
}

View File

@ -216,9 +216,9 @@ die;
function get_action_icon($url, $icon, $alt, $tooltip) {
global $OUTPUT;
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() {
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);
$strcheck = get_string('checkuserspermissionshere', 'core_role', $a);
}
echo ' <a title="' . $strgoto . '" href="' . $raurl . '"><img class="iconsmall" src="' .
$OUTPUT->pix_url('t/edit') . '" alt="' . $stredit . '" /></a> ';
echo ' <a title="' . $strcheck . '" href="' . $churl . '"><img class="iconsmall" src="' .
$OUTPUT->pix_url('t/preview') . '" alt="' . $strcheckpermissions . '" /></a> ';
echo ' <a title="' . $strgoto . '" href="' . $raurl . '">' . $OUTPUT->pix_icon('t/edit', 'core', $stredit) . '</a> ';
echo ' <a title="' . $strcheck . '" href="' . $churl . '">' . $OUTPUT->pix_icon('t/preview', 'core', $strcheckpermissions) . '</a> ';
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
// than just a link) because it makes a database change.
$enablecontrol = html_writer::tag('form', html_writer::div(
html_writer::empty_tag('input', array('type' => 'hidden',
'name' => 'sesskey', 'value' => sesskey())) .
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' => './'));
$params = array('sesskey' => sesskey(), 'plugin' => $plugin, 'action' => $enabledaction);
$url = new moodle_url('/' . $CFG->admin . '/tool/availabilityconditions/', $params);
$enablecontrol = html_writer::link($url, $OUTPUT->pix_icon('t/' . $enabledaction, $enabledstr));
$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])) {
$aurl = new moodle_url($url, array('action' => 'disable', 'store' => $store));
$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;
$displayname = "<span>$name</span>";
} else {
if (isset($available[$store])) {
$aurl = new moodle_url($url, array('action' => 'enable', 'store' => $store));
$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;
$displayname = "<span class=\"dimmed_text\">$name</span>";
} else {
@ -188,7 +188,7 @@ class tool_log_setting_managestores extends admin_setting {
if ($PAGE->theme->resolve_image_location('icon', $store, false)) {
$icon = $OUTPUT->pix_icon('icon', '', $store, array('class' => 'icon pluginicon'));
} else {
$icon = $OUTPUT->pix_icon('spacer', '', 'moodle', array('class' => 'icon pluginicon noicon'));
$icon = $OUTPUT->spacer();
}
// Up/down link (only if store is enabled).
@ -197,16 +197,16 @@ class tool_log_setting_managestores extends admin_setting {
if ($updowncount > 1) {
$aurl = new moodle_url($url, array('action' => 'up', 'store' => $store));
$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 {
$updown .= "<img src=\"" . $OUTPUT->pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" />&nbsp;";
$updown .= $OUTPUT->spacer();
}
if ($updowncount < $storecount) {
$aurl = new moodle_url($url, array('action' => 'down', 'store' => $store));
$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 {
$updown .= "<img src=\"" . $OUTPUT->pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" />";
$updown .= $OUTPUT->spacer();
}
++$updowncount;
}

View File

@ -55,7 +55,7 @@
<div class="mdl-left">
{{^notoggle}}
<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}}
({{count}})
{{/displaytotalcount}}</span>

View File

@ -64,7 +64,7 @@
<li>{{#pix}}url, tool_lp{{/pix}} <a href="{{url}}" title="{{url}}">{{urlshort}}</a></li>
{{/url}}
{{#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}}
</ul>
{{/hasurlorfiles}}

View File

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

View File

@ -187,7 +187,7 @@ foreach ($items as $item) {
if (isset($modules[$item->module])) {
$mod = $modules[$item->module];
$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;
$edit = array();
$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'));
$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));
}
$table = new html_table();
@ -116,4 +116,4 @@ if (!$problems) {
echo html_writer::table($table);
}
echo $OUTPUT->footer();
echo $OUTPUT->footer();

View File

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

View File

@ -187,7 +187,7 @@
} else {
$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";
@ -298,7 +298,8 @@
if (is_mnet_remote_user($user) or $user->id == $USER->id or is_siteadmin($user)) {
// no deleting of self, mnet accounts or admins allowed
} 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 {
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 {
if ($user->id == $USER->id or is_siteadmin($user)) {
// no suspending of admins or self!
} 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)) {
$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)) {
// prevent editing of admins by non-admins
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';
} else {
$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->align[] = 'left';

View File

@ -57,7 +57,13 @@ foreach ($columns as $column) {
$columndir = 'asc';
} else {
$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->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'));
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/course/resources.php?id='.$course->id.'">'.$icon.$modfullname.'</a>';
} 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>';
}
}

View File

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

View File

@ -46,7 +46,7 @@ class block_course_list extends block_list {
$this->content->icons = array();
$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;
if (isset($CFG->block_course_list_adminview)) {
@ -139,7 +139,7 @@ class block_course_list extends block_list {
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!
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',
array('sesskey' => sesskey(), 'moveto' => 0, 'courseid' => $movingcourseid));
// Create move icon, so it can be used.
$movetofirsticon = html_writer::empty_tag('img',
array('src' => $this->output->pix_url('movehere'),
'alt' => get_string('movetofirst', 'block_course_overview', $courses[$movingcourseid]->fullname),
'title' => get_string('movehere')));
$movetofirsticon = $this->output->pix_icon('movehere', get_string('movetofirst', 'block_course_overview', $courses[$movingcourseid]->fullname));
$moveurl = html_writer::link($moveurl, $movetofirsticon);
$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'));
// If user is editing, then add move icons.
if ($userediting && !$ismovingcourse) {
$moveicon = html_writer::empty_tag('img',
array('src' => $this->pix_url('t/move')->out(false),
'alt' => get_string('movecourse', 'block_course_overview', $course->fullname),
'title' => get_string('move')));
$moveicon = $this->output->pix_icon('t/move', get_string('movecourse', 'block_course_overview', $course->fullname));
$moveurl = new moodle_url($this->page->url, array('sesskey' => sesskey(), 'movecourse' => 1, 'courseid' => $course->id));
$moveurl = html_writer::link($moveurl, $moveicon);
$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->movingcoursename = $courses[$movingcourseid]->fullname;
$a->currentcoursename = $course->fullname;
$movehereicon = html_writer::empty_tag('img',
array('src' => $this->output->pix_url('movehere'),
'alt' => get_string('moveafterhere', 'block_course_overview', $a),
'title' => get_string('movehere')));
$movehereicon = $this->output->pix_icon('movehere', get_string('moveafterhere', 'block_course_overview', $a));
$moveurl = html_writer::link($moveurl, $movehereicon);
$html .= html_writer::tag('div', $moveurl, array('class' => 'movehere'));
}

View File

@ -53,8 +53,7 @@ class block_feedback extends block_list {
$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)) {
$this->instance->pageid = SITEID;

View File

@ -74,7 +74,7 @@ class block_messages extends block_base {
$this->content->text .= fullname($user).'</a></div>';
$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
$anchortag = $OUTPUT->action_link($link, $anchortagcontents, $action);

View File

@ -139,8 +139,7 @@ class block_mnet_hosts extends block_list {
if ($hosts) {
foreach ($hosts as $host) {
$icon = '<img src="'.$OUTPUT->pix_url('i/'.$host->application.'_host') . '"'.
' class="icon" alt="'.get_string('server', 'block_mnet_hosts').'" />&nbsp;';
$icon = $OUTPUT->pix_icon('i/'.$host->application.'_host', get_string('server', 'block_mnet_hosts')) . '&nbsp;';
if ($host->id == $USER->mnethostid) {
$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>';
}
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));
$anchortag = html_writer::link($anchorurl, $anchortagcontents,
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="'.
$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) {
$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>)';
}
@ -129,7 +129,7 @@ class block_site_main_menu extends block_list {
continue;
}
$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[] = '';
}
if ($mod->indent > 0) {
@ -149,7 +149,7 @@ class block_site_main_menu extends block_list {
if ($ismoving) {
$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[] = '';
}

View File

@ -91,7 +91,7 @@ class block_social_activities extends block_list {
}
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>)';
}
@ -124,7 +124,7 @@ class block_social_activities extends block_list {
continue;
}
$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[] = '';
}
if (!$mod->url) {
@ -141,7 +141,7 @@ class block_social_activities extends block_list {
if ($ismoving) {
$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[] = '';
}

View File

@ -394,7 +394,11 @@ function calendar_get_mini($courses, $groups, $users, $calmonth = false, $calyea
$dayhref->set_anchor('event_'.$event->id);
$popupcontent .= html_writer::start_tag('div');
$popupcontent .= $OUTPUT->pix_icon($popupicon, $popupalt, $component);
if ($component == 'moodle') {
$popupcontent .= $OUTPUT->pix_icon($popupicon, $popupalt, $component);
} else {
$popupcontent .= $OUTPUT->activity_icon($popupicon, $popupalt, $component);
}
// Show ical source if needed.
if (!empty($event->subscription) && $CFG->calendar_showicalsource) {
$a = new stdClass();
@ -689,18 +693,17 @@ function calendar_add_event_metadata($event) {
} else {
$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->courselink = calendar_get_courselink($module->course);
$event->cmid = $module->id;
} 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';
} 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->cssclass = 'calendar_event_course';
} else if ($event->groupid) { // Group event
@ -709,12 +712,11 @@ function calendar_add_event_metadata($event) {
} else {
$groupname = '';
}
$event->icon = html_writer::empty_tag('image', array('src' => $OUTPUT->pix_url('i/groupevent'),
'alt' => get_string('groupevent', 'calendar'), 'title' => $groupname, 'class' => 'icon'));
$event->icon = $OUTPUT->pix_icon('i/groupevent', get_string('groupevent', 'calendar'));
$event->courselink = calendar_get_courselink($event->courseid) . ', ' . $groupname;
$event->cssclass = 'calendar_event_group';
} 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';
}
return $event;
@ -3473,4 +3475,4 @@ function core_calendar_user_preferences() {
$preferences['calendar_persistflt'] = array('type' => PARAM_INT, 'null' => NULL_NOT_ALLOWED, 'default' => 0,
'choices' => array(0, 1));
return $preferences;
}
}

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('a', array('href' => $editlink));
$url = $this->output->pix_url('t/edit');
$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');
if ($deletelink != null) {
$commands .= html_writer::start_tag('a', array('href' => $deletelink));
$url = $this->output->pix_url('t/delete');
$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('div');

View File

@ -159,24 +159,24 @@ foreach($cohorts['cohorts'] as $cohort) {
if ($cohortmanager) {
if ($cohort->visible) {
$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')));
} else {
$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(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')));
$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')));
$editcolumnisempty = false;
}
if ($cohortcanassign) {
$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')));
$editcolumnisempty = false;
}

View File

@ -94,8 +94,8 @@ class comment_area_exporter extends \core\external\exporter {
'count' => array(
'type' => PARAM_INT,
),
'collapsediconurl' => array(
'type' => PARAM_URL,
'collapsediconkey' => array(
'type' => PARAM_RAW,
),
'displaytotalcount' => array(
'type' => PARAM_BOOL,
@ -126,7 +126,7 @@ class comment_area_exporter extends \core\external\exporter {
$values['autostart'] = $this->comment->get_autostart();
$values['canpost'] = $this->comment->can_post();
$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['displaycancel'] = $this->comment->get_displaycancel();
$values['displaytotalcount'] = $this->comment->get_displaytotalcount();

View File

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

View File

@ -467,7 +467,7 @@ class comment {
'role' => 'button',
'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::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'];
$alt = empty($item['pixattr']['alt']) ? '' : $item['pixattr']['alt'];
$controls[$key] = html_writer::link(
new moodle_url($url),
html_writer::empty_tag('img', array(
'src' => $this->output->pix_url($icon),
'class' => "icon " . $class,
'alt' => $alt
)),
new moodle_url($url), $this->output->pix_icon($icon, $alt),
$attr);
}

View File

@ -23,8 +23,7 @@
$streditsummary = get_string('editsummary');
$introcontent .= '<div class="editinglink"><a title="'.$streditsummary.'" '.
' href="modedit.php?update='.$cm->id.'&amp;sesskey='.sesskey().'">'.
'<img src="'.$OUTPUT->pix_url('t/edit') . '" '.
' class="icon edit" alt="'.$streditsummary.'" /></a></div>';
$OUTPUT->pix_icon('t/edit', $streditsummary) . '</a></div>';
}
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));
$output .= html_writer::empty_tag('input', array(
'type' => 'hidden', 'name' => 'completionstate', 'value' => $newstate));
$output .= html_writer::empty_tag('input', array(
'type' => 'image',
'src' => $this->output->pix_url('i/completion-'.$completionicon),
'alt' => $imgalt, 'title' => $imgtitle,
'aria-live' => 'polite'));
$output .= html_writer::tag('button',
$this->output->pix_icon('i/completion-' . $completionicon, $imgalt));
$output .= html_writer::end_tag('div');
$output .= html_writer::end_tag('form');
} else {
@ -1107,8 +1104,7 @@ class core_course_renderer extends plugin_renderer_base {
if ($chelper->get_show_courses() < self::COURSECAT_SHOW_COURSES_EXPANDED) {
if ($course->has_summary() || $course->has_course_contacts() || $course->has_course_overviewfiles()) {
$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'),
'alt' => $this->strings->summary));
$image = $this->output->pix_icon('i/info', $this->strings->summary);
$content .= html_writer::link($url, $image, array('title' => $this->strings->summary));
// Make sure JS file to expand course content is included.
$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));
$updown[] = $OUTPUT->action_icon($aurl, new pix_icon('t/up', $strup, 'core', array('class' => 'iconsmall')));
} else {
$updown[] = html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('spacer'), 'alt'=>'', 'class'=>'iconsmall'));
$updown[] = $OUTPUT->spacer();
}
if ($updowncount < $icount) {
$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')));
} else {
$updown[] = html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('spacer'), 'alt'=>'', 'class'=>'iconsmall'));
$updown[] = $OUTPUT->spacer();
}
++$updowncount;
@ -253,7 +253,7 @@ foreach ($instances as $instance) {
$edit[] = $OUTPUT->action_icon($aurl, new pix_icon('t/show', $strenable, 'core', array('class' => 'iconsmall')));
} else {
// 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
*/
public function user_roles_and_actions($userid, $roles, $assignableroles, $canassign, $pageurl) {
$iconenrolremove = $this->output->pix_url('t/delete');
// Get list of roles.
$rolesoutput = '';
foreach ($roles as $roleid=>$role) {
if ($canassign and (is_siteadmin() or isset($assignableroles[$roleid])) and !$role['unchangeable']) {
$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));
$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 {
@ -235,14 +232,12 @@ class core_enrol_renderer extends plugin_renderer_base {
* @return string
*/
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'));
$groupoutput = '';
foreach($groups as $groupid=>$name) {
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));
$groupoutput .= html_writer::tag('div', $name . html_writer::link($url, $icon), array('class'=>'group', 'rel'=>$groupid));
} else {
@ -641,11 +636,9 @@ class course_enrolment_table extends html_table implements renderable {
$direction = $this->sortdirection;
}
if ($direction === 'ASC') {
return html_writer::empty_tag('img', array('alt' => '', 'class' => 'iconsort',
'src' => $output->pix_url('t/sort_asc')));
return $output->pix_icon('t/sort_asc', get_string('sort'));
} else {
return html_writer::empty_tag('img', array('alt' => '', 'class' => 'iconsort',
'src' => $output->pix_url('t/sort_desc')));
return $output->pix_icon('t/sort_desc', get_string('sort'));
}
}

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);
$iconurl = $output->pix_url($icon, 'core');
$url = moodle_url::make_pluginfile_url(
$this->file->get_contextid(),
@ -163,7 +162,6 @@ class stored_file_exporter extends \core\external\exporter {
'filenameshort' => $filenameshort,
'filesizeformatted' => display_size((int) $this->file->get_filesize()),
'icon' => $icon,
'iconurl' => $iconurl->out(false),
'url' => $url->out(false),
'timecreatedformatted' => userdate($this->file->get_timecreated()),
'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-btn-add">
<a role="button" title="' . $straddfile . '" href="#">
<img src="' . $this->pix_url('a/add_file') . '" alt="' . $straddfiletext . '" />
' . $this->pix_icon('a/add_file', $straddfiletext) . '
</a>
</div>
<div class="fp-btn-mkdir">
<a role="button" title="' . $strmakedir . '" href="#">
<img src="' . $this->pix_url('a/create_folder') . '" alt="' . $strcreatefolder . '" />
' . $this->pix_icon('a/create_folder', $strcreatefolder) . '
</a>
</div>
<div class="fp-btn-download">
<a role="button" title="' . $strdownload . '" href="#">
<img src="' . $this->pix_url('a/download_all').'" alt="' . $strdownloadallfiles . '" />
' . $this->pix_icon('a/download_all', $strdownloadallfiles) . '
</a>
</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 class="fp-viewbar">
<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 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 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>
</div>
</div>
@ -393,7 +395,7 @@ class core_files_renderer extends plugin_renderer_base {
$rv = '
<div class="filemanager fp-select">
<div class="fp-select-loading">
<img src="'.$this->pix_url('i/loading_small').'" />
' . $this->pix_icon('i/loading_small', '') . '
</div>
<form class="form-horizontal">
<button class="fp-file-download">'.get_string('download').'</button>
@ -590,35 +592,35 @@ class core_files_renderer extends plugin_renderer_base {
</div>
<div class="fp-tb-refresh">
<a title="'. get_string('refresh', 'repository') .'" href="#">
<img alt="" src="'.$this->pix_url('a/refresh').'" />
' . $this->pix_icon('a/refresh', '') . '
</a>
</div>
<div class="fp-tb-logout">
<a title="'. get_string('logout', 'repository') .'" href="#">
<img alt="" src="'.$this->pix_url('a/logout').'" />
' . $this->pix_icon('a/logout', '') . '
</a>
</div>
<div class="fp-tb-manage">
<a title="'. get_string('settings', 'repository') .'" href="#">
<img alt="" src="'.$this->pix_url('a/setting').'" />
' . $this->pix_icon('a/setting', '') . '
</a>
</div>
<div class="fp-tb-help">
<a title="'. get_string('help', 'repository') .'" href="#">
<img alt="" src="'.$this->pix_url('a/help').'" />
' . $this->pix_icon('a/help', '') . '
</a>
</div>
<div class="fp-tb-message"></div>
</div>
<div class="fp-viewbar">
<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 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 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>
</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-link"><a href="#">'.get_string('more').'</a></div>
<div class="fp-nextpage-loading">
<img src="'.$this->pix_url('i/loading_small').'" />
' . $this->pix_icon('i/loading_small', '') . '
</div>
</div>';
return $rv;
@ -748,7 +750,7 @@ class core_files_renderer extends plugin_renderer_base {
$rv = '
<div class="file-picker fp-select">
<div class="fp-select-loading">
<img src="'.$this->pix_url('i/loading_small').'" />
' . $this->pix_icon('i/loading_small', '') . '
</div>
<form class="form-horizontal">
<div class="fp-forminset">
@ -877,7 +879,7 @@ class core_files_renderer extends plugin_renderer_base {
return '
<div class="fp-content-loading">
<div class="fp-content-center">
<img src="'.$this->pix_url('i/loading_small').'" />
' . $this->pix_icon('i/loading_small', '') . '
</div>
</div>';
}

View File

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

View File

@ -27,7 +27,6 @@ Y.extend(AUTOLINKER, Y.Base, {
// display a progress indicator
var title = '',
content = Y.Node.create('<div id="glossaryfilteroverlayprogress">' +
'<img src="' + M.cfg.loadingicon + '" class="spinner" />' +
'</div>'),
o = new Y.Overlay({
headerContent: title,
@ -35,6 +34,13 @@ Y.extend(AUTOLINKER, Y.Base, {
}),
fullurl,
cfg;
window.require(['core/templates'], function(Templates) {
Templates.renderPix('i/loading', 'core').then(function(html) {
content.append(html);
});
});
self.overlay = o;
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) {
$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'));
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 = '') {
$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'));
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)) {
$suspendedstring = get_string('userenrolmentsuspended', 'grades');
}
$usercell->text .= html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('i/enrolmentsuspended'), 'title'=>$suspendedstring,
'alt'=>$suspendedstring, 'class'=>'usersuspendedicon'));
$icon = $OUTPUT->pix_icon('i/enrolmentsuspended', $suspendedstring);
$usercell->text .= html_writer::tag('span', $icon, array('class'=>'usersuspendedicon'));
}
$userrow->cells[] = $usercell;

View File

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

View File

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

View File

@ -1077,7 +1077,7 @@ function print_arrow($direction='up', $strsort=null, $return=false) {
$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) {
return $return;
@ -5043,7 +5043,7 @@ function message_contact_link($userid, $linktype='add', $return=false, $script=n
$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">'.
@ -5116,9 +5116,9 @@ function message_history_link($userid1, $userid2, $return=false, $keywords='', $
}
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
$fulllink = '<img src="'.$OUTPUT->pix_url('t/messages') . '" class="iconsmall" alt="" />';
$fulllink = $OUTPUT->pix_icon('t/messages', '');
$fulllink .= '&nbsp;'.$strmessagehistory;
} else if ($linktext) { // Custom name
$fulllink = $linktext;

View File

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

View File

@ -690,11 +690,11 @@ function file_get_drafarea_files($draftitemid, $filepath = '/') {
if ($file->is_directory()) {
$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';
$foldername = explode('/', trim($item->filepath, '/'));
$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 {
// do NOT use file browser here!
$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);
$item->url = $itemurl->out();
$item->icon = $OUTPUT->pix_url(file_file_icon($file, 24))->out(false);
$item->thumbnail = $OUTPUT->pix_url(file_file_icon($file, 90))->out(false);
$item->icon = $OUTPUT->image_url(file_file_icon($file, 24))->out(false);
$item->thumbnail = $OUTPUT->image_url(file_file_icon($file, 90))->out(false);
if ($imageinfo = $file->get_imageinfo()) {
$item->realthumbnail = $itemurl->out(false, array('preview' => 'thumb', '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 ($iconpostfixes as $size => $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;
}
}
@ -1508,7 +1509,7 @@ function mimeinfo_from_type($element, $mimetype) {
* Usage:
* <code>
* // $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)));
* </code>
* or
@ -1557,12 +1558,12 @@ function file_file_icon($file, $size = null) {
*
* Usage:
* <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));
* </code>
* or
* <code>
* echo $OUTPUT->pix_icon(file_folder_icon(32));
* echo $OUTPUT->pix_icon(file_folder_icon(32), '');
* </code>
*
* @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
*
* 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.
*
* <code>
* $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)));
* </code>
*
@ -1611,12 +1612,12 @@ function file_mimetype_icon($mimetype, $size = NULL) {
/**
* 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.
*
* <code>
* $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' => '...'));
* </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
// do not use require_login() because it is expensive and not suitable here anyway
$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')) {

View File

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

View File

@ -131,7 +131,7 @@ class google_docs {
'url' => "{$gdoc->link[0]->attributes()->href}",
'source' => $source,
'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();

View File

@ -594,13 +594,13 @@ abstract class list_item {
public function image_icon($action, $url, $icon) {
global $OUTPUT;
return '<a title="' . s($action) .'" href="'.$url.'">
<img src="' . $OUTPUT->pix_url('t/'.$icon) . '" class="iconsmall" alt="' . s($action). '" /></a> ';
return '<a title="' . s($action) .'" href="'.$url.'">' .
$OUTPUT->pix_icon('t/' . $icon, $action) . '</a> ';
}
public function image_spacer() {
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)) {
if (substr($this->icon, 0, 4) === 'mod/') {
list($modname, $iconname) = explode('/', substr($this->icon, 4), 2);
$icon = $output->pix_url($iconname, $modname);
$icon = $output->image_url($iconname, $modname);
} else {
if (!empty($this->iconcomponent)) {
// Icon has specified component
$icon = $output->pix_url($this->icon, $this->iconcomponent);
$icon = $output->image_url($this->icon, $this->iconcomponent);
} else {
// Icon does not have specified component, use default
$icon = $output->pix_url($this->icon);
$icon = $output->image_url($this->icon);
}
}
} else {
$icon = $output->pix_url('icon', $this->modname);
$icon = $output->image_url('icon', $this->modname);
}
return $icon;
}
@ -2356,19 +2356,19 @@ class cached_cm_info {
/**
* 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
* within that module will be used.
* @see cm_info::get_icon_url()
* @see renderer_base::pix_url()
* @see renderer_base::image_url()
* @var string
*/
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
* @see renderer_base::pix_url()
* @see renderer_base::image_url()
* @var string
*/
public $iconcomponent;

View File

@ -359,7 +359,7 @@ class user_picture implements renderable {
$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()) ||
(!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();
foreach ($attributes as $name => $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
* 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();

View File

@ -1572,7 +1572,7 @@ class theme_config {
$replaced[$match[0]] = true;
$imagename = $match[2];
$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
$imageurl = preg_replace('|^http.?://[^/]+|', '', $imageurl);
$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
return '<div class="sitelink">' .
'<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) {
// Special case for during install/upgrade.
return '<div class="sitelink">'.
'<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) {
return '<div class="homelink"><a href="' . $CFG->wwwroot . '/">' .
@ -2095,9 +2095,7 @@ class core_renderer extends renderer_base {
* @return string HTML fragment
*/
protected function render_pix_emoticon(pix_emoticon $emoticon) {
$attributes = $emoticon->attributes;
$attributes['src'] = $this->pix_url($emoticon->pix, $emoticon->component);
return html_writer::empty_tag('img', $attributes);
return $this->render_pix_icon($emoticon);
}
/**
@ -3974,7 +3972,7 @@ EOD;
* @return string The favicon URL
*/
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(
'wwwroot' => $CFG->httpswwwroot, // Yes, really. See above.
'sesskey' => sesskey(),
'loadingicon' => $renderer->pix_url('i/loading_small', 'moodle')->out(false),
'themerev' => theme_get_revision(),
'slasharguments' => (int)(!empty($CFG->slasharguments)),
'theme' => $page->theme->name,

View File

@ -351,7 +351,7 @@ class portfolio_add_button {
break;
case PORTFOLIO_ADD_ICON_FORM:
$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>';
break;
case PORTFOLIO_ADD_ICON_LINK:

View File

@ -64,9 +64,8 @@ function rss_get_link($contextid, $userid, $componentname, $id, $tooltiptext='')
static $rsspath = '';
$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
$rsspix = $OUTPUT->pix_url('i/rsssitelogo');
$rsspix = $OUTPUT->image_url('i/rsssitelogo');
//write the info
$result .= rss_start_tag('image', 2, true);

View File

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

View File

@ -47,7 +47,9 @@
<span style="display:inline-block;" class="{{spanclass}}">&nbsp;{{rolename}}&nbsp;
{{#imageurl}}
<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>
{{/imageurl}}
</span>

View File

@ -2574,7 +2574,7 @@ function navmenulist($course, $sections, $modinfo, $strsection, $strjumpto, $wid
$class = 'activity '.$mod->modname;
$class .= ($cmid == $mod->id) ? ' selected' : '';
$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>';
}
@ -2618,8 +2618,7 @@ function print_grade_menu($courseid, $name, $current, $includenograde=true, $ret
}
$output .= html_writer::select($grades, $name, $current, false);
$helppix = $OUTPUT->pix_url('help');
$linkobject = '<span class="helplink"><img class="iconhelp" alt="'.$strscales.'" src="'.$helppix.'" /></span>';
$linkobject = '<span class="helplink">' . $OUTPUT->pix_icon('help', $strscales) . '</span>';
$link = new moodle_url('/course/scales.php', array('id' => $courseid, 'list' => 1));
$action = new popup_action('click', $link, 'ratingscales', array('height' => 400, 'width' => 500));
$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);
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 {
$iconurl = $output->pix_url('i/marker', 'core');
$iconurl = $output->image_url('i/marker', 'core');
}
$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'));
} else if ($processor->enabled) {
$url = new moodle_url('/admin/message.php', array('disable' => $processor->id, 'sesskey' => sesskey()));
$enable->text = html_writer::link($url, html_writer::empty_tag('img',
array('src' => $this->output->pix_url('t/hide'),
'class' => 'iconsmall',
'title' => get_string('outputenabled', 'message'),
'alt' => get_string('outputenabled', 'message'),
)
));
$enable->text = html_writer::link($url, $this->output->pix_icon('t/hide', get_string('outputenabled', 'message')));
} else {
$row->attributes['class'] = 'dimmed_text';
$url = new moodle_url('/admin/message.php', array('enable' => $processor->id, 'sesskey' => sesskey()));
$enable->text = html_writer::link($url, html_writer::empty_tag('img',
array('src' => $this->output->pix_url('t/show'),
'class' => 'iconsmall',
'title' => get_string('outputdisabled', 'message'),
'alt' => get_string('outputdisabled', 'message'),
)
));
$enable->text = html_writer::link($url, $this->output->pix_icon('t/show', get_string('outputdisabled', 'message')));
}
// Settings
$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();
// 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));
// collapsible course summary

View File

@ -83,7 +83,7 @@ $table->head = array(
get_string('action')
);
$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;
foreach ($courses as $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)) {
$suspendedstring = get_string('userenrolmentsuspended', 'grades');
$fullname .= ' ' . html_writer::empty_tag('img', array('src' => $this->output->pix_url('i/enrolmentsuspended'),
'title' => $suspendedstring, 'alt' => $suspendedstring, 'class' => 'usersuspendedicon'));
$fullname .= ' ' . $this->output->pix_icon('i/enrolmentsuspended', $suspendedstring);
$fullname = html_writer::tag('span', $fullname, array('class' => 'usersuspended'));
}
return $fullname;

View File

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

View File

@ -180,21 +180,18 @@ foreach ($overrides as $override) {
// Edit.
$editurlstr = $overrideediturl->out(true, array('id' => $override->id));
$iconstr = '<a title="' . get_string('edit') . '" href="'. $editurlstr . '">' .
'<img src="' . $OUTPUT->pix_url('t/edit') . '" class="iconsmall" alt="' .
get_string('edit') . '" /></a> ';
$OUTPUT->pix_icon('t/edit', get_string('edit')) . '</a> ';
// Duplicate.
$copyurlstr = $overrideediturl->out(true,
array('id' => $override->id, 'action' => 'duplicate'));
$iconstr .= '<a title="' . get_string('copy') . '" href="' . $copyurlstr . '">' .
'<img src="' . $OUTPUT->pix_url('t/copy') . '" class="iconsmall" alt="' .
get_string('copy') . '" /></a> ';
$OUTPUT->pix_icon('t/copy', get_string('copy')) . '</a> ';
}
// Delete.
$deleteurlstr = $overridedeleteurl->out(true,
array('id' => $override->id, 'sesskey' => sesskey()));
$iconstr .= '<a title="' . get_string('delete') . '" href="' . $deleteurlstr . '">' .
'<img src="' . $OUTPUT->pix_url('t/delete') . '" class="iconsmall" alt="' .
get_string('delete') . '" /></a> ';
$OUTPUT->pix_icon('t/delete', get_string('delete')) . '</a> ';
if ($groupmode) {
$usergroupstr = '<a href="' . $groupurl->out(true,
@ -203,19 +200,19 @@ foreach ($overrides as $override) {
// Move up.
if ($override->sortorder > 1) {
$iconstr .= '<a title="'.get_string('moveup').'" href="overrides.php?cmid=' . $cmid .
'&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> ';
'&amp;id=' . $override->id .'&amp;action=movegroupoverride&amp;dir=up&amp;sesskey='.sesskey().'">' .
$OUTPUT->pix_icon('t/up', get_string('moveup')) . '</a> ';
} else {
$iconstr .= '<img src="'.$OUTPUT->pix_url('spacer') . '" alt="" class="iconsmall" /> ';
$iconstr .= $OUTPUT->spacer() . ' ';
}
// Move down.
if ($override->sortorder < $overridecountgroup) {
$iconstr .= '<a title="'.get_string('movedown').'" href="overrides.php?cmid='.$cmid.
'&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> ';
'&amp;id=' . $override->id . '&amp;action=movegroupoverride&amp;dir=down&amp;sesskey='.sesskey().'">' .
$OUTPUT->pix_icon('t/down', get_string('movedown')) . '</a> ';
} 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) {
$supendedclass = ' usersuspended';
$suspendedstring = get_string('userenrolmentsuspended', 'grades');
$suspendedicon = ' ' . html_writer::empty_tag('img', array('src' => $this->pix_url('i/enrolmentsuspended'),
'title' => $suspendedstring, 'alt' => $suspendedstring, 'class' => 'usersuspendedicon'));
$suspendedicon = ' ' . $this->pix_icon('i/enrolmentsuspended', $suspendedstring);
}
$o .= $this->output->container_start('usersummary');
$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) {
$str .= '$nbsp;' . get_string('requiredelement', 'form');
$str .= '</span></legend>';
$image = html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'),
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
$image = $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
$str .= html_writer::div($image, 'inline-req');
} else {
$str .= '</span></legend>';

View File

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

View File

@ -65,8 +65,7 @@ class data_field_latlong extends data_field_base {
$classes = 'mod-data-input form-control-static';
$str .= '<label for="field_'.$this->field->id.'_0" class="' . $classes . '">' . get_string('latitude', 'data');
if ($this->field->required) {
$str .= html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'),
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
$str .= $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
}
$classes = 'form-control m-x-1';
$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 .= get_string('longitude', 'data');
if ($this->field->required) {
$str .= html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'),
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
$str .= $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
}
$classes = 'form-control m-x-1';
$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 .= html_writer::span($this->field->name, 'accesshide');
if ($this->field->required) {
$image = html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'),
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
$image = $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
$str .= html_writer::div($image, 'inline-req');
}
$str .= '</label>';

View File

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

View File

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

View File

@ -53,8 +53,7 @@ class data_field_radiobutton extends data_field_base {
if ($this->field->required) {
$str .= '&nbsp;' . get_string('requiredelement', 'form') . '</span></legend>';
$image = html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'),
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
$image = $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
$str .= html_writer::div($image, 'inline-req');
} else {
$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 .= html_writer::span($this->field->name);
if ($this->field->required) {
$image = html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'),
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
$image = $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
$str .= html_writer::div($image, 'inline-req');
}
$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>';
if ($this->field->required) {
$image = html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'),
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
$image = $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
if ($autolinkable) {
$label .= html_writer::div(get_string('requiredelement', 'form'), 'accesshide');
} 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 .= '<label for="field_'.$this->field->id.'"><span class="accesshide">'.$this->field->name.'</span>';
if ($this->field->required) {
$image = html_writer::img($OUTPUT->pix_url('req'), get_string('requiredelement', 'form'),
array('class' => 'req', 'title' => get_string('requiredelement', 'form')));
$image = $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
$str .= html_writer::div($image, 'inline-req');
}
$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());
$link = new moodle_url('/mod/data/field.php', $params);
$str = '<a href="'.$link->out().'">';
$str .= '<img src="'.$OUTPUT->pix_url('field/'.$this->type, 'data') . '" ';
$str .= 'height="'.$this->iconheight.'" width="'.$this->iconwidth.'" alt="'.$this->type.'" title="'.$this->type.'" /></a>';
$str = $OUTPUT->pix_icon('field/' . $this->type, $this->type, 'data');
$str .= '</a>';
return $str;
}
@ -1303,9 +1302,11 @@ function data_print_template($template, $records, $data, $search='', $page=0, $r
$patterns[]='##delete##';
if (data_user_can_manage_entry($record, $data, $context)) {
$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='
.$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 {
$replacement[] = '';
$replacement[] = '';
@ -1316,9 +1317,7 @@ function data_print_template($template, $records, $data, $search='', $page=0, $r
$moreurl .= '&amp;filter=1';
}
$patterns[]='##more##';
$replacement[] = '<a href="'.$moreurl.'"><img src="'.$OUTPUT->pix_url('t/preview').
'" class="iconsmall" alt="'.get_string('more', 'data').'" title="'.get_string('more', 'data').
'" /></a>';
$replacement[] = '<a href="'.$moreurl.'">' . $OUTPUT->pix_icon('t/preview', get_string('more', 'data')) . '</a>';
$patterns[]='##moreurl##';
$replacement[] = $moreurl;

View File

@ -69,13 +69,13 @@ foreach ($presets as &$preset) {
$preset->description = $preset->name;
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()));
$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);
}
}
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()));
$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);
}
}

View File

@ -325,8 +325,7 @@ class mod_feedback_complete_form extends moodleform {
// Add red asterisks on required fields.
if ($item->required) {
$required = '<img class="req" title="'.get_string('requiredelement', 'form').'" alt="'.
get_string('requiredelement', 'form').'" src="'.$OUTPUT->pix_url('req') .'" />';
$required = $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
$element->setLabel($element->getLabel() . $required);
$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)) {
$element = $mform->addElement('static', 'requiredfields', '',
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']);
}

View File

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

View File

@ -240,9 +240,10 @@ if ($generalforums) {
if (isset($untracked[$forum->id])) {
$unreadlink = '-';
} 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='.
$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 {
$unreadlink = '<span class="read">0</span>';
}
@ -371,8 +372,9 @@ if ($course->id != SITEID) { // Only real courses have learning forums
$unreadlink = '-';
} else if ($unread = forum_tp_count_forum_unread_posts($cm, $course)) {
$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='.
$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 {
$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 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() . '">' .
'<img src="'.$OUTPUT->pix_url('t/markasread') . '" class="iconsmall" alt="'.$strmarkalldread.'" /></a>';
$OUTPUT->pix_icon('t/markasread', $strmarkalldread) . '</a>';
echo '</span>';
} else {
echo '<span class="read">';
@ -5473,7 +5473,7 @@ function forum_print_latest_discussions($course, $forum, $maxdiscussions = -1, $
echo '<a title="'.get_string('markallread', 'forum').
'" href="'.$CFG->wwwroot.'/mod/forum/markposts.php?f='.
$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>';
}
@ -5997,7 +5997,7 @@ function forum_print_recent_mod_activity($activity, $courseid, $detail, $modname
$output .= html_writer::start_div($class);
if ($detail) {
$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->set_anchor('p' . $activity->content->id);

View File

@ -263,8 +263,10 @@ echo $OUTPUT->heading(format_string($glossary->name), 2);
</td>
<td style="width:19%" align="center" class="action">
<?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=edit&amp;mode=cat&amp;hook=$category->id\"><img alt=\"" . get_string("edit") . "\" src=\"" . $OUTPUT->pix_url('t/edit') . "\" class=\"iconsmall\" /></a>";
echo "<a href=\"editcategories.php?id=$cm->id&amp;action=delete&amp;mode=cat&amp;hook=$category->id\">" .
$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>
</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').
'" href="approve.php?newstate=0&amp;eid='.$entry->id.'&amp;mode='.$mode.
'&amp;hook='.urlencode($hook).'&amp;sesskey='.sesskey().
'"><img src="'.$OUTPUT->pix_url('t/block').'" class="smallicon" alt="'.
get_string('disapprove','glossary').$altsuffix.'" /></a>';
'">' . $OUTPUT->pix_icon('t/block', get_string('disapprove', 'glossary')) . '</a>';
}
$iscurrentuser = ($entry->userid == $USER->id);
@ -1250,15 +1249,15 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode='',$h
$output = true;
$return .= '<a class="icon" title="'.get_string('exporttomainglossary','glossary') . '" ' .
'href="exportentry.php?id='.$entry->id.'&amp;prevmode='.$mode.'&amp;hook='.urlencode($hook).'">' .
'<img src="'.$OUTPUT->pix_url('export', 'glossary').'" class="smallicon" ' .
'alt="'.get_string('exporttomainglossary','glossary').$altsuffix.'" /></a>';
$OUTPUT->pix_icon('export', get_string('exporttomainglossary', 'glossary'), 'glossary') . '</a>';
}
}
$icon = 't/delete';
$iconcomponent = 'moodle';
if ( $entry->sourceglossaryid ) {
$icon = $OUTPUT->pix_url('minus', 'glossary'); // graphical metaphor (minus) for deleting an imported entry
} else {
$icon = $OUTPUT->pix_url('t/delete');
$icon = 'minus'; // graphical metaphor (minus) for deleting an imported entry
$iconcomponent = 'glossary';
}
//Decide if an entry is editable:
@ -1269,14 +1268,11 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode='',$h
$output = true;
$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") . "\" " .
"href=\"$url\"><img src=\"";
$return .= $icon;
$return .= "\" class=\"smallicon\" alt=\"" . get_string("delete") .$altsuffix."\" /></a>";
"href=\"$url\">" . $OUTPUT->pix_icon($icon, get_string('delete'), $iconcomponent) . '</a>';
$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\">" .
"<img src=\"" . $OUTPUT->pix_url('t/edit') . "\" class=\"smallicon\" " .
"alt=\"" . get_string("edit") .$altsuffix. "\" /></a>";
$OUTPUT->pix_icon('t/edit', get_string('edit')) . '</a>';
} elseif ( $importedentry ) {
$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';
$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 {
if ( $sortkey != 'CREATION' and $sortkey != 'UPDATE' and
$sortkey != 'FIRSTNAME' and $sortkey != 'LASTNAME' ) {
@ -2059,7 +2055,7 @@ function glossary_print_sorting_links($cm, $mode, $sortkey = '',$sortorder = '')
} else {
$newordertitle = $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 = '';

View File

@ -62,7 +62,8 @@ if ($ADMIN->fulltree) {
$recformat = $DB->get_record('glossary_formats', array('id'=>$formatid));
$str .= '<tr>';
$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 ) {
$vtitle = get_string("hide");
$vicon = "t/hide";
@ -70,9 +71,11 @@ if ($ADMIN->fulltree) {
$vtitle = get_string("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 .= '</table>';

View File

@ -195,21 +195,18 @@ foreach ($overrides as $override) {
// Edit.
$editurlstr = $overrideediturl->out(true, array('id' => $override->id));
$iconstr = '<a title="' . get_string('edit') . '" href="'. $editurlstr . '">' .
'<img src="' . $OUTPUT->pix_url('t/edit') . '" class="iconsmall" alt="' .
get_string('edit') . '" /></a> ';
$OUTPUT->pix_icon('t/edit', get_string('edit')) . '</a> ';
// Duplicate.
$copyurlstr = $overrideediturl->out(true,
array('id' => $override->id, 'action' => 'duplicate'));
$iconstr .= '<a title="' . get_string('copy') . '" href="' . $copyurlstr . '">' .
'<img src="' . $OUTPUT->pix_url('t/copy') . '" class="iconsmall" alt="' .
get_string('copy') . '" /></a> ';
$OUTPUT->pix_icon('t/copy', get_string('copy')) . '</a> ';
}
// Delete.
$deleteurlstr = $overridedeleteurl->out(true,
array('id' => $override->id, 'sesskey' => sesskey()));
$iconstr .= '<a title="' . get_string('delete') . '" href="' . $deleteurlstr . '">' .
'<img src="' . $OUTPUT->pix_url('t/delete') . '" class="iconsmall" alt="' .
get_string('delete') . '" /></a> ';
$OUTPUT->pix_icon('t/delete', get_string('delete')) . '</a> ';
if ($groupmode) {
$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',
array('id' => $this->page->cm->id, 'action' => 'move', 'pageid' => $page->id, 'sesskey' => sesskey()));
$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));
}
$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));
$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));
// Duplicate action.
$url = new moodle_url('/mod/lesson/lesson.php', array('id' => $this->page->cm->id, 'pageid' => $page->id,
'action' => 'duplicate', 'sesskey' => sesskey()));
$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));
$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));
$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));
$url = new moodle_url('/mod/lesson/lesson.php',
array('id' => $this->page->cm->id, 'action' => 'confirmdelete', 'pageid' => $page->id, 'sesskey' => sesskey()));
$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));
if ($printaddpage) {

View File

@ -2673,7 +2673,7 @@ function get_tool_type_icon_url(stdClass $type) {
}
if (empty($iconurl)) {
$iconurl = $OUTPUT->pix_url('icon', 'lti')->out();
$iconurl = $OUTPUT->image_url('icon', 'lti')->out();
}
return $iconurl;
@ -2754,7 +2754,7 @@ function get_tool_proxy_urls(stdClass $proxy) {
global $OUTPUT;
$urls = array(
'icon' => $OUTPUT->pix_url('icon', 'lti')->out(),
'icon' => $OUTPUT->image_url('icon', 'lti')->out(),
'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));
$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(
'edit_icon_url' => (string)$OUTPUT->pix_url('t/edit'),
'add_icon_url' => (string)$OUTPUT->pix_url('t/add'),
'delete_icon_url' => (string)$OUTPUT->pix_url('t/delete'),
'green_check_icon_url' => (string)$OUTPUT->pix_url('i/valid'),
'warning_icon_url' => (string)$OUTPUT->pix_url('warning', 'lti'),
'edit_icon_url' => (string)$OUTPUT->image_url('t/edit'),
'add_icon_url' => (string)$OUTPUT->image_url('t/add'),
'delete_icon_url' => (string)$OUTPUT->image_url('t/delete'),
'green_check_icon_url' => (string)$OUTPUT->image_url('i/valid'),
'warning_icon_url' => (string)$OUTPUT->image_url('warning', 'lti'),
'instructor_tool_type_edit_url' => $editurl->out(false),
'ajax_url' => $ajaxurl->out(true),
'courseId' => $COURSE->id

View File

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

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