diff --git a/admin/blocks.php b/admin/blocks.php index f3faf4d1445..7b168ffde3a 100644 --- a/admin/blocks.php +++ b/admin/blocks.php @@ -168,10 +168,10 @@ $visible = ''; } else if ($blocks[$blockid]->visible) { $visible = ''. - ''.$strhide.''; + $OUTPUT->pix_icon('t/hide', $strhide) . ''; } else { $visible = ''. - ''.$strshow.''; + $OUTPUT->pix_icon('t/show', $strshow) . ''; $class = 'dimmed_text'; } @@ -186,10 +186,10 @@ $undeletable = ''; } else if (in_array($blockname, $undeletableblocktypes)) { $undeletable = ''. - ''.$strunprotect.''; + $OUTPUT->pix_icon('t/unlock', $strunprotect) . ''; } else { $undeletable = ''. - ''.$strprotect.''; + $OUTPUT->pix_icon('t/lock', $strprotect) . ''; } $row = array( diff --git a/admin/filters.php b/admin/filters.php index b1127678d18..9ae73f31c37 100644 --- a/admin/filters.php +++ b/admin/filters.php @@ -218,7 +218,7 @@ function get_table_row(\core\plugininfo\filter $plugininfo, $state, $isfirstrow, // Re-order. $updown = ''; - $spacer = ''; + $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'))); diff --git a/admin/mnet/access_control.php b/admin/mnet/access_control.php index 6b1cebcdea5..88abd77dcfc 100644 --- a/admin/mnet/access_control.php +++ b/admin/mnet/access_control.php @@ -150,7 +150,7 @@ foreach ($columns as $column) { } else { $columndir = $dir == "ASC" ? "DESC" : "ASC"; $columnicon = $dir == "ASC" ? "down" : "up"; - $columnicon = " pix_url('t/' . $columnicon) . "\" alt=\"\" />"; + $columnicon = " " . $OUTPUT->pix_icon('t/' . $columnicon, get_string('sort')); } $headings[$column] = "".$string[$column]."$columnicon"; } diff --git a/admin/modules.php b/admin/modules.php index 4cca5690820..fb112e7afc3 100644 --- a/admin/modules.php +++ b/admin/modules.php @@ -94,7 +94,7 @@ $missing = true; } else { // took out hspace="\10\", because it does not validate. don't know what to replace with. - $icon = "pix_url('icon', $module->name) . "\" class=\"icon\" alt=\"\" />"; + $icon = "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 = "name&sesskey=".sesskey()."\" title=\"$strhide\">". - "pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"$strhide\" />"; + $OUTPUT->pix_icon('t/hide', $strhide) . ''; $class = ''; } else { $visible = "name&sesskey=".sesskey()."\" title=\"$strshow\">". - "pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strshow\" />"; + $OUTPUT->pix_icon('t/show', $strshow) . ''; $class = 'dimmed_text'; } if ($module->name == "forum") { diff --git a/admin/renderer.php b/admin/renderer.php index 32d28fd57e1..613c8e1c7cc 100644 --- a/admin/renderer.php +++ b/admin/renderer.php @@ -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; diff --git a/admin/repository.php b/admin/repository.php index bf10f510c4e..6984da60f27 100644 --- a/admin/repository.php +++ b/admin/repository.php @@ -370,14 +370,14 @@ if (($action == 'edit') || ($action == 'new')) { if ($updowncount > 1) { $updown .= ""; - $updown .= "pix_url('t/up') . "\" alt=\"up\" /> "; + $updown .= $OUTPUT->pix_icon('t/up', get_string('moveup')) . " "; } else { $updown .= $spacer; } if ($updowncount < $totalrepositorytypes) { $updown .= ""; - $updown .= "pix_url('t/down') . "\" alt=\"down\" />"; + $updown .= $OUTPUT->pix_icon('t/down', get_string('movedown')) . " "; } else { $updown .= $spacer; diff --git a/admin/roles/classes/capability_table_with_risks.php b/admin/roles/classes/capability_table_with_risks.php index 96addb533d9..b62ad19c409 100644 --- a/admin/roles/classes/capability_table_with_risks.php +++ b/admin/roles/classes/capability_table_with_risks.php @@ -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 = '' . 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'))); diff --git a/admin/roles/classes/permissions_table.php b/admin/roles/classes/permissions_table.php index 76260c74020..80e4b2067ce 100644 --- a/admin/roles/classes/permissions_table.php +++ b/admin/roles/classes/permissions_table.php @@ -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); } diff --git a/admin/roles/manage.php b/admin/roles/manage.php index d5a95320c3c..fb390eae1c4 100644 --- a/admin/roles/manage.php +++ b/admin/roles/manage.php @@ -216,9 +216,9 @@ die; function get_action_icon($url, $icon, $alt, $tooltip) { global $OUTPUT; return '' . - '' . $alt . ' '; + $OUTPUT->pix_icon('t/' . $icon, $alt) . ' '; } function get_spacer() { global $OUTPUT; - return ' '; + return $OUTPUT->spacer(); } diff --git a/admin/roles/usersroles.php b/admin/roles/usersroles.php index 4a301b1a582..5e871e6198b 100644 --- a/admin/roles/usersroles.php +++ b/admin/roles/usersroles.php @@ -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 ' ' . $stredit . ' '; - echo ' ' . $strcheckpermissions . ' '; + echo ' ' . $OUTPUT->pix_icon('t/edit', 'core', $stredit) . ' '; + echo ' ' . $OUTPUT->pix_icon('t/preview', 'core', $strcheckpermissions) . ' '; echo "

\n"; } } diff --git a/admin/tool/availabilityconditions/index.php b/admin/tool/availabilityconditions/index.php index 485fc23f6ef..f76754ea95d 100644 --- a/admin/tool/availabilityconditions/index.php +++ b/admin/tool/availabilityconditions/index.php @@ -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)); } diff --git a/admin/tool/log/classes/setting_managestores.php b/admin/tool/log/classes/setting_managestores.php index 4161a5770cd..bc38e6379cc 100644 --- a/admin/tool/log/classes/setting_managestores.php +++ b/admin/tool/log/classes/setting_managestores.php @@ -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 = ""; - $hideshow .= "pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"$strdisable\" />"; + $hideshow .= $OUTPUT->pix_icon('t/hide', $strdisable) . ''; $isenabled = true; $displayname = "$name"; } else { if (isset($available[$store])) { $aurl = new moodle_url($url, array('action' => 'enable', 'store' => $store)); $hideshow = ""; - $hideshow .= "pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strenable\" />"; + $hideshow .= $OUTPUT->pix_icon('t/show', $strenable) . ''; $isenabled = false; $displayname = "$name"; } 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 .= ""; - $updown .= "pix_url('t/up') . "\" alt=\"$strup\" class=\"iconsmall\" /> "; + $updown .= $OUTPUT->pix_icon('t/up', $strup) . ' '; } else { - $updown .= "pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" /> "; + $updown .= $OUTPUT->spacer(); } if ($updowncount < $storecount) { $aurl = new moodle_url($url, array('action' => 'down', 'store' => $store)); $updown .= ""; - $updown .= "pix_url('t/down') . "\" alt=\"$strdown\" class=\"iconsmall\" />"; + $updown .= $OUTPUT->pix_icon('t/down', $strdown) . ' '; } else { - $updown .= "pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" />"; + $updown .= $OUTPUT->spacer(); } ++$updowncount; } diff --git a/admin/tool/lp/templates/comment_area.mustache b/admin/tool/lp/templates/comment_area.mustache index 19f8fdb3a65..dbe63e528e3 100644 --- a/admin/tool/lp/templates/comment_area.mustache +++ b/admin/tool/lp/templates/comment_area.mustache @@ -55,7 +55,7 @@
{{^notoggle}} - {{linktext}}{{linktext}} + {{#pix}}{{collapsediconkey}}, {{linktext}}{{/pix}}{{linktext}} {{#displaytotalcount}} ({{count}}) {{/displaytotalcount}} diff --git a/admin/tool/lp/templates/user_evidence_list_page.mustache b/admin/tool/lp/templates/user_evidence_list_page.mustache index 16ae1b77211..61af55ac648 100644 --- a/admin/tool/lp/templates/user_evidence_list_page.mustache +++ b/admin/tool/lp/templates/user_evidence_list_page.mustache @@ -64,7 +64,7 @@
  • {{#pix}}url, tool_lp{{/pix}} {{urlshort}}
  • {{/url}} {{#files}} -
  • {{filenameshort}}
  • +
  • {{#pix}}{{icon}}{{/pix}} {{filenameshort}}
  • {{/files}} {{/hasurlorfiles}} diff --git a/admin/tool/lp/templates/user_evidence_page.mustache b/admin/tool/lp/templates/user_evidence_page.mustache index fca37233332..4843cad18bb 100644 --- a/admin/tool/lp/templates/user_evidence_page.mustache +++ b/admin/tool/lp/templates/user_evidence_page.mustache @@ -57,7 +57,7 @@
  • {{#pix}}url, tool_lp{{/pix}} {{urlshort}}
  • {{/url}} {{#files}} -
  • {{filename}}
  • +
  • {{#pix}}{{icon}}{{/pix}} {{filename}}
  • {{/files}}
    diff --git a/admin/tool/recyclebin/index.php b/admin/tool/recyclebin/index.php index 42a3f5a18c8..ce2cc0a8a89 100644 --- a/admin/tool/recyclebin/index.php +++ b/admin/tool/recyclebin/index.php @@ -187,7 +187,7 @@ foreach ($items as $item) { if (isset($modules[$item->module])) { $mod = $modules[$item->module]; $modname = get_string('modulename', $mod->name); - $name = '' . $modname . ' ' . $name; + $name = $OUTPUT->activity_icon('icon', $modname, $mod->name) . $name; } } diff --git a/admin/tool/unsuproles/index.php b/admin/tool/unsuproles/index.php index 8248e27a8af..93e3bbd7792 100644 --- a/admin/tool/unsuproles/index.php +++ b/admin/tool/unsuproles/index.php @@ -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(' ', $edit)); } $table = new html_table(); @@ -116,4 +116,4 @@ if (!$problems) { echo html_writer::table($table); } -echo $OUTPUT->footer(); \ No newline at end of file +echo $OUTPUT->footer(); diff --git a/admin/tool/usertours/classes/manager.php b/admin/tool/usertours/classes/manager.php index 2a9c8ce39bc..b481d2bbce6 100644 --- a/admin/tool/usertours/classes/manager.php +++ b/admin/tool/usertours/classes/manager.php @@ -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'); diff --git a/admin/user.php b/admin/user.php index 42665249adc..b4e14ca4fce 100644 --- a/admin/user.php +++ b/admin/user.php @@ -187,7 +187,7 @@ } else { $columnicon = ($dir == "ASC") ? "sort_asc" : "sort_desc"; } - $columnicon = "pix_url('t/' . $columnicon) . "\" alt=\"\" />"; + $columnicon = $OUTPUT->pix_icon('t/' . $columnicon, '', 'core', ['class' => 'iconsort']); } $$column = "".$string[$column]."$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)); } } diff --git a/admin/user/user_bulk_cohortadd.php b/admin/user/user_bulk_cohortadd.php index 7e2d4c53365..c2bbd7aea9b 100644 --- a/admin/user/user_bulk_cohortadd.php +++ b/admin/user/user_bulk_cohortadd.php @@ -113,7 +113,13 @@ foreach ($columns as $column) { $columndir = 'asc'; } else { $columndir = ($dir == 'asc') ? 'desc' : 'asc'; - $columnicon = ' '; + $icon = 't/down'; + $iconstr = 'movedown'; + if ($dir != 'asc') { + $icon = 't/up'; + $iconstr = 'moveup'; + } + $columnicon = ' ' . $OUTPUT->pix_icon($icon, get_string($iconstr)); } $table->head[] = ''.$strtitle.''.$columnicon; $table->align[] = 'left'; diff --git a/admin/user/user_bulk_display.php b/admin/user/user_bulk_display.php index 44259dfd079..3ca89227db2 100644 --- a/admin/user/user_bulk_display.php +++ b/admin/user/user_bulk_display.php @@ -57,7 +57,13 @@ foreach ($columns as $column) { $columndir = 'asc'; } else { $columndir = $dir == 'asc' ? 'desc' : 'asc'; - $columnicon = ' '; + $icon = 't/down'; + $iconstr = 'movedown'; + if ($dir != 'asc') { + $icon = 't/up'; + $iconstr = 'moveup'; + } + $columnicon = ' ' . $OUTPUT->pix_icon($icon, get_string($iconstr)); } $table->head[] = ''.$strtitle.''.$columnicon; $table->align[] = 'left'; diff --git a/blocks/activity_modules/block_activity_modules.php b/blocks/activity_modules/block_activity_modules.php index 37736a5eda9..3b8268c4285 100644 --- a/blocks/activity_modules/block_activity_modules.php +++ b/blocks/activity_modules/block_activity_modules.php @@ -78,7 +78,7 @@ class block_activity_modules extends block_list { $icon = $OUTPUT->pix_icon('icon', '', 'mod_page', array('class' => 'icon')); $this->content->items[] = ''.$icon.$modfullname.''; } else { - $icon = ''; + $icon = $OUTPUT->activity_icon('icon', get_string('pluginname', $modname), $modname); $this->content->items[] = ''.$icon.$modfullname.''; } } diff --git a/blocks/community/block_community.php b/blocks/community/block_community.php index ecfa3b9a0d7..fc345caa521 100644 --- a/blocks/community/block_community.php +++ b/blocks/community/block_community.php @@ -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, diff --git a/blocks/course_list/block_course_list.php b/blocks/course_list/block_course_list.php index df725de0848..36003f7f3af 100644 --- a/blocks/course_list/block_course_list.php +++ b/blocks/course_list/block_course_list.php @@ -46,7 +46,7 @@ class block_course_list extends block_list { $this->content->icons = array(); $this->content->footer = ''; - $icon = ''; + $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 = ''; + $icon = $OUTPUT->pix_icon('i/mnethost', get_string('host', 'mnet')); // shortcut - the rest is only for logged in users! if (!isloggedin() || isguestuser()) { diff --git a/blocks/course_overview/renderer.php b/blocks/course_overview/renderer.php index 206f575fc95..14f5e17bf00 100644 --- a/blocks/course_overview/renderer.php +++ b/blocks/course_overview/renderer.php @@ -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')); } diff --git a/blocks/feedback/block_feedback.php b/blocks/feedback/block_feedback.php index add5034ef24..52cc19a8fd6 100644 --- a/blocks/feedback/block_feedback.php +++ b/blocks/feedback/block_feedback.php @@ -53,8 +53,7 @@ class block_feedback extends block_list { $courseid = SITEID; } - $icon = ''; - + $icon = $OUTPUT->activity_icon('icon', get_string('pluginname', 'mod_feedback'), 'mod_feedback'); if (empty($this->instance->pageid)) { $this->instance->pageid = SITEID; diff --git a/blocks/messages/block_messages.php b/blocks/messages/block_messages.php index f0ed9b2d1f4..79d74b87648 100644 --- a/blocks/messages/block_messages.php +++ b/blocks/messages/block_messages.php @@ -74,7 +74,7 @@ class block_messages extends block_base { $this->content->text .= fullname($user).''; $link = '/message/index.php?usergroup=unread&id='.$user->id; - $anchortagcontents = ' '.$user->count; + $anchortagcontents = $OUTPUT->pix_icon('t/message', fullname($user)) . ' ' . $user->count; $action = null; // popup is gone now $anchortag = $OUTPUT->action_link($link, $anchortagcontents, $action); diff --git a/blocks/mnet_hosts/block_mnet_hosts.php b/blocks/mnet_hosts/block_mnet_hosts.php index 4932b919bd6..4d0431b8087 100644 --- a/blocks/mnet_hosts/block_mnet_hosts.php +++ b/blocks/mnet_hosts/block_mnet_hosts.php @@ -139,8 +139,7 @@ class block_mnet_hosts extends block_list { if ($hosts) { foreach ($hosts as $host) { - $icon = ''.get_string('server', 'block_mnet_hosts').' '; + $icon = $OUTPUT->pix_icon('i/'.$host->application.'_host', get_string('server', 'block_mnet_hosts')) . ' '; if ($host->id == $USER->mnethostid) { $this->content->items[]="name). diff --git a/blocks/online_users/block_online_users.php b/blocks/online_users/block_online_users.php index 9b2e19e3749..1a41395f1ed 100644 --- a/blocks/online_users/block_online_users.php +++ b/blocks/online_users/block_online_users.php @@ -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.''; } if ($canshowicon and ($USER->id != $user->id) and !isguestuser($user)) { // Only when logged in and messaging active etc - $anchortagcontents = ''. 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'))); diff --git a/blocks/participants/block_participants.php b/blocks/participants/block_participants.php index 3cc6a8b9db5..f8214df4592 100644 --- a/blocks/participants/block_participants.php +++ b/blocks/participants/block_participants.php @@ -59,7 +59,7 @@ class block_participants extends block_list { } } - $icon = ''; + $icon = $OUTPUT->pix_icon('i/users', ''); $this->content->items[] = ''.$icon.get_string('participants').''; diff --git a/blocks/site_main_menu/block_site_main_menu.php b/blocks/site_main_menu/block_site_main_menu.php index 60b20a3f0bf..c5a692fa468 100644 --- a/blocks/site_main_menu/block_site_main_menu.php +++ b/blocks/site_main_menu/block_site_main_menu.php @@ -96,7 +96,7 @@ class block_site_main_menu extends block_list { } if ($ismoving) { - $this->content->icons[] = ''; + $this->content->icons[] = $OUTPUT->pix_icon('t/move', get_string('move')); $this->content->items[] = $USER->activitycopyname.' ('.$strcancel.')'; } @@ -129,7 +129,7 @@ class block_site_main_menu extends block_list { continue; } $this->content->items[] = ''. - ''.$strmovehere.''; + ''.$strmovehere.''; $this->content->icons[] = ''; } if ($mod->indent > 0) { @@ -149,7 +149,7 @@ class block_site_main_menu extends block_list { if ($ismoving) { $this->content->items[] = ''. - ''.$strmovehere.''; + ''.$strmovehere.''; $this->content->icons[] = ''; } diff --git a/blocks/social_activities/block_social_activities.php b/blocks/social_activities/block_social_activities.php index 63e9cbbc374..2e5ec902fd9 100644 --- a/blocks/social_activities/block_social_activities.php +++ b/blocks/social_activities/block_social_activities.php @@ -91,7 +91,7 @@ class block_social_activities extends block_list { } if ($ismoving) { - $this->content->icons[] = ' '; + $this->content->icons[] = ' ' . $OUTPUT->pix_icon('t/move', get_string('move')); $this->content->items[] = $USER->activitycopyname.' ('.$strcancel.')'; } @@ -124,7 +124,7 @@ class block_social_activities extends block_list { continue; } $this->content->items[] = ''. - ''.$strmovehere.''; + ''.$strmovehere.''; $this->content->icons[] = ''; } if (!$mod->url) { @@ -141,7 +141,7 @@ class block_social_activities extends block_list { if ($ismoving) { $this->content->items[] = ''. - ''.$strmovehere.''; + ''.$strmovehere.''; $this->content->icons[] = ''; } diff --git a/calendar/lib.php b/calendar/lib.php index 018ffd79ef7..583419da922 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -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 = ''.$eventtype.''; $event->referer = ''.$event->name.''; $event->courselink = calendar_get_courselink($module->course); $event->cmid = $module->id; } else if($event->courseid == SITEID) { // Site event - $event->icon = ''.get_string('globalevent', 'calendar').''; + $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 = ''.get_string('courseevent', 'calendar').''; + $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 = ''.get_string('userevent', 'calendar').''; + $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; -} \ No newline at end of file +} diff --git a/calendar/renderer.php b/calendar/renderer.php index 40530a16749..c68ca73608b 100644 --- a/calendar/renderer.php +++ b/calendar/renderer.php @@ -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'); diff --git a/cohort/index.php b/cohort/index.php index da05664868c..42db1288bd3 100644 --- a/cohort/index.php +++ b/cohort/index.php @@ -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; } diff --git a/comment/classes/external/comment_area_exporter.php b/comment/classes/external/comment_area_exporter.php index 9a5e106c362..1b14fcab7c7 100644 --- a/comment/classes/external/comment_area_exporter.php +++ b/comment/classes/external/comment_area_exporter.php @@ -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(); diff --git a/comment/comment.js b/comment/comment.js index d93a357245a..eda542f3536 100644 --- a/comment/comment.js +++ b/comment/comment.js @@ -200,7 +200,7 @@ M.core_comment = { list[i].content = '
    ' + '' + - '' + deleteStr + '' + + '' + '' + '
    ' + 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',''); } diff --git a/comment/lib.php b/comment/lib.php index 1a770f8b450..fef135bf103 100644 --- a/comment/lib.php +++ b/comment/lib.php @@ -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'); } diff --git a/course/format/renderer.php b/course/format/renderer.php index c9237eb6df6..b9b06417e1e 100644 --- a/course/format/renderer.php +++ b/course/format/renderer.php @@ -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); } diff --git a/course/format/social/format.php b/course/format/social/format.php index f9cb7228c01..4fcd31398d4 100644 --- a/course/format/social/format.php +++ b/course/format/social/format.php @@ -23,8 +23,7 @@ $streditsummary = get_string('editsummary'); $introcontent .= ''; + $OUTPUT->pix_icon('t/edit', $streditsummary) . ''; } echo $OUTPUT->box($introcontent, 'generalbox', 'intro'); } diff --git a/course/renderer.php b/course/renderer.php index 6a6c10047e2..dd5307073d7 100644 --- a/course/renderer.php +++ b/course/renderer.php @@ -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(); diff --git a/enrol/instances.php b/enrol/instances.php index 546da9d3d4d..2c11f49376c 100644 --- a/enrol/instances.php +++ b/enrol/instances.php @@ -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')); } } diff --git a/enrol/renderer.php b/enrol/renderer.php index 2e867ab99fc..a283de891f1 100644 --- a/enrol/renderer.php +++ b/enrol/renderer.php @@ -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')); } } diff --git a/files/classes/external/stored_file_exporter.php b/files/classes/external/stored_file_exporter.php index 5e88fd6838b..93fce21ede6 100644 --- a/files/classes/external/stored_file_exporter.php +++ b/files/classes/external/stored_file_exporter.php @@ -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()), diff --git a/files/renderer.php b/files/renderer.php index 46324fcd64e..020c24d0baa 100644 --- a/files/renderer.php +++ b/files/renderer.php @@ -204,30 +204,32 @@ class core_files_renderer extends plugin_renderer_base {
    - ' . $straddfiletext . ' + ' . $this->pix_icon('a/add_file', $straddfiletext) . '
    - ' . $strcreatefolder . ' + ' . $this->pix_icon('a/create_folder', $strcreatefolder) . '
    - ' . $strdownloadallfiles . ' + ' . $this->pix_icon('a/download_all', $strdownloadallfiles) . '
    - + + ' . $this->pix_icon('i/loading_small', '') . ' +
    - '. get_string('displayasicons', 'repository') .' + ' . $this->pix_icon('fp/view_icon_active', get_string('displayasicons', 'repository'), 'theme') . ' - '. get_string('displayasdetails', 'repository') .' + ' . $this->pix_icon('fp/view_list_active', get_string('displayasdetails', 'repository'), 'theme') . ' - '. get_string('displayastree', 'repository') .' + ' . $this->pix_icon('fp/view_tree_active', get_string('displayastree', 'repository'), 'theme') . '
    @@ -393,7 +395,7 @@ class core_files_renderer extends plugin_renderer_base { $rv = '
    - + ' . $this->pix_icon('i/loading_small', '') . '
    @@ -590,35 +592,35 @@ class core_files_renderer extends plugin_renderer_base {
    - + ' . $this->pix_icon('a/refresh', '') . '
    - + ' . $this->pix_icon('a/logout', '') . '
    - + ' . $this->pix_icon('a/setting', '') . '
    - + ' . $this->pix_icon('a/help', '') . '
    - + ' . $this->pix_icon('fp/view_icon_active', '', 'theme') . ' - + ' . $this->pix_icon('fp/view_list_active', '', 'theme') . ' - + ' . $this->pix_icon('fp/view_tree_active', '', 'theme') . '
    @@ -710,7 +712,7 @@ class core_files_renderer extends plugin_renderer_base {
    - + ' . $this->pix_icon('i/loading_small', '') . '
    '; return $rv; @@ -748,7 +750,7 @@ class core_files_renderer extends plugin_renderer_base { $rv = '
    - + ' . $this->pix_icon('i/loading_small', '') . '
    @@ -877,7 +879,7 @@ class core_files_renderer extends plugin_renderer_base { return '
    - + ' . $this->pix_icon('i/loading_small', '') . '
    '; } diff --git a/filter/glossary/yui/build/moodle-filter_glossary-autolinker/moodle-filter_glossary-autolinker-debug.js b/filter/glossary/yui/build/moodle-filter_glossary-autolinker/moodle-filter_glossary-autolinker-debug.js index 1f36fe30e5f..81f03933b08 100644 --- a/filter/glossary/yui/build/moodle-filter_glossary-autolinker/moodle-filter_glossary-autolinker-debug.js +++ b/filter/glossary/yui/build/moodle-filter_glossary-autolinker/moodle-filter_glossary-autolinker-debug.js @@ -29,7 +29,6 @@ Y.extend(AUTOLINKER, Y.Base, { // display a progress indicator var title = '', content = Y.Node.create('
    ' + - '' + '
    '), 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)); diff --git a/filter/glossary/yui/build/moodle-filter_glossary-autolinker/moodle-filter_glossary-autolinker-min.js b/filter/glossary/yui/build/moodle-filter_glossary-autolinker/moodle-filter_glossary-autolinker-min.js index c2fdc14318e..c0608af5ced 100644 --- a/filter/glossary/yui/build/moodle-filter_glossary-autolinker/moodle-filter_glossary-autolinker-min.js +++ b/filter/glossary/yui/build/moodle-filter_glossary-autolinker/moodle-filter_glossary-autolinker-min.js @@ -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('
    '+"
    "),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('
    '),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"]}); diff --git a/filter/glossary/yui/build/moodle-filter_glossary-autolinker/moodle-filter_glossary-autolinker.js b/filter/glossary/yui/build/moodle-filter_glossary-autolinker/moodle-filter_glossary-autolinker.js index 1f36fe30e5f..81f03933b08 100644 --- a/filter/glossary/yui/build/moodle-filter_glossary-autolinker/moodle-filter_glossary-autolinker.js +++ b/filter/glossary/yui/build/moodle-filter_glossary-autolinker/moodle-filter_glossary-autolinker.js @@ -29,7 +29,6 @@ Y.extend(AUTOLINKER, Y.Base, { // display a progress indicator var title = '', content = Y.Node.create('
    ' + - '' + '
    '), 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)); diff --git a/filter/glossary/yui/src/autolinker/js/autolinker.js b/filter/glossary/yui/src/autolinker/js/autolinker.js index 564c6ee3b43..8aea8fdfa41 100644 --- a/filter/glossary/yui/src/autolinker/js/autolinker.js +++ b/filter/glossary/yui/src/autolinker/js/autolinker.js @@ -27,7 +27,6 @@ Y.extend(AUTOLINKER, Y.Base, { // display a progress indicator var title = '', content = Y.Node.create('
    ' + - '' + '
    '), 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)); diff --git a/grade/grading/renderer.php b/grade/grading/renderer.php index 562406141ab..de6adabc6a6 100644 --- a/grade/grading/renderer.php +++ b/grade/grading/renderer.php @@ -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)); } diff --git a/grade/report/grader/lib.php b/grade/report/grader/lib.php index 8d7eb1391ce..b69e31022ac 100644 --- a/grade/report/grader/lib.php +++ b/grade/report/grader/lib.php @@ -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; diff --git a/index.php b/index.php index 0c9e490d2ac..a07a735b742 100644 --- a/index.php +++ b/index.php @@ -169,9 +169,9 @@ if (!empty($CFG->customfrontpageinclude)) { if ($editing && has_capability('moodle/course:update', $context)) { $streditsummary = get_string('editsummary'); - echo "id\">pix_url('t/edit') . "\" ". - " class=\"iconsmall\" alt=\"$streditsummary\" />

    "; + echo "id\">" . $OUTPUT->pix_icon('t/edit', $streditsummary) . + "

    "; } $courserenderer = $PAGE->get_renderer('core', 'course'); diff --git a/lib/adminlib.php b/lib/adminlib.php index 28aafd6ce96..81d6d2b16b5 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -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 = ""; - $hideshow .= "pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"$strdisable\" />"; + $hideshow .= $OUTPUT->pix_icon('t/hide', $strdisable) . ''; $enabled = true; $displayname = $name; } else if (isset($enrols_available[$enrol])) { $aurl = new moodle_url($url, array('action'=>'enable', 'enrol'=>$enrol)); $hideshow = ""; - $hideshow .= "pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strenable\" />"; + $hideshow .= $OUTPUT->pix_icon('t/show', $strenable) . ''; $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 .= ""; - $updown .= "pix_url('t/up') . "\" alt=\"$strup\" class=\"iconsmall\" /> "; + $updown .= $OUTPUT->pix_icon('t/up', $strup) . ' '; } else { - $updown .= "pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" /> "; + $updown .= $OUTPUT->spacer() . ' '; } if ($updowncount < $enrolcount) { $aurl = new moodle_url($url, array('action'=>'down', 'enrol'=>$enrol)); $updown .= ""; - $updown .= "pix_url('t/down') . "\" alt=\"$strdown\" class=\"iconsmall\" />"; + $updown .= $OUTPUT->pix_icon('t/down', $strdown) . ' '; } else { - $updown .= "pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" />"; + $updown .= $OUTPUT->spacer() . ' '; } ++$updowncount; } @@ -6508,15 +6508,13 @@ class admin_setting_manageauths extends admin_setting { // hide/show link if (in_array($auth, $authsenabled)) { $hideshow = ""; - $hideshow .= "pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"disable\" />"; - // $hideshow = ""; + $hideshow .= $OUTPUT->pix_icon('t/hide', get_string('disable')) . ''; $enabled = true; $displayname = $name; } else { $hideshow = ""; - $hideshow .= "pix_url('t/show') . "\" class=\"iconsmall\" alt=\"enable\" />"; - // $hideshow = ""; + $hideshow .= $OUTPUT->pix_icon('t/show', get_string('enable')) . ''; $enabled = false; $displayname = $name; $class = 'dimmed_text'; @@ -6529,17 +6527,17 @@ class admin_setting_manageauths extends admin_setting { if ($enabled) { if ($updowncount > 1) { $updown .= ""; - $updown .= "pix_url('t/up') . "\" alt=\"up\" class=\"iconsmall\" /> "; + $updown .= $OUTPUT->pix_icon('t/up', get_string('moveup')) . ' '; } else { - $updown .= "pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" /> "; + $updown .= $OUTPUT->spacer() . ' '; } if ($updowncount < $authcount) { $updown .= ""; - $updown .= "pix_url('t/down') . "\" alt=\"down\" class=\"iconsmall\" />"; + $updown .= $OUTPUT->pix_icon('t/down', get_string('movedown')) . ' '; } else { - $updown .= "pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" />"; + $updown .= $OUTPUT->spacer() . ' '; } ++ $updowncount; } @@ -6696,15 +6694,13 @@ class admin_setting_manageeditors extends admin_setting { $class = ''; if (in_array($editor, $active_editors)) { $hideshow = ""; - $hideshow .= "pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"disable\" />"; - // $hideshow = ""; + $hideshow .= $OUTPUT->pix_icon('t/hide', get_string('disable')) . ''; $enabled = true; $displayname = $name; } else { $hideshow = ""; - $hideshow .= "pix_url('t/show') . "\" class=\"iconsmall\" alt=\"enable\" />"; - // $hideshow = ""; + $hideshow .= $OUTPUT->pix_icon('t/show', get_string('enable')) . ''; $enabled = false; $displayname = $name; $class = 'dimmed_text'; @@ -6715,17 +6711,17 @@ class admin_setting_manageeditors extends admin_setting { if ($enabled) { if ($updowncount > 1) { $updown .= ""; - $updown .= "pix_url('t/up') . "\" alt=\"up\" class=\"iconsmall\" /> "; + $updown .= $OUTPUT->pix_icon('t/up', get_string('moveup')) . ' '; } else { - $updown .= "pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" /> "; + $updown .= $OUTPUT->spacer() . ' '; } if ($updowncount < $editorcount) { $updown .= ""; - $updown .= "pix_url('t/down') . "\" alt=\"down\" class=\"iconsmall\" />"; + $updown .= $OUTPUT->pix_icon('t/down', get_string('movedown')) . ' '; } else { - $updown .= "pix_url('spacer') . "\" class=\"iconsmall\" alt=\"\" />"; + $updown .= $OUTPUT->spacer() . ' '; } ++ $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 .= "baseurl&action=moveup&repos=".$typename."\">"; - $updown .= "pix_url('t/up') . "\" alt=\"up\" class=\"iconsmall\" /> "; + $updown .= $OUTPUT->pix_icon('t/up', get_string('moveup')) . ' '; } else { $updown .= $spacer; } if ($updowncount < $totalrepositorytypes) { $updown .= "baseurl&action=movedown&repos=".$typename."\">"; - $updown .= "pix_url('t/down') . "\" alt=\"down\" class=\"iconsmall\" />"; + $updown .= $OUTPUT->pix_icon('t/down', get_string('movedown')) . ' '; } else { $updown .= $spacer; @@ -9424,11 +9420,11 @@ class admin_setting_managewebserviceprotocols extends admin_setting { // hide/show link if (in_array($protocol, $active_protocols)) { $hideshow = ""; - $hideshow .= "pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"$strdisable\" />"; + $hideshow .= $OUTPUT->pix_icon('t/hide', $strdisable) . ''; $displayname = "$name"; } else { $hideshow = ""; - $hideshow .= "pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strenable\" />"; + $hideshow .= $OUTPUT->pix_icon('t/show', $strenable) . ''; $displayname = "$name"; } diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index 55124fb8317..84068b03c4a 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -1077,7 +1077,7 @@ function print_arrow($direction='up', $strsort=null, $return=false) { $strsort = get_string('sort' . $sortdir, 'grades'); } - $return = ' '.$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 = ''.$safealttext.''; + $img = $OUTPUT->pix_icon($iconpath, $safealttext); } $output = ''. @@ -5116,9 +5116,9 @@ function message_history_link($userid1, $userid2, $return=false, $keywords='', $ } if ($linktext == 'icon') { // Icon only - $fulllink = ''.$strmessagehistory.''; + $fulllink = $OUTPUT->pix_icon('t/messages', $strmessagehistory); } else if ($linktext == 'both') { // Icon and standard name - $fulllink = ''; + $fulllink = $OUTPUT->pix_icon('t/messages', ''); $fulllink .= ' '.$strmessagehistory; } else if ($linktext) { // Custom name $fulllink = $linktext; diff --git a/lib/editor/tinymce/adminlib.php b/lib/editor/tinymce/adminlib.php index 684a9140faa..181e53b4e76 100644 --- a/lib/editor/tinymce/adminlib.php +++ b/lib/editor/tinymce/adminlib.php @@ -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'; diff --git a/lib/filelib.php b/lib/filelib.php index bebbe77eee1..f9ddae50c14 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -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: * * // $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))); * * or @@ -1557,12 +1558,12 @@ function file_file_icon($file, $size = null) { * * Usage: * - * $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)); * * or * - * echo $OUTPUT->pix_icon(file_folder_icon(32)); + * echo $OUTPUT->pix_icon(file_folder_icon(32), ''); * * * @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. * * * $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))); * * @@ -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. * * * $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' => '...')); * * @@ -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')) { diff --git a/lib/formslib.php b/lib/formslib.php index a4bdf528472..d13625cd20f 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -1486,8 +1486,8 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless { }else { $this->updateAttributes(array('class'=>'mform')); } - $this->_reqHTML = ''.get_string('requiredelement', 'form').''; - $this->_advancedHTML = ''.get_string('advancedelement', 'form').''; + $this->_reqHTML = '' . $OUTPUT->pix_icon('req', get_string('requiredelement', 'form')) . ''; + $this->_advancedHTML = '' . $OUTPUT->pix_icon('adv', get_string('advancedelement', 'form')) . ''; $this->setRequiredNote(get_string('somefieldsrequired', 'form', $OUTPUT->pix_icon('req', get_string('requiredelement', 'form')))); } diff --git a/lib/googleapi.php b/lib/googleapi.php index 1c2be1d99f9..3d2a3fe8523 100644 --- a/lib/googleapi.php +++ b/lib/googleapi.php @@ -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(); diff --git a/lib/listlib.php b/lib/listlib.php index 9cc815b1107..354c38fbb96 100644 --- a/lib/listlib.php +++ b/lib/listlib.php @@ -594,13 +594,13 @@ abstract class list_item { public function image_icon($action, $url, $icon) { global $OUTPUT; - return ' - ' . s($action). ' '; + return '' . + $OUTPUT->pix_icon('t/' . $icon, $action) . ' '; } public function image_spacer() { global $OUTPUT; - return ''; + return $OUTPUT->spacer(); } /** diff --git a/lib/modinfolib.php b/lib/modinfolib.php index f6f9a13428c..f8a06616dc2 100644 --- a/lib/modinfolib.php +++ b/lib/modinfolib.php @@ -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; diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index 6f93fa52fb9..9ed4ac816ac 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -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(); diff --git a/lib/outputlib.php b/lib/outputlib.php index 169c3ec761d..db753acb1e6 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -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); diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 0be6043ca77..94df7fdda62 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -955,13 +955,13 @@ class core_renderer extends renderer_base { // Special case for site home page - please do not remove return ''; + ''.get_string('moodlelogo').'
    '; } else if (!empty($CFG->target_release) && $CFG->target_release != $CFG->release) { // Special case for during install/upgrade. return ''; + ''.get_string('moodlelogo').'
    '; } else if ($this->page->course->id == $SITE->id || strpos($this->page->pagetype, 'course-view') === 0) { return '