Commit 6b608f8f authored by tjhunt's avatar tjhunt
Browse files

MDL-19690 - lots more $CFG->pixpath to $OUTPUT->old_icon_url

parent 5d3b9994
...@@ -182,10 +182,10 @@ ...@@ -182,10 +182,10 @@
if ($blocks[$blockid]->visible) { if ($blocks[$blockid]->visible) {
$visible = '<a href="blocks.php?hide='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strhide.'">'. $visible = '<a href="blocks.php?hide='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strhide.'">'.
'<img src="'.$CFG->pixpath.'/i/hide.gif" class="icon" alt="'.$strhide.'" /></a>'; '<img src="'.$OUTPUT->old_icon_url('i/hide') . '" class="icon" alt="'.$strhide.'" /></a>';
} else { } else {
$visible = '<a href="blocks.php?show='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strshow.'">'. $visible = '<a href="blocks.php?show='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strshow.'">'.
'<img src="'.$CFG->pixpath.'/i/show.gif" class="icon" alt="'.$strshow.'" /></a>'; '<img src="'.$OUTPUT->old_icon_url('i/show') . '" class="icon" alt="'.$strshow.'" /></a>';
$class = ' class="dimmed_text"'; // Leading space required! $class = ' class="dimmed_text"'; // Leading space required!
} }
if ($blockobject->instance_allow_multiple()) { if ($blockobject->instance_allow_multiple()) {
......
...@@ -608,9 +608,9 @@ ...@@ -608,9 +608,9 @@
if (LANG_DISPLAY_MISSING_LINKS) { if (LANG_DISPLAY_MISSING_LINKS) {
$missingtarget = '<a name="missing'.$missingcounter.'"></a>'; $missingtarget = '<a name="missing'.$missingcounter.'"></a>';
$missingnext = '<a href="#missing'.($missingcounter+1).'">'. $missingnext = '<a href="#missing'.($missingcounter+1).'">'.
'<img src="' . $CFG->pixpath . '/t/down.gif" class="iconsmall" alt="'.$strnext.'" /></a>'; '<img src="' . $OUTPUT->old_icon_url('t/down') . '" class="iconsmall" alt="'.$strnext.'" /></a>';
$missingprev = '<a href="#missing'.($missingcounter-1).'">'. $missingprev = '<a href="#missing'.($missingcounter-1).'">'.
'<img src="' . $CFG->pixpath . '/t/up.gif" class="iconsmall" alt="'.$strprev.'" /></a>'; '<img src="' . $OUTPUT->old_icon_url('t/up') . '" class="iconsmall" alt="'.$strprev.'" /></a>';
} }
} else { } else {
// the string is translated in the pack being processed // the string is translated in the pack being processed
...@@ -621,9 +621,9 @@ ...@@ -621,9 +621,9 @@
if (LANG_DISPLAY_MISSING_LINKS) { if (LANG_DISPLAY_MISSING_LINKS) {
$missingtarget = '<a name="missing'.$missingcounter.'"></a>'; $missingtarget = '<a name="missing'.$missingcounter.'"></a>';
$missingnext = '<a href="#missing'.($missingcounter+1).'">'. $missingnext = '<a href="#missing'.($missingcounter+1).'">'.
'<img src="' . $CFG->pixpath . '/t/down.gif" class="iconsmall" alt="'.$strnext.'" /></a>'; '<img src="' . $OUTPUT->old_icon_url('t/down') . '" class="iconsmall" alt="'.$strnext.'" /></a>';
$missingprev = '<a href="#missing'.($missingcounter-1).'">'. $missingprev = '<a href="#missing'.($missingcounter-1).'">'.
'<img src="' . $CFG->pixpath . '/t/up.gif" class="iconsmall" alt="'.$strprev.'" /></a>'; '<img src="' . $OUTPUT->old_icon_url('t/up') . '" class="iconsmall" alt="'.$strprev.'" /></a>';
} }
} }
} }
......
...@@ -159,7 +159,7 @@ print_box_end(); ...@@ -159,7 +159,7 @@ print_box_end();
print_footer($course); print_footer($course);
function print_report_tree($contextid, $contexts, $systemcontext, $fullname) { function print_report_tree($contextid, $contexts, $systemcontext, $fullname) {
global $CFG; global $CFG, $OUTPUT;
// Only compute lang strings, etc once. // Only compute lang strings, etc once.
static $stredit = null, $strcheckpermissions, $globalroleassigner, $assignurl, $checkurl; static $stredit = null, $strcheckpermissions, $globalroleassigner, $assignurl, $checkurl;
...@@ -207,9 +207,9 @@ function print_report_tree($contextid, $contexts, $systemcontext, $fullname) { ...@@ -207,9 +207,9 @@ function print_report_tree($contextid, $contexts, $systemcontext, $fullname) {
$strcheck = get_string('checkuserspermissionshere', 'role', $a); $strcheck = get_string('checkuserspermissionshere', 'role', $a);
} }
echo ' <a title="' . $strgoto . '" href="' . $raurl . '"><img class="iconsmall" src="' . echo ' <a title="' . $strgoto . '" href="' . $raurl . '"><img class="iconsmall" src="' .
$CFG->pixpath . '/t/edit.gif" alt="' . $stredit . '" /></a> '; $OUTPUT->old_icon_url('t/edit') . '" alt="' . $stredit . '" /></a> ';
echo ' <a title="' . $strcheck . '" href="' . $churl . '"><img class="iconsmall" src="' . echo ' <a title="' . $strcheck . '" href="' . $churl . '"><img class="iconsmall" src="' .
$CFG->pixpath . '/t/preview.gif" alt="' . $strcheckpermissions . '" /></a> '; $OUTPUT->old_icon_url('t/preview') . '" alt="' . $strcheckpermissions . '" /></a> ';
echo "</p>\n"; echo "</p>\n";
} }
} }
......
...@@ -7,7 +7,7 @@ class block_admin extends block_list { ...@@ -7,7 +7,7 @@ class block_admin extends block_list {
} }
function get_content() { function get_content() {
global $CFG, $USER, $DB; global $CFG, $USER, $DB, $OUTPUT;
if ($this->content !== NULL) { if ($this->content !== NULL) {
return $this->content; return $this->content;
...@@ -33,7 +33,7 @@ class block_admin extends block_list { ...@@ -33,7 +33,7 @@ class block_admin extends block_list {
/// Course editing on/off /// Course editing on/off
if ($course->id !== SITEID and has_capability('moodle/course:update', $context)) { if ($course->id !== SITEID and has_capability('moodle/course:update', $context)) {
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/edit.gif" class="icon" alt="" />'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/edit') . '" class="icon" alt="" />';
if ($this->page->user_is_editing()) { if ($this->page->user_is_editing()) {
$this->content->items[]='<a href="view.php?id='.$course->id.'&amp;edit=off&amp;sesskey='.sesskey().'">'.get_string('turneditingoff').'</a>'; $this->content->items[]='<a href="view.php?id='.$course->id.'&amp;edit=off&amp;sesskey='.sesskey().'">'.get_string('turneditingoff').'</a>';
} else { } else {
...@@ -41,17 +41,17 @@ class block_admin extends block_list { ...@@ -41,17 +41,17 @@ class block_admin extends block_list {
} }
$this->content->items[]='<a href="'.$CFG->wwwroot.'/course/edit.php?id='.$course->id.'">'.get_string('settings').'</a>'; $this->content->items[]='<a href="'.$CFG->wwwroot.'/course/edit.php?id='.$course->id.'">'.get_string('settings').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/settings.gif" class="icon" alt="" />'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/settings') . '" class="icon" alt="" />';
} }
/// Assign roles to the course /// Assign roles to the course
if ($course->id != SITEID) { if ($course->id != SITEID) {
if (has_capability('moodle/role:assign', $context)) { if (has_capability('moodle/role:assign', $context)) {
$this->content->items[]='<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$context->id.'">'.get_string('assignroles', 'role').'</a>'; $this->content->items[]='<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$context->id.'">'.get_string('assignroles', 'role').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/roles.gif" class="icon" alt="" />'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/roles') . '" class="icon" alt="" />';
} else if (get_overridable_roles($context, ROLENAME_ORIGINAL)) { } else if (get_overridable_roles($context, ROLENAME_ORIGINAL)) {
$this->content->items[]='<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/override.php?contextid='.$context->id.'">'.get_string('overridepermissions', 'role').'</a>'; $this->content->items[]='<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/override.php?contextid='.$context->id.'">'.get_string('overridepermissions', 'role').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/roles.gif" class="icon" alt="" />'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/roles') . '" class="icon" alt="" />';
} }
} }
...@@ -76,7 +76,7 @@ class block_admin extends block_list { ...@@ -76,7 +76,7 @@ class block_admin extends block_list {
if ($reportavailable) { if ($reportavailable) {
$this->content->items[]='<a href="'.$CFG->wwwroot.'/grade/report/index.php?id='.$course->id.'">'.get_string('grades').'</a>'; $this->content->items[]='<a href="'.$CFG->wwwroot.'/grade/report/index.php?id='.$course->id.'">'.get_string('grades').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/grades.gif" class="icon" alt="" />'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/grades') . '" class="icon" alt="" />';
} }
} }
...@@ -84,7 +84,7 @@ class block_admin extends block_list { ...@@ -84,7 +84,7 @@ class block_admin extends block_list {
if (!empty($CFG->enableoutcomes)) { if (!empty($CFG->enableoutcomes)) {
if ($course->id!==SITEID and has_capability('moodle/course:update', $context)) { if ($course->id!==SITEID and has_capability('moodle/course:update', $context)) {
$this->content->items[]='<a href="'.$CFG->wwwroot.'/grade/edit/outcome/course.php?id='.$course->id.'">'.get_string('outcomes', 'grades').'</a>'; $this->content->items[]='<a href="'.$CFG->wwwroot.'/grade/edit/outcome/course.php?id='.$course->id.'">'.get_string('outcomes', 'grades').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/outcomes.gif" class="icon" alt="" />'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/outcomes') . '" class="icon" alt="" />';
} }
} }
...@@ -93,11 +93,11 @@ class block_admin extends block_list { ...@@ -93,11 +93,11 @@ class block_admin extends block_list {
if (has_capability('moodle/course:managemetacourse', $context)) { if (has_capability('moodle/course:managemetacourse', $context)) {
$strchildcourses = get_string('childcourses'); $strchildcourses = get_string('childcourses');
$this->content->items[]='<a href="importstudents.php?id='.$course->id.'">'.$strchildcourses.'</a>'; $this->content->items[]='<a href="importstudents.php?id='.$course->id.'">'.$strchildcourses.'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/course.gif" class="icon" alt="" />'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/course') . '" class="icon" alt="" />';
} else if (has_capability('moodle/role:assign', $context)) { } else if (has_capability('moodle/role:assign', $context)) {
$strchildcourses = get_string('childcourses'); $strchildcourses = get_string('childcourses');
$this->content->items[]='<span class="dimmed_text">'.$strchildcourses.'</span>'; $this->content->items[]='<span class="dimmed_text">'.$strchildcourses.'</span>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/course.gif" class="icon" alt="" />'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/course') . '" class="icon" alt="" />';
} }
} }
...@@ -106,37 +106,37 @@ class block_admin extends block_list { ...@@ -106,37 +106,37 @@ class block_admin extends block_list {
if (($course->id!==SITEID) && ($course->groupmode || !$course->groupmodeforce) && has_capability('moodle/course:managegroups', $context)) { if (($course->id!==SITEID) && ($course->groupmode || !$course->groupmodeforce) && has_capability('moodle/course:managegroups', $context)) {
$strgroups = get_string('groups'); $strgroups = get_string('groups');
$this->content->items[]='<a title="'.$strgroups.'" href="'.$CFG->wwwroot.'/group/index.php?id='.$course->id.'">'.$strgroups.'</a>'; $this->content->items[]='<a title="'.$strgroups.'" href="'.$CFG->wwwroot.'/group/index.php?id='.$course->id.'">'.$strgroups.'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/group.gif" class="icon" alt="" />'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/group') . '" class="icon" alt="" />';
} }
/// Backup this course /// Backup this course
if ($course->id!==SITEID and has_capability('moodle/site:backup', $context)) { if ($course->id!==SITEID and has_capability('moodle/site:backup', $context)) {
$this->content->items[]='<a href="'.$CFG->wwwroot.'/backup/backup.php?id='.$course->id.'">'.get_string('backup').'</a>'; $this->content->items[]='<a href="'.$CFG->wwwroot.'/backup/backup.php?id='.$course->id.'">'.get_string('backup').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/backup.gif" class="icon" alt="" />'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/backup') . '" class="icon" alt="" />';
} }
/// Restore to this course /// Restore to this course
if ($course->id !== SITEID and has_capability('moodle/site:restore', $context)) { if ($course->id !== SITEID and has_capability('moodle/site:restore', $context)) {
$this->content->items[]='<a href="'.$CFG->wwwroot.'/files/index.php?id='.$course->id.'&amp;wdir=/backupdata">'.get_string('restore').'</a>'; $this->content->items[]='<a href="'.$CFG->wwwroot.'/files/index.php?id='.$course->id.'&amp;wdir=/backupdata">'.get_string('restore').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/restore.gif" class="icon" alt="" />'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/restore') . '" class="icon" alt="" />';
} }
/// Import data from other courses /// Import data from other courses
if ($course->id !== SITEID and has_capability('moodle/site:import', $context)) { if ($course->id !== SITEID and has_capability('moodle/site:import', $context)) {
$this->content->items[]='<a href="'.$CFG->wwwroot.'/course/import.php?id='.$course->id.'">'.get_string('import').'</a>'; $this->content->items[]='<a href="'.$CFG->wwwroot.'/course/import.php?id='.$course->id.'">'.get_string('import').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/restore.gif" class="icon" alt="" />'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/restore') . '" class="icon" alt="" />';
} }
/// Reset this course /// Reset this course
if ($course->id!==SITEID and has_capability('moodle/course:reset', $context)) { if ($course->id!==SITEID and has_capability('moodle/course:reset', $context)) {
$this->content->items[]='<a href="'.$CFG->wwwroot.'/course/reset.php?id='.$course->id.'">'.get_string('reset').'</a>'; $this->content->items[]='<a href="'.$CFG->wwwroot.'/course/reset.php?id='.$course->id.'">'.get_string('reset').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/return.gif" class="icon" alt="" />'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/return') . '" class="icon" alt="" />';
} }
/// View course reports /// View course reports
if ($course->id !== SITEID and has_capability('moodle/site:viewreports', $context)) { // basic capability for listing of reports if ($course->id !== SITEID and has_capability('moodle/site:viewreports', $context)) { // basic capability for listing of reports
$this->content->items[]='<a href="'.$CFG->wwwroot.'/course/report.php?id='.$course->id.'">'.get_string('reports').'</a>'; $this->content->items[]='<a href="'.$CFG->wwwroot.'/course/report.php?id='.$course->id.'">'.get_string('reports').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/stats.gif" class="icon" alt="" />'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/stats') . '" class="icon" alt="" />';
} }
/// Manage questions /// Manage questions
...@@ -162,7 +162,7 @@ class block_admin extends block_list { ...@@ -162,7 +162,7 @@ class block_admin extends block_list {
if ($questionlink) { if ($questionlink) {
$this->content->items[]='<a href="'.$CFG->wwwroot.'/question/'.$questionlink. $this->content->items[]='<a href="'.$CFG->wwwroot.'/question/'.$questionlink.
'?courseid='.$course->id.'">'.get_string('questions', 'quiz').'</a>'; '?courseid='.$course->id.'">'.get_string('questions', 'quiz').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/questions.gif" class="icon" alt="" />'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/questions') . '" class="icon" alt="" />';
} }
} }
...@@ -171,13 +171,13 @@ class block_admin extends block_list { ...@@ -171,13 +171,13 @@ class block_admin extends block_list {
$editabletypes = repository::get_editable_types($context); $editabletypes = repository::get_editable_types($context);
if ($course->id !== SITEID && has_capability('moodle/course:update', $context) && !empty($editabletypes)) { if ($course->id !== SITEID && has_capability('moodle/course:update', $context) && !empty($editabletypes)) {
$this->content->items[]='<a href="'.$CFG->wwwroot.'/repository/manage_instances.php?contextid='.$context->id.'">'.get_string('repositories').'</a>'; $this->content->items[]='<a href="'.$CFG->wwwroot.'/repository/manage_instances.php?contextid='.$context->id.'">'.get_string('repositories').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/repository.png" alt=""/>'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/repository') . '" alt=""/>';
} }
/// Manage files /// Manage files
if ($course->id !== SITEID and has_capability('moodle/course:managefiles', $context)) { if ($course->id !== SITEID and has_capability('moodle/course:managefiles', $context)) {
$this->content->items[]='<a href="'.$CFG->wwwroot.'/files/index.php?id='.$course->id.'">'.get_string('files').'</a>'; $this->content->items[]='<a href="'.$CFG->wwwroot.'/files/index.php?id='.$course->id.'">'.get_string('files').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/files.gif" class="icon" alt=""/>'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/files') . '" class="icon" alt=""/>';
} }
/// Authorize hooks /// Authorize hooks
...@@ -190,24 +190,24 @@ class block_admin extends block_list { ...@@ -190,24 +190,24 @@ class block_admin extends block_list {
} }
} }
$this->content->items[] = $paymenturl; $this->content->items[] = $paymenturl;
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/payment.gif" class="icon" alt="" />'; $this->content->icons[] = '<img src="'.$OUTPUT->old_icon_url('i/payment') . '" class="icon" alt="" />';
} }
/// Unenrol link /// Unenrol link
if (empty($course->metacourse) && ($course->id!==SITEID)) { if (empty($course->metacourse) && ($course->id!==SITEID)) {
if (has_capability('moodle/legacy:guest', $context, NULL, false)) { // Are a guest now if (has_capability('moodle/legacy:guest', $context, NULL, false)) { // Are a guest now
$this->content->items[]='<a href="'.$CFG->wwwroot.'/course/enrol.php?id='.$course->id.'">'.get_string('enrolme', '', format_string($course->shortname)).'</a>'; $this->content->items[]='<a href="'.$CFG->wwwroot.'/course/enrol.php?id='.$course->id.'">'.get_string('enrolme', '', format_string($course->shortname)).'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" class="icon" alt="" />'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/user') . '" class="icon" alt="" />';
} else if (has_capability('moodle/role:unassignself', $context, NULL, false) and get_user_roles($context, $USER->id, false)) { // Have some role } else if (has_capability('moodle/role:unassignself', $context, NULL, false) and get_user_roles($context, $USER->id, false)) { // Have some role
$this->content->items[]='<a href="'.$CFG->wwwroot.'/course/unenrol.php?id='.$course->id.'">'.get_string('unenrolme', '', format_string($course->shortname)).'</a>'; $this->content->items[]='<a href="'.$CFG->wwwroot.'/course/unenrol.php?id='.$course->id.'">'.get_string('unenrolme', '', format_string($course->shortname)).'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" class="icon" alt="" />'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/user') . '" class="icon" alt="" />';
} }
} }
/// Link to the user own profile (except guests) /// Link to the user own profile (except guests)
if (!isguestuser() and isloggedin()) { if (!isguestuser() and isloggedin()) {
$this->content->items[]='<a href="'.$CFG->wwwroot.'/user/view.php?id='.$USER->id.'&amp;course='.$course->id.'">'.get_string('profile').'</a>'; $this->content->items[]='<a href="'.$CFG->wwwroot.'/user/view.php?id='.$USER->id.'&amp;course='.$course->id.'">'.get_string('profile').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" alt="" />'; $this->content->icons[]='<img src="'.$OUTPUT->old_icon_url('i/user') . '" alt="" />';
} }
return $this->content; return $this->content;
......
...@@ -33,11 +33,11 @@ class block_admin_tree extends block_base { ...@@ -33,11 +33,11 @@ class block_admin_tree extends block_base {
} }
function open_folder($visiblename) { function open_folder($visiblename) {
global $CFG; global $OUTPUT;
$strfolderopened = s(get_string('folderopened')); $strfolderopened = s(get_string('folderopened'));
$this->tempcontent .= '<div class="depth'.$this->currentdepth.'"><a name="d'.$this->divcounter.'">'; $this->tempcontent .= '<div class="depth'.$this->currentdepth.'"><a name="d'.$this->divcounter.'">';
$this->tempcontent .= '<img id="vh_div'.$this->divcounter.'indicator" src="'.$CFG->pixpath.'/i/open.gif" alt="'.$strfolderopened.'" /> '; $this->tempcontent .= '<img id="vh_div'.$this->divcounter.'indicator" src="'.$OUTPUT->old_icon_url('i/open') . '" alt="'.$strfolderopened.'" /> ';
$this->tempcontent .= $visiblename.'</a></div><div id="vh_div'.$this->divcounter.'">'."\n"; $this->tempcontent .= $visiblename.'</a></div><div id="vh_div'.$this->divcounter.'">'."\n";
$this->currentdepth++; $this->currentdepth++;
$this->divcounter++; $this->divcounter++;
...@@ -55,7 +55,7 @@ class block_admin_tree extends block_base { ...@@ -55,7 +55,7 @@ class block_admin_tree extends block_base {
} }
function build_tree (&$content) { function build_tree (&$content) {
global $CFG; global $CFG, $OUTPUT;
if ($content instanceof admin_settingpage) { if ($content instanceof admin_settingpage) {
// show hidden pages in tree if hidden page active // show hidden pages in tree if hidden page active
if ($content->check_access() and (($content->name == $this->section) or !$content->is_hidden())) { if ($content->check_access() and (($content->name == $this->section) or !$content->is_hidden())) {
...@@ -63,7 +63,7 @@ class block_admin_tree extends block_base { ...@@ -63,7 +63,7 @@ class block_admin_tree extends block_base {
if ($content->is_hidden()) { if ($content->is_hidden()) {
$class .= ' hidden'; $class .= ' hidden';
} }
$this->create_item($content->visiblename, $CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section='.$content->name,$CFG->pixpath.'/i/item.gif', $class); $this->create_item($content->visiblename, $CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section='.$content->name,$OUTPUT->old_icon_url('i/item'), $class);
} }
} else if ($content instanceof admin_externalpage) { } else if ($content instanceof admin_externalpage) {
// show hidden pages in tree if hidden page active // show hidden pages in tree if hidden page active
...@@ -77,7 +77,7 @@ class block_admin_tree extends block_base { ...@@ -77,7 +77,7 @@ class block_admin_tree extends block_base {
if ($content->is_hidden()) { if ($content->is_hidden()) {
$class .= ' hidden'; $class .= ' hidden';
} }
$this->create_item($content->visiblename, $content->url, $CFG->pixpath.'/i/item.gif', $class); $this->create_item($content->visiblename, $content->url, $OUTPUT->old_icon_url('i/item'), $class);
} }
} else if ($content instanceof admin_category) { } else if ($content instanceof admin_category) {
if ($content->check_access() and !$content->is_hidden()) { if ($content->check_access() and !$content->is_hidden()) {
......
...@@ -109,14 +109,14 @@ class block_course_list extends block_list { ...@@ -109,14 +109,14 @@ class block_course_list extends block_list {
} }
function get_remote_courses() { function get_remote_courses() {
global $CFG, $USER; global $CFG, $USER, $OUTPUT;
if (!is_enabled_auth('mnet')) { if (!is_enabled_auth('mnet')) {
// no need to query anything remote related // no need to query anything remote related
return; return;
} }
$icon = '<img src="'.$CFG->pixpath.'/i/mnethost.gif" class="icon" alt="'.get_string('course').'" />'; $icon = '<img src="'.$OUTPUT->old_icon_url('i/mnethost') . '" class="icon" alt="'.get_string('course').'" />';
// only for logged in users! // only for logged in users!
if (!isloggedin() || isguest()) { if (!isloggedin() || isguest()) {
......
...@@ -9,9 +9,9 @@ class block_loancalc extends block_base { ...@@ -9,9 +9,9 @@ class block_loancalc extends block_base {
} }
function get_content() { function get_content() {
global $CFG; global $CFG, $OUTPUT;
$calc = $CFG->pixpath.'/i/calc.gif'; $calc = $OUTPUT->old_icon_url('i/calc');
$this->content->text = ' $this->content->text = '
<script type="text/javascript"> <script type="text/javascript">
......
...@@ -7,7 +7,7 @@ class block_messages extends block_base { ...@@ -7,7 +7,7 @@ class block_messages extends block_base {
} }
function get_content() { function get_content() {
global $USER, $CFG, $DB; global $USER, $CFG, $DB, $OUTPUT;
if (!$CFG->messaging) { if (!$CFG->messaging) {
return ''; return '';
...@@ -43,7 +43,7 @@ class block_messages extends block_base { ...@@ -43,7 +43,7 @@ class block_messages extends block_base {
$this->content->text .= '<li class="listentry"><div class="user"><a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.SITEID.'" title="'.$timeago.'">'; $this->content->text .= '<li class="listentry"><div class="user"><a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.SITEID.'" title="'.$timeago.'">';
$this->content->text .= print_user_picture($user, SITEID, $user->picture, 0, true, false, '', false); $this->content->text .= print_user_picture($user, SITEID, $user->picture, 0, true, false, '', false);
$this->content->text .= fullname($user).'</a></div>'; $this->content->text .= fullname($user).'</a></div>';
$this->content->text .= '<div class="message"><a href="'.$CFG->wwwroot.'/message/discussion.php?id='.$user->id.'" onclick="this.target=\'message_'.$user->id.'\'; return openpopup(\'/message/discussion.php?id='.$user->id.'\', \'message_'.$user->id.'\', \'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500\', 0);"><img class="iconsmall" src="'.$CFG->pixpath.'/t/message.gif" alt="" />&nbsp;'.$user->count.'</a>'; $this->content->text .= '<div class="message"><a href="'.$CFG->wwwroot.'/message/discussion.php?id='.$user->id.'" onclick="this.target=\'message_'.$user->id.'\'; return openpopup(\'/message/discussion.php?id='.$user->id.'\', \'message_'.$user->id.'\', \'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500\', 0);"><img class="iconsmall" src="'.$OUTPUT->old_icon_url('t/message') . '" alt="" />&nbsp;'.$user->count.'</a>';
$this->content->text .= '</div></li>'; $this->content->text .= '</div></li>';
} }
$this->content->text .= '</ul>'; $this->content->text .= '</ul>';
......
...@@ -367,7 +367,7 @@ class block_base { ...@@ -367,7 +367,7 @@ class block_base {
function _title_html() { function _title_html() {
global $CFG; global $OUTPUT;
//Accessibility: validation, can't have <div> inside <h2>, use <span>. //Accessibility: validation, can't have <div> inside <h2>, use <span>.
$title = '<div class="title">'; $title = '<div class="title">';
...@@ -377,7 +377,7 @@ class block_base { ...@@ -377,7 +377,7 @@ class block_base {
//Theme the buttons using, Admin - Miscellaneous - smartpix. //Theme the buttons using, Admin - Miscellaneous - smartpix.
$strshow = addslashes_js(get_string('showblocka', 'access', strip_tags($this->title))); $strshow = addslashes_js(get_string('showblocka', 'access', strip_tags($this->title)));
$strhide = addslashes_js(get_string('hideblocka', 'access', strip_tags($this->title))); $strhide = addslashes_js(get_string('hideblocka', 'access', strip_tags($this->title)));
$title .= '<input type="image" src="'.$CFG->pixpath.'/t/switch_minus.gif" '. $title .= '<input type="image" src="'.$OUTPUT->old_icon_url('t/switch_minus') . '" '.
'id="togglehide_inst'.$this->instance->id.'" '. 'id="togglehide_inst'.$this->instance->id.'" '.
'onclick="elementToggleHide(this, true, function(el) {'. 'onclick="elementToggleHide(this, true, function(el) {'.
'return findParentNode(el, \'DIV\', \'sideblock\'); },'. 'return findParentNode(el, \'DIV\', \'sideblock\'); },'.
...@@ -405,7 +405,7 @@ class block_base { ...@@ -405,7 +405,7 @@ class block_base {
* @todo complete documenting this function. Define $options. * @todo complete documenting this function. Define $options.
*/ */
function _add_edit_controls($options) { function _add_edit_controls($options) {
global $CFG, $USER; global $CFG, $USER, $OUTPUT;
// TODO - temporary hack to get the block context only if it already exists. // TODO - temporary hack to get the block context only if it already exists.
global $DB; global $DB;
...@@ -458,7 +458,7 @@ class block_base { ...@@ -458,7 +458,7 @@ class block_base {
$script = $page->url->out(false, array('instanceid' => $this->instance->id, 'sesskey' => sesskey())); $script = $page->url->out(false, array('instanceid' => $this->instance->id, 'sesskey' => sesskey()));
$movebuttons .= '<a class="icon roles" title="'. $this->str->assignroles .'" href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$context->id.'">' . $movebuttons .= '<a class="icon roles" title="'. $this->str->assignroles .'" href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$context->id.'">' .
'<img src="'.$CFG->pixpath.'/i/roles.gif" alt="'.$this->str->assignroles.'" /></a>'; '<img src="'.$OUTPUT->old_icon_url('i/roles') . '" alt="'.$this->str->assignroles.'" /></a>';
// TODO MDL-19010 fix and re-enable. // TODO MDL-19010 fix and re-enable.
if (false && $this->user_can_edit()) { if (false && $this->user_can_edit()) {
...@@ -468,12 +468,12 @@ class block_base { ...@@ -468,12 +468,12 @@ class block_base {
if ($options & BLOCK_CONFIGURE && $this->user_can_edit()) { if ($options & BLOCK_CONFIGURE && $this->user_can_edit()) {
$movebuttons .= '<a class="icon edit" title="'. $this->str->configure .'" href="'.$script.'&amp;blockaction=config">' . $movebuttons .= '<a class="icon edit" title="'. $this->str->configure .'" href="'.$script.'&amp;blockaction=config">' .
'<img src="'. $CFG->pixpath .'/t/edit.gif" alt="'. $this->str->configure .'" /></a>'; '<img src="'. $OUTPUT->old_icon_url('t/edit') . '" alt="'. $this->str->configure .'" /></a>';
} }
if ($this->user_can_addto($page)) { if ($this->user_can_addto($page)) {
$movebuttons .= '<a class="icon delete" title="'. $this->str->delete .'" href="'.$script.'&amp;blockaction=delete">' . $movebuttons .= '<a class="icon delete" title="'. $this->str->delete .'" href="'.$script.'&amp;blockaction=delete">' .
'<img src="'. $CFG->pixpath .'/t/delete.gif" alt="'. $this->str->delete .'" /></a>'; '<img src="'. $OUTPUT->old_icon_url('t/delete') . '" alt="'. $this->str->delete .'" /></a>';
} }
if ($options & BLOCK_MOVE_LEFT) { if ($options & BLOCK_MOVE_LEFT) {
...@@ -482,11 +482,11 @@ class block_base { ...@@ -482,11 +482,11 @@ class block_base {
} }
if ($options & BLOCK_MOVE_UP) { if ($options & BLOCK_MOVE_UP) {