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

and $CFG->modpixpath to $OUTPUT->mod_icon_url
This commit is contained in:
tjhunt 2009-07-02 12:07:58 +00:00
parent c8873c496b
commit e63f88c9a6
29 changed files with 78 additions and 80 deletions

View File

@ -253,7 +253,7 @@ function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings)
// Re-order
$updown = '';
$spacer = '<img src="' . $CFG->pixpath . '/spacer.gif" class="iconsmall" alt="" /> ';
$spacer = '<img src="' . $OUTPUT->old_icon_url('spacer') . '" class="iconsmall" alt="" /> ';
if ($filterinfo->active != TEXTFILTER_DISABLED) {
if (!$isfirstrow) {
$updown .= action_icon(action_url($filter, 'up'), 'up', get_string('up'));

View File

@ -1184,7 +1184,6 @@ class generator_web extends generator {
public function setup() {
global $CFG;
$CFG->pixpath = $CFG->wwwroot. '/pix';
$this->mform = new generator_form();
$this->do_generation = optional_param('do_generation', false, PARAM_BOOL);
@ -1249,7 +1248,6 @@ class fake_form {
class generator_form extends moodleform {
function definition() {
global $generator, $CFG;
$CFG->pixpath = $CFG->wwwroot. '/pix';
$mform =& $this->_form;
$mform->addElement('hidden', 'do_generation', 1);

View File

@ -210,7 +210,7 @@
foreach ($modulebyname as $modulename => $module) {
// took out hspace="\10\", because it does not validate. don't know what to replace with.
$icon = "<img src=\"$CFG->modpixpath/$module->name/icon.gif\" class=\"icon\" alt=\"\" />";
$icon = "<img src=\"" . $OUTPUT->mod_icon_url('icon', $module->name) . "\" class=\"icon\" alt=\"\" />";
$delete = "<a href=\"modules.php?delete=$module->name&amp;sesskey=".sesskey()."\">$strdelete</a>";

View File

@ -229,7 +229,7 @@
$rowclass = 'dimmed_text';
}
} else {
$icons = '<img src="' . $CFG->pixpath . '/spacer.gif" alt="" class="spacer" />';
$icons = '<img src="' . $OUTPUT->old_icon_url('spacer') . '" alt="" class="spacer" />';
}
// Move icons.
@ -275,14 +275,14 @@ function enable_disable_button($qtypename, $createable) {
}
function icon_html($action, $qtypename, $icon, $alt, $tip) {
global $CFG;
global $OUTPUT;
if ($tip) {
$tip = 'title="' . $tip . '" ';
}
$html = ' <form action="' . admin_url('qtypes.php') . '" method="post"><div>';
$html .= '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
$html .= '<input type="image" name="' . $action . '" value="' . $qtypename .
'" src="' . $CFG->pixpath . '/' . $icon . '" alt="' . $alt . '" ' . $tip . '/>';
'" src="' . $OUTPUT->old_icon_url($icon) . '" alt="' . $alt . '" ' . $tip . '/>';
$html .= '</div></form>';
return $html;
}

View File

@ -55,7 +55,7 @@ foreach ($columns as $column) {
$columndir = 'asc';
} else {
$columndir = $dir == 'asc' ? 'desc' : 'asc';
$columnicon = ' <img src="'.$CFG->pixpath.'/t/'.($dir == 'asc' ? 'down' : 'up' ).'.gif" alt="" />';
$columnicon = ' <img src="'.$OUTPUT->old_icon_url('t/'.($dir == 'asc' ? 'down' : 'up' )).'f" alt="" />';
}
$table->head[] = '<a href="user_bulk_display.php?sort='.$column.'&amp;dir='.$columndir.'">'.$strtitle.'</a>'.$columnicon;
$table->align[] = 'left';

View File

@ -59,7 +59,7 @@ foreach ($columns as $column) {
$columndir = 'asc';
} else {
$columndir = ($dir == 'asc') ? 'desc' : 'asc';
$columnicon = ' <img src="'.$CFG->pixpath.'/t/'.($dir == 'asc' ? 'down' : 'up' ).'.gif" alt="" />';
$columnicon = ' <img src="'.$OUTPUT->old_icon_url('t/'.($dir == 'asc' ? 'down' : 'up' )).'" alt="" />';
}
$table->head[] = '<a href="user_bulk_enrol.php?sort='.$column.'&amp;dir='.$columndir.'">'.$strtitle.'</a>'.$columnicon;
$table->align[] = 'left';

View File

@ -7,7 +7,7 @@ class block_activity_modules extends block_list {
}
function get_content() {
global $CFG, $DB;
global $CFG, $DB, $OUTPUT;
if($this->content !== NULL) {
return $this->content;
@ -37,7 +37,7 @@ class block_activity_modules extends block_list {
foreach ($modfullnames as $modname => $modfullname) {
if ($modname != 'label') {
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/mod/'.$modname.'/index.php?id='.$course->id.'">'.$modfullname.'</a>';
$this->content->icons[] = '<img src="'.$CFG->modpixpath.'/'.$modname.'/icon.gif" class="icon" alt="" />';
$this->content->icons[] = '<img src="'.$OUTPUT->mod_icon_url('icon', $modname) . '" class="icon" alt="" />';
}
}

View File

@ -50,9 +50,9 @@ class block_site_main_menu extends block_list {
' href="'.$CFG->wwwroot.'/mod/'.$cm->modname.'/view.php?id='.$cm->id.'">'.$instancename.'</a>';
//Accessibility: incidental image - should be empty Alt text
if (!empty($cm->icon)) {
$icon = $CFG->pixpath.'/'.$cm->icon;
$icon = $OUTPUT->old_icon_url($cm->icon);
} else {
$icon = $CFG->modpixpath.'/'.$cm->modname.'/icon.gif';
$icon = $OUTPUT->mod_icon_url('icon', $cm->modname);
}
$this->content->icons[] = '<img src="'.$icon.'" class="icon" alt="" />';
}
@ -110,7 +110,7 @@ class block_site_main_menu extends block_list {
continue;
}
$this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?moveto='.$mod->id.'&amp;sesskey='.sesskey().'">'.
'<img style="height:16px; width:80px; border:0px" src="'.$CFG->pixpath.'/movehere.gif" alt="'.$strmovehere.'" /></a>';
'<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->old_icon_url('movehere') . '" alt="'.$strmovehere.'" /></a>';
$this->content->icons[] = '';
}
$instancename = $modinfo->cms[$modnumber]->name;
@ -122,9 +122,9 @@ class block_site_main_menu extends block_list {
$extra = '';
}
if (!empty($modinfo->cms[$modnumber]->icon)) {
$icon = $CFG->pixpath.'/'.$modinfo->cms[$modnumber]->icon;
$icon = $OUTPUT->old_icon_url($modinfo->cms[$modnumber]->icon);
} else {
$icon = $CFG->modpixpath.'/'.$mod->modname.'/icon.gif';
$icon = $OUTPUT->mod_icon_url('icon', $mod->modname);
}
if ($mod->modname == 'label') {
@ -142,7 +142,7 @@ class block_site_main_menu extends block_list {
if ($ismoving) {
$this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?movetosection='.$section->id.'&amp;sesskey='.sesskey().'">'.
'<img style="height:16px; width:80px; border:0px" src="'.$CFG->pixpath.'/movehere.gif" alt="'.$strmovehere.'" /></a>';
'<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->old_icon_url('movehere') . '" alt="'.$strmovehere.'" /></a>';
$this->content->icons[] = '';
}

View File

@ -52,9 +52,9 @@ class block_social_activities extends block_list {
' href="'.$CFG->wwwroot.'/mod/'.$cm->modname.'/view.php?id='.$cm->id.'">'.$instancename.'</a>';
//Accessibility: incidental image - should be empty Alt text
if (!empty($cm->icon)) {
$icon = $CFG->pixpath.'/'.$cm->icon;
$icon = $OUTPUT->old_icon_url($cm->icon);
} else {
$icon = $CFG->modpixpath.'/'.$cm->modname.'/icon.gif';
$icon = $OUTPUT->mod_icon_url('icon', $cm->modname);
}
$this->content->icons[] = '<img src="'.$icon.'" class="icon" alt="" />';
}
@ -119,7 +119,7 @@ class block_social_activities extends block_list {
continue;
}
$this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?moveto='.$mod->id.'&amp;sesskey='.sesskey().'">'.
'<img style="height:16px; width:80px; border:0px" src="'.$CFG->pixpath.'/movehere.gif" alt="'.$strmovehere.'" /></a>';
'<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->old_icon_url('movehere') . '" alt="'.$strmovehere.'" /></a>';
$this->content->icons[] = '';
}
$instancename = $modinfo->cms[$modnumber]->name;
@ -131,9 +131,9 @@ class block_social_activities extends block_list {
$extra = '';
}
if (!empty($modinfo->cms[$modnumber]->icon)) {
$icon = $CFG->pixpath.'/'.$modinfo->cms[$modnumber]->icon;
$icon = $OUTPUT->old_icon_url($modinfo->cms[$modnumber]->icon);
} else {
$icon = $CFG->modpixpath.'/'.$mod->modname.'/icon.gif';
$icon = $OUTPUT->mod_icon_url('icon', $mod->modname);
}
if ($mod->modname == 'label') {
@ -151,7 +151,7 @@ class block_social_activities extends block_list {
if ($ismoving) {
$this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?movetosection='.$section->id.'&amp;sesskey='.sesskey().'">'.
'<img style="height:16px; width:80px; border:0px" src="'.$CFG->pixpath.'/movehere.gif" alt="'.$strmovehere.'" /></a>';
'<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->old_icon_url('movehere') . '" alt="'.$strmovehere.'" /></a>';
$this->content->icons[] = '';
}

View File

@ -232,7 +232,7 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
}
$event = $events[$eventid];
if(!empty($event->modulename)) {
$popupicon = $CFG->modpixpath.'/'.$event->modulename.'/icon.gif';
$popupicon = $OUTPUT->mod_icon_url('icon', $event->modulename) . '';
$popupalt = $event->modulename;
} else if ($event->courseid == SITEID) { // Site event
@ -484,7 +484,7 @@ function calendar_add_event_metadata($event) {
$modulename = get_string('modulename', $event->modulename);
$eventtype = get_string($event->eventtype, $event->modulename);
$icon = $CFG->modpixpath.'/'.$event->modulename.'/icon.gif';
$icon = $OUTPUT->mod_icon_url('icon', $event->modulename) . '';
$event->icon = '<img height="16" width="16" src="'.$icon.'" alt="'.$eventtype.'" title="'.$modulename.'" style="vertical-align: middle;" />';
$event->referer = '<a href="'.$CFG->wwwroot.'/mod/'.$event->modulename.'/view.php?id='.$module->id.'">'.$event->name.'</a>';

View File

@ -1184,7 +1184,7 @@ function set_section_visible($courseid, $sectionnumber, $visibility) {
* Prints a section full of activity modules
*/
function print_section($course, $section, $mods, $modnamesused, $absolute=false, $width="100%", $hidecompletion=false) {
global $CFG, $USER, $DB, $PAGE;
global $CFG, $USER, $DB, $PAGE, $OUTPUT;
static $initialised;
@ -1296,7 +1296,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
if ($ismoving) {
echo '<a title="'.$strmovefull.'"'.
' href="'.$CFG->wwwroot.'/course/mod.php?moveto='.$mod->id.'&amp;sesskey='.sesskey().'">'.
'<img class="movetarget" src="'.$CFG->pixpath.'/movehere.gif" '.
'<img class="movetarget" src="'.$OUTPUT->old_icon_url('movehere') . '" '.
' alt="'.$strmovehere.'" /></a><br />
';
}
@ -1337,7 +1337,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
$icon = "$CFG->pixpath/".$customicon;
}
} else {
$icon = "$CFG->modpixpath/$mod->modname/icon.gif";
$icon = "" . $OUTPUT->mod_icon_url('icon', $mod->modname) . "";
}
//Accessibility: for files get description via icon.
@ -1518,7 +1518,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
if ($ismoving) {
echo '<li><a title="'.$strmovefull.'"'.
' href="'.$CFG->wwwroot.'/course/mod.php?movetosection='.$section->id.'&amp;sesskey='.sesskey().'">'.
'<img class="movetarget" src="'.$CFG->pixpath.'/movehere.gif" '.
'<img class="movetarget" src="'.$OUTPUT->old_icon_url('movehere') . '" '.
' alt="'.$strmovehere.'" /></a></li>
';
}
@ -1925,20 +1925,20 @@ function print_category_info($category, $depth, $showcourses = false) {
echo '<a title="'.$strallowguests.'" href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">';
echo '<img alt="'.$strallowguests.'" src="'.$OUTPUT->old_icon_url('i/guest') . '" /></a>';
} else {
echo '<img alt="" style="width:18px;height:16px;" src="'.$CFG->pixpath.'/spacer.gif" />';
echo '<img alt="" style="width:18px;height:16px;" src="'.$OUTPUT->old_icon_url('spacer') . '" />';
}
if ($course->password) {
echo '<a title="'.$strrequireskey.'" href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">';
echo '<img alt="'.$strrequireskey.'" src="'.$OUTPUT->old_icon_url('i/key') . '" /></a>';
} else {
echo '<img alt="" style="width:18px;height:16px;" src="'.$CFG->pixpath.'/spacer.gif" />';
echo '<img alt="" style="width:18px;height:16px;" src="'.$OUTPUT->old_icon_url('spacer') . '" />';
}
if ($course->summary) {
link_to_popup_window ('/course/info.php?id='.$course->id, 'courseinfo',
'<img alt="'.$strsummary.'" src="'.$OUTPUT->old_icon_url('i/info') . '" />',
400, 500, $strsummary);
} else {
echo '<img alt="" style="width:18px;height:16px;" src="'.$CFG->pixpath.'/spacer.gif" />';
echo '<img alt="" style="width:18px;height:16px;" src="'.$OUTPUT->old_icon_url('spacer') . '" />';
}
echo '</td></tr>';
}

View File

@ -578,7 +578,7 @@
$currenttab = 'update';
require($CFG->dirroot.'/'.$CFG->admin.'/roles/tabs.php');
}
$icon = '<img src="'.$CFG->modpixpath.'/'.$module->name.'/icon.gif" alt=""/>';
$icon = '<img src="'.$OUTPUT->mod_icon_url('icon', $module->name) . '" alt=""/>';
print_heading_with_help($pageheading, 'mods', $module->name, $icon);
$mform->display();

View File

@ -223,7 +223,7 @@
$name = format_string($cm->name);
$modfullname = $modnames[$cm->modname];
$image = "<img src=\"$CFG->modpixpath/$cm->modname/icon.gif\" class=\"icon\" alt=\"$modfullname\" />";
$image = "<img src=\"" . $OUTPUT->mod_icon_url('icon', $cm->modname) . "\" class=\"icon\" alt=\"$modfullname\" />";
echo "<h4>$image $modfullname".
" <a href=\"$CFG->wwwroot/mod/$cm->modname/view.php?id=$cm->id\" $linkformat>$name</a></h4>";
}

View File

@ -89,7 +89,7 @@
$dimmed = $cm->visible ? '' : 'class="dimmed"';
$modulename = get_string('modulename', $cm->modname);
echo '<tr class="r'.$ri++.'">';
echo "<td class=\"cell c0 actvity\"><img src=\"$CFG->modpixpath/$cm->modname/icon.gif\" class=\"icon\" alt=\"$modulename\" />";
echo "<td class=\"cell c0 actvity\"><img src=\"" . $OUTPUT->mod_icon_url('icon', $cm->modname) . "\" class=\"icon\" alt=\"$modulename\" />";
echo "<a $dimmed title=\"$modulename\" href=\"$CFG->wwwroot/mod/$cm->modname/view.php?id=$cm->id\">".format_string($cm->name)."</a></td>";
echo "<td class=\"cell c1 numviews\">";
if (!empty($views[$cm->id]->numviews)) {

View File

@ -334,9 +334,9 @@
function print_outline_row($mod, $instance, $result) {
global $CFG;
global $OUTPUT;
$image = "<img src=\"$CFG->modpixpath/$mod->modname/icon.gif\" class=\"icon\" alt=\"$mod->modfullname\" />";
$image = "<img src=\"" . $OUTPUT->mod_icon_url('icon', $mod->modname) . "\" class=\"icon\" alt=\"$mod->modfullname\" />";
echo "<tr>";
echo "<td valign=\"top\">$image</td>";

View File

@ -1268,8 +1268,8 @@ class grade_structure {
} else if ($element['object']->itemtype == 'mod') {
$strmodname = get_string('modulename', $element['object']->itemmodule);
return '<img src="'.$CFG->modpixpath.'/'.
$element['object']->itemmodule.'/icon.gif" ' .
return '<img src="'.$OUTPUT->mod_icon_url('icon',
$element['object']->itemmodule) . '" ' .
'class="icon itemicon" title="' .s($strmodname).
'" alt="' .s($strmodname).'"/>';

View File

@ -474,7 +474,7 @@ class grade_report_grader extends grade_report {
* @return void
*/
public function print_toggle($type, $return=false) {
global $CFG;
global $CFG, $OUTPUT;
$icons = array('eyecons' => 't/hide.gif',
'calculations' => 't/calc.gif',
@ -510,7 +510,7 @@ class grade_report_grader extends grade_report {
$string = ${'str' . $show_hide};
$img = '<img src="'.$CFG->pixpath.'/'.$image_name.'" class="iconsmall" alt="'
$img = '<img src="'.$OUTPUT->old_icon_url($image_name).'" class="iconsmall" alt="'
.$string.'" title="'.$string.'" />'. "\n";
$retval = '<div class="gradertoggle">' . $img . '<a href="' . $this->baseurl . "&amp;toggle=$toggle_action&amp;toggle_type=$type\">"

View File

@ -43,7 +43,7 @@ class MoodleQuickForm_modgrade extends MoodleQuickForm_select{
*/
function onQuickFormEvent($event, $arg, &$caller)
{
global $COURSE, $CFG;
global $COURSE, $CFG, $OUTPUT;
switch ($event) {
case 'createElement':
// Need to call superclass first because we want the constructor
@ -62,7 +62,7 @@ class MoodleQuickForm_modgrade extends MoodleQuickForm_select{
$grades[$i] = $i;
}
$this->load($grades);
$linkobject = '<span class="helplink"><img height="17" width="17" alt="'.$strscales.'" src="'.$CFG->pixpath .'/help.gif" /></span>';
$linkobject = '<span class="helplink"><img height="17" width="17" alt="'.$strscales.'" src="'.$OUTPUT->old_icon_url('help') . '" /></span>';
$this->setHelpButton(array('/course/scales.php?id='. $COURSE->id .'&amp;list=true', 'ratingscales',
$linkobject, 400, 500, $strscales, 'none', true), 'link_to_popup_window');
return $result;

View File

@ -1088,9 +1088,9 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless {
}else {
$this->updateAttributes(array('class'=>'mform'));
}
$this->_reqHTML = '<img class="req" title="'.get_string('requiredelement', 'form').'" alt="'.get_string('requiredelement', 'form').'" src="'.$CFG->pixpath.'/req.gif'.'" />';
$this->_advancedHTML = '<img class="adv" title="'.get_string('advancedelement', 'form').'" alt="'.get_string('advancedelement', 'form').'" src="'.$CFG->pixpath.'/adv.gif'.'" />';
$this->setRequiredNote(get_string('somefieldsrequired', 'form', '<img alt="'.get_string('requiredelement', 'form').'" src="'.$CFG->pixpath.'/req.gif'.'" />'));
$this->_reqHTML = '<img class="req" title="'.get_string('requiredelement', 'form').'" alt="'.get_string('requiredelement', 'form').'" src="'.$OUTPUT->old_icon_url('req') .'" />';
$this->_advancedHTML = '<img class="adv" title="'.get_string('advancedelement', 'form').'" alt="'.get_string('advancedelement', 'form').'" src="'.$OUTPUT->old_icon_url('adv') .'" />';
$this->setRequiredNote(get_string('somefieldsrequired', 'form', '<img alt="'.get_string('requiredelement', 'form').'" src="'.$OUTPUT->old_icon_url('req') .'" />'));
//(Help file doesn't add anything) helpbutton('requiredelement', get_string('requiredelement', 'form'), 'moodle', true, false, '', true));
}

View File

@ -3568,7 +3568,7 @@ function print_group_picture($group, $courseid, $large=false, $return=false, $li
* @return string|bool Depending on $return
*/
function print_png($url, $sizex, $sizey, $return, $parameters='alt=""') {
global $CFG;
global $OUTPUT;
static $recentIE;
if (!isset($recentIE)) {
@ -3576,7 +3576,7 @@ function print_png($url, $sizex, $sizey, $return, $parameters='alt=""') {
}
if ($recentIE) { // work around the HORRIBLE bug IE has with alpha transparencies
$output .= '<img src="'. $CFG->pixpath .'/spacer.gif" width="'. $sizex .'" height="'. $sizey .'"'.
$output .= '<img src="'. $OUTPUT->old_icon_url('spacer') . '" width="'. $sizex .'" height="'. $sizey .'"'.
' class="png" style="width: '. $sizex .'px; height: '. $sizey .'px; '.
' filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.
"'$url', sizingMethod='scale') ".
@ -4192,7 +4192,7 @@ function navmenu($course, $cm=NULL, $targetwindow='self') {
}
$menu[$url] = $localname;
if (empty($THEME->navmenuiconshide)) {
$menustyle[$url] = 'style="background-image: url('.$CFG->modpixpath.'/'.$mod->modname.'/icon.gif);"'; // Unfortunately necessary to do this here
$menustyle[$url] = 'style="background-image: url('.$OUTPUT->mod_icon_url('icon', $mod->modname) . ');"'; // Unfortunately necessary to do this here
}
$previousmod = $mod;
}
@ -4318,7 +4318,7 @@ function navmenulist($course, $sections, $modinfo, $strsection, $strjumpto, $wid
$class = 'activity '.$mod->modname;
$class .= ($cmid == $mod->id) ? ' selected' : '';
$menu[] = '<li class="'.$class.'">'.
'<img src="'.$CFG->modpixpath.'/'.$mod->modname.'/icon.gif" alt="" />'.
'<img src="'.$OUTPUT->mod_icon_url('icon', $mod->modname) . '" alt="" />'.
'<a href="'.$CFG->wwwroot.'/mod/'.$url.'">'.$mod->name.'</a></li>';
}
@ -4465,7 +4465,7 @@ function print_timer_selector($timelimit = 0, $unit = '', $name = 'timelimit', $
*/
function print_grade_menu($courseid, $name, $current, $includenograde=true, $return=false) {
global $CFG;
global $CFG, $OUTPUT;
$output = '';
$strscale = get_string('scale');
@ -4483,7 +4483,7 @@ function print_grade_menu($courseid, $name, $current, $includenograde=true, $ret
}
$output .= choose_from_menu($grades, $name, $current, '', '', 0, true);
$linkobject = '<span class="helplink"><img class="iconhelp" alt="'.$strscales.'" src="'.$CFG->pixpath .'/help.gif" /></span>';
$linkobject = '<span class="helplink"><img class="iconhelp" alt="'.$strscales.'" src="'.$OUTPUT->old_icon_url('help') . '" /></span>';
$output .= link_to_popup_window ('/course/scales.php?id='. $courseid .'&amp;list=true', 'ratingscales',
$linkobject, 400, 500, $strscales, 'none', true);
@ -4507,13 +4507,13 @@ function print_grade_menu($courseid, $name, $current, $includenograde=true, $ret
*/
function print_scale_menu($courseid, $name, $current, $return=false) {
global $CFG;
global $CFG, $OUTPUT;
$output = '';
$strscales = get_string('scales');
$output .= choose_from_menu(get_scales_menu($courseid), $name, $current, '', '', 0, true);
$linkobject = '<span class="helplink"><img class="iconhelp" alt="'.$strscales.'" src="'.$CFG->pixpath .'/help.gif" /></span>';
$linkobject = '<span class="helplink"><img class="iconhelp" alt="'.$strscales.'" src="'.$OUTPUT->old_icon_url('help') . '" /></span>';
$output .= link_to_popup_window ('/course/scales.php?id='. $courseid .'&amp;list=true', 'ratingscales',
$linkobject, 400, 500, $strscales, 'none', true);
if ($return) {
@ -4534,12 +4534,12 @@ function print_scale_menu($courseid, $name, $current, $return=false) {
*/
function print_scale_menu_helpbutton($courseid, $scale, $return=false) {
global $CFG;
global $OUTPUT;
$output = '';
$strscales = get_string('scales');
$linkobject = '<span class="helplink"><img class="iconhelp" alt="'.$scale->name.'" src="'.$CFG->pixpath .'/help.gif" /></span>';
$linkobject = '<span class="helplink"><img class="iconhelp" alt="'.$scale->name.'" src="'.$OUTPUT->old_icon_url('help') . '" /></span>';
$output .= link_to_popup_window ('/course/scales.php?id='. $courseid .'&amp;list=true&amp;scaleid='. $scale->id, 'ratingscale',
$linkobject, 400, 500, $scale->name, 'none', true);
if ($return) {
@ -4576,7 +4576,7 @@ function mdie($msg='', $errorcode=1) {
* @return string Link to help button
*/
function editorhelpbutton(){
global $CFG, $SESSION;
global $CFG, $SESSION, $OUTPUT;
$items = func_get_args();
$i = 1;
$urlparams = array();
@ -4627,7 +4627,7 @@ function editorhelpbutton(){
$alttag = join (', ', $titles);
$paramstring = join('&', $urlparams);
$linkobject = '<img alt="'.$alttag.'" class="iconhelp" src="'.$CFG->pixpath .'/help.gif" />';
$linkobject = '<img alt="'.$alttag.'" class="iconhelp" src="'.$OUTPUT->old_icon_url('help') . '" />';
return link_to_popup_window(s('/lib/form/editorhelp.php?'.$paramstring), 'popup', $linkobject, 400, 500, $alttag, 'none', true);
}

View File

@ -2765,7 +2765,7 @@ function assignment_get_recent_mod_activity(&$activities, &$index, $timestart, $
* This is used by course/recent.php
*/
function assignment_print_recent_mod_activity($activity, $courseid, $detail, $modnames) {
global $CFG;
global $CFG, $OUTPUT;
echo '<table border="0" cellpadding="3" cellspacing="0" class="assignment-recent">';
@ -2776,7 +2776,7 @@ function assignment_print_recent_mod_activity($activity, $courseid, $detail, $mo
if ($detail) {
$modname = $modnames[$activity->type];
echo '<div class="title">';
echo "<img src=\"$CFG->modpixpath/assignment/icon.gif\" ".
echo "<img src=\"" . $OUTPUT->mod_icon_url('icon', 'assignment') . "\" ".
"class=\"icon\" alt=\"$modname\">";
echo "<a href=\"$CFG->wwwroot/mod/assignment/view.php?id={$activity->cmid}\">{$activity->name}</a>";
echo '</div>';

View File

@ -235,11 +235,11 @@
echo '<td>';
$buttonlink = $ME.'?'.htmlspecialchars(feedback_edit_get_default_query($id, $do_show).'&movehere='.$moveposition);
echo '<a title="'.get_string('move_here','feedback').'" href="'.$buttonlink.'">
<img class="movetarget" alt="'.get_string('move_here','feedback').'" src="'.$CFG->pixpath .'/movehere.gif" />
<img class="movetarget" alt="'.get_string('move_here','feedback').'" src="'.$OUTPUT->old_icon_url('movehere') . '" />
</a>';
// echo '<form action="'.$ME.'" method="post"><fieldset>';
// echo '<input title="'.get_string('move_here','feedback').'" type="image" src="'.$CFG->pixpath .'/movehere.gif" hspace="1" height="16" width="80" border="0" />';
// echo '<input title="'.get_string('move_here','feedback').'" type="image" src="'.$OUTPUT->old_icon_url('movehere') . '" hspace="1" height="16" width="80" border="0" />';
// echo '<input type="hidden" name="movehere" value="'.$moveposition.'" />';
// feedback_edit_print_default_form_values($id, $do_show);
// echo '</fieldset></form>';
@ -377,10 +377,10 @@
echo '<td>';
$buttonlink = $ME.'?'.htmlspecialchars(feedback_edit_get_default_query($id, $do_show).'&movehere='.$moveposition);
echo '<a title="'.get_string('move_here','feedback').'" href="'.$buttonlink.'">
<img class="movetarget" alt="'.get_string('move_here','feedback').'" src="'.$CFG->pixpath .'/movehere.gif" />
<img class="movetarget" alt="'.get_string('move_here','feedback').'" src="'.$OUTPUT->old_icon_url('movehere') . '" />
</a>';
// echo '<form action="'.$ME.'" method="post"><fieldset>';
// echo '<input class="feedback_movehere_button" title="'.get_string('move_here','feedback').'" type="image" src="'.$CFG->pixpath .'/movehere.gif" />';
// echo '<input class="feedback_movehere_button" title="'.get_string('move_here','feedback').'" type="image" src="'.$OUTPUT->old_icon_url('movehere') . '" />';
// echo '<input type="hidden" name="movehere" value="'.$moveposition.'" />';
// feedback_edit_print_default_form_values($id, $do_show);
// echo '</fieldset></form>';

View File

@ -325,7 +325,7 @@ function feedback_get_recent_mod_activity(&$activities, &$index, $timemodified,
* @return void Output is echo'd
*/
function feedback_print_recent_mod_activity($activity, $courseid, $detail, $modnames) {
global $CFG;
global $CFG, $OUTPUT;
echo '<table border="0" cellpadding="3" cellspacing="0" class="forum-recent">';
@ -336,7 +336,7 @@ function feedback_print_recent_mod_activity($activity, $courseid, $detail, $modn
if ($detail) {
$modname = $modnames[$activity->type];
echo '<div class="title">';
echo "<img src=\"$CFG->modpixpath/{$activity->type}/icon.gif\" ".
echo "<img src=\"" . $OUTPUT->mod_icon_url('icon', $activity->type) . "\" ".
"class=\"icon\" alt=\"$modname\" />";
echo "<a href=\"$CFG->wwwroot/mod/feedback/view.php?id={$activity->cmid}\">{$activity->name}</a>";
echo '</div>';

View File

@ -6103,7 +6103,7 @@ function forum_get_recent_mod_activity(&$activities, &$index, $timestart, $cours
* @global object
*/
function forum_print_recent_mod_activity($activity, $courseid, $detail, $modnames, $viewfullnames) {
global $CFG;
global $CFG, $OUTPUT;
if ($activity->content->parent) {
$class = 'reply';
@ -6120,7 +6120,7 @@ function forum_print_recent_mod_activity($activity, $courseid, $detail, $modname
echo '<div class="title">';
if ($detail) {
$aname = s($activity->name);
echo "<img src=\"$CFG->modpixpath/$activity->type/icon.gif\" ".
echo "<img src=\"" . $OUTPUT->mod_icon_url('icon', $activity->type) . "\" ".
"class=\"icon\" alt=\"{$aname}\" />";
}
echo "<a href=\"$CFG->wwwroot/mod/forum/discuss.php?d={$activity->content->discussion}"

View File

@ -1251,7 +1251,7 @@ function hotpot_get_recent_mod_activity(&$activities, &$index, $sincetime, $cour
*/
function hotpot_print_recent_mod_activity($activity, $course, $detail=false) {
global $CFG, $THEME, $USER;
global $CFG, $THEME, $USER, $OUTPUT;
if (isset($THEME->cellcontent2)) {
$bgcolor = ' bgcolor="'.$THEME->cellcontent2.'"';
@ -1267,7 +1267,7 @@ function hotpot_print_recent_mod_activity($activity, $course, $detail=false) {
if ($detail) {
// activity icon
$src = "$CFG->modpixpath/$activity->type/icon.gif";
$src = "" . $OUTPUT->mod_icon_url('icon', $activity->type) . "";
print '<img src="'.$src.'" class="icon" alt="'.$activity->type.'" /> ';
// link to activity

View File

@ -817,7 +817,7 @@ function quiz_get_recent_mod_activity(&$activities, &$index, $timestart, $course
* @return void output is echo'd
*/
function quiz_print_recent_mod_activity($activity, $courseid, $detail, $modnames) {
global $CFG;
global $CFG, $OUTPUT;
echo '<table border="0" cellpadding="3" cellspacing="0" class="forum-recent">';
@ -828,7 +828,7 @@ function quiz_print_recent_mod_activity($activity, $courseid, $detail, $modnames
if ($detail) {
$modname = $modnames[$activity->type];
echo '<div class="title">';
echo "<img src=\"$CFG->modpixpath/{$activity->type}/icon.gif\" ".
echo "<img src=\"" . $OUTPUT->mod_icon_url('icon', $activity->type) . "\" ".
"class=\"icon\" alt=\"$modname\" />";
echo "<a href=\"$CFG->wwwroot/mod/quiz/view.php?id={$activity->cmid}\">{$activity->name}</a>";
echo '</div>';

View File

@ -576,9 +576,9 @@ abstract class question_bank_action_column_base extends question_bank_column_bas
}
protected function print_icon($icon, $title, $url) {
global $CFG;
global $OUTPUT;
echo '<a title="' . $title . '" href="' . $url . '">
<img src="' . $CFG->pixpath . '/' . $icon . '" class="iconsmall" alt="' . $title . '" /></a>';
<img src="' . $OUTPUT->old_icon_url($icon) . '" class="iconsmall" alt="' . $title . '" /></a>';
}
public function get_required_fields() {

View File

@ -336,7 +336,7 @@
if ($listing->doctype == 'user'){ // A special handle for users
$icon = print_user_picture ($listing->userid, 0, true, 0, true, false) ;
} else {
$iconpath = $CFG->modpixpath.'/'.$listing->doctype.'/icon.gif';
$iconpath = $OUTPUT->mod_icon_url('icon', $listing->doctype);
$icon = "<img align=\"top\" src=\"".$iconpath."\" class=\"activityicon\" alt=\"\"/>";
}
$coursename = $DB->get_field('course', 'fullname', array('id' => $listing->courseid));

View File

@ -178,21 +178,21 @@ function profile_category_icons ($category) {
$editstr .= '<a title="'.$strdelete.'" href="index.php?id='.$category->id.'&amp;action=deletecategory';
$editstr .= '"><img src="'.$OUTPUT->old_icon_url('t/delete') . '" alt="'.$strdelete.'" class="iconsmall" /></a> ';
} else {
$editstr .= '<img src="'.$CFG->pixpath.'/spacer.gif" alt="" class="iconsmall" /> ';
$editstr .= '<img src="'.$OUTPUT->old_icon_url('spacer') . '" alt="" class="iconsmall" /> ';
}
/// Move up
if ($category->sortorder > 1) {
$editstr .= '<a title="'.$strmoveup.'" href="index.php?id='.$category->id.'&amp;action=movecategory&amp;dir=up&amp;sesskey='.sesskey().'"><img src="'.$OUTPUT->old_icon_url('t/up') . '" alt="'.$strmoveup.'" class="iconsmall" /></a> ';
} else {
$editstr .= '<img src="'.$CFG->pixpath.'/spacer.gif" alt="" class="iconsmall" /> ';
$editstr .= '<img src="'.$OUTPUT->old_icon_url('spacer') . '" alt="" class="iconsmall" /> ';
}
/// Move down
if ($category->sortorder < $categorycount) {
$editstr .= '<a title="'.$strmovedown.'" href="index.php?id='.$category->id.'&amp;action=movecategory&amp;dir=down&amp;sesskey='.sesskey().'"><img src="'.$OUTPUT->old_icon_url('t/down') . '" alt="'.$strmovedown.'" class="iconsmall" /></a> ';
} else {
$editstr .= '<img src="'.$CFG->pixpath.'/spacer.gif" alt="" class="iconsmall" /> ';
$editstr .= '<img src="'.$OUTPUT->old_icon_url('spacer') . '" alt="" class="iconsmall" /> ';
}
return $editstr;
@ -227,14 +227,14 @@ function profile_field_icons($field) {
if ($field->sortorder > 1) {
$editstr .= '<a title="'.$strmoveup.'" href="index.php?id='.$field->id.'&amp;action=movefield&amp;dir=up&amp;sesskey='.sesskey().'"><img src="'.$OUTPUT->old_icon_url('t/up') . '" alt="'.$strmoveup.'" class="iconsmall" /></a> ';
} else {
$editstr .= '<img src="'.$CFG->pixpath.'/spacer.gif" alt="" class="iconsmall" /> ';
$editstr .= '<img src="'.$OUTPUT->old_icon_url('spacer') . '" alt="" class="iconsmall" /> ';
}
/// Move down
if ($field->sortorder < $fieldcount) {
$editstr .= '<a title="'.$strmovedown.'" href="index.php?id='.$field->id.'&amp;action=movefield&amp;dir=down&amp;sesskey='.sesskey().'"><img src="'.$OUTPUT->old_icon_url('t/down') . '" alt="'.$strmovedown.'" class="iconsmall" /></a> ';
} else {
$editstr .= '<img src="'.$CFG->pixpath.'/spacer.gif" alt="" class="iconsmall" /> ';
$editstr .= '<img src="'.$OUTPUT->old_icon_url('spacer') . '" alt="" class="iconsmall" /> ';
}
return $editstr;