From ddedf979b48e286386cd39785937b287a451a52b Mon Sep 17 00:00:00 2001 From: tjhunt Date: Fri, 3 Jul 2009 06:19:25 +0000 Subject: [PATCH] MDL-19690 - more $CFG->pixpath to $OUTPUT->old_icon_url --- lib/adminlib.php | 46 +++++++++++------------ lib/ajax/ajaxcourse.js | 4 +- lib/ajax/ajaxlib.php | 20 +++++++++- lib/ajax/block_classes.js | 4 +- lib/ajax/section_classes.js | 32 ++++++++-------- lib/form/filemanager.php | 2 +- lib/questionlib.php | 18 ++++----- lib/weblib.php | 4 +- message/lib.php | 10 ++--- mod/glossary/editcategories.php | 4 +- question/contextmove_form.php | 6 +-- question/contextmoveq_form.php | 4 +- question/qengine.js | 6 +-- question/type/questiontype.php | 8 ++-- repository/lib.php | 2 +- repository/wikimedia/repository.class.php | 4 +- user/index.php | 2 +- user/portfolio.php | 2 +- user/selector/lib.php | 4 +- user/selector/script.js | 13 ++++++- user/view.php | 6 +-- 21 files changed, 112 insertions(+), 89 deletions(-) diff --git a/lib/adminlib.php b/lib/adminlib.php index 9d51420d12..62e7408c57 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -4500,7 +4500,7 @@ class admin_setting_manageauths extends admin_setting { * @return string highlight */ public function output_html($data, $query='') { - global $CFG; + global $CFG, $OUTPUT; // display strings @@ -4576,14 +4576,14 @@ class admin_setting_manageauths extends admin_setting { // hide/show link if (in_array($auth, $authsenabled)) { $hideshow = ""; - $hideshow .= "pixpath}/i/hide.gif\" class=\"icon\" alt=\"disable\" />"; + $hideshow .= "old_icon_url('i/hide') . "\" class=\"icon\" alt=\"disable\" />"; // $hideshow = ""; $enabled = true; $displayname = "$name"; } else { $hideshow = ""; - $hideshow .= "pixpath}/i/show.gif\" class=\"icon\" alt=\"enable\" />"; + $hideshow .= "old_icon_url('i/show') . "\" class=\"icon\" alt=\"enable\" />"; // $hideshow = ""; $enabled = false; $displayname = "$name"; @@ -4594,17 +4594,17 @@ class admin_setting_manageauths extends admin_setting { if ($enabled) { if ($updowncount > 1) { $updown .= ""; - $updown .= "pixpath}/t/up.gif\" alt=\"up\" /> "; + $updown .= "old_icon_url('t/up') . "\" alt=\"up\" /> "; } else { - $updown .= "pixpath}/spacer.gif\" class=\"icon\" alt=\"\" /> "; + $updown .= "old_icon_url('spacer.gif') . "\" class=\"icon\" alt=\"\" /> "; } if ($updowncount < $authcount) { $updown .= ""; - $updown .= "pixpath}/t/down.gif\" alt=\"down\" />"; + $updown .= "old_icon_url('t/down') . "\" alt=\"down\" />"; } else { - $updown .= "pixpath}/spacer.gif\" class=\"icon\" alt=\"\" />"; + $updown .= "old_icon_url('spacer.gif') . "\" class=\"icon\" alt=\"\" />"; } ++ $updowncount; } @@ -4699,7 +4699,7 @@ class admin_setting_manageeditors extends admin_setting { * @return string */ public function output_html($data, $query='') { - global $CFG; + global $CFG, $OUTPUT; // display strings $txt = get_strings(array('administration', 'settings', 'edit', 'name', 'enable', 'disable', @@ -4740,14 +4740,14 @@ class admin_setting_manageeditors extends admin_setting { // hide/show link if (in_array($editor, $active_editors)) { $hideshow = ""; - $hideshow .= "pixpath}/i/hide.gif\" class=\"icon\" alt=\"disable\" />"; + $hideshow .= "old_icon_url('i/hide') . "\" class=\"icon\" alt=\"disable\" />"; // $hideshow = ""; $enabled = true; $displayname = "$name"; } else { $hideshow = ""; - $hideshow .= "pixpath}/i/show.gif\" class=\"icon\" alt=\"enable\" />"; + $hideshow .= "old_icon_url('i/show') . "\" class=\"icon\" alt=\"enable\" />"; // $hideshow = ""; $enabled = false; $displayname = "$name"; @@ -4758,17 +4758,17 @@ class admin_setting_manageeditors extends admin_setting { if ($enabled) { if ($updowncount > 1) { $updown .= ""; - $updown .= "pixpath}/t/up.gif\" alt=\"up\" /> "; + $updown .= "old_icon_url('t/up') . "\" alt=\"up\" /> "; } else { - $updown .= "pixpath}/spacer.gif\" class=\"icon\" alt=\"\" /> "; + $updown .= "old_icon_url('spacer.gif') . "\" class=\"icon\" alt=\"\" /> "; } if ($updowncount < $editorcount) { $updown .= ""; - $updown .= "pixpath}/t/down.gif\" alt=\"down\" />"; + $updown .= "old_icon_url('t/down') . "\" alt=\"down\" />"; } else { - $updown .= "pixpath}/spacer.gif\" class=\"icon\" alt=\"\" />"; + $updown .= "old_icon_url('spacer.gif') . "\" class=\"icon\" alt=\"\" />"; } ++ $updowncount; } @@ -4949,8 +4949,8 @@ class admin_setting_manageportfolio extends admin_setting { if (array_key_exists($i->get('plugin'), $insane) || array_key_exists($i->get('id'), $insaneinstances)) { $row .= '' . get_string('hidden', 'portfolio') . '' . "\n"; } else { - $row .= ' ' . get_string($i->get('visible') ? 'hide' : 'show') . '' . "\n"; + $row .= ' ' . get_string($i->get('visible') ? 'hide' : 'show') . '' . "\n"; } $table->data[] = array($i->get('name'), $i->get_name() . ' (' . $i->get('plugin') . ')', $row); if (!in_array($i->get('plugin'), $alreadyplugins)) { @@ -5861,7 +5861,7 @@ class admin_setting_managerepository extends admin_setting { * @return string XHTML */ public function output_html($data, $query='') { - global $CFG, $USER; + global $CFG, $USER, $OUTPUT; $output = print_box_start('generalbox','',true); $namestr = get_string('name'); $settingsstr = get_string('settings'); @@ -5906,7 +5906,7 @@ class admin_setting_managerepository extends admin_setting { $hidetitle = $i->get_visible() ? get_string('clicktohide', 'repository') : get_string('clicktoshow', 'repository'); $hiddenshow = ' ' - .'' . $hidetitle . '' .'' . "\n"; @@ -5916,17 +5916,17 @@ class admin_setting_managerepository extends admin_setting { if ($updowncount > 1) { $updown .= "baseurl&move=up&type=".$i->get_typename()."\">"; - $updown .= "pixpath}/t/up.gif\" alt=\"up\" /> "; + $updown .= "old_icon_url('t/up') . "\" alt=\"up\" /> "; } else { - $updown .= "pixpath}/spacer.gif\" class=\"icon\" alt=\"\" /> "; + $updown .= "old_icon_url('spacer.gif') . "\" class=\"icon\" alt=\"\" /> "; } if ($updowncount < count($instances)) { $updown .= "baseurl&move=down&type=".$i->get_typename()."\">"; - $updown .= "pixpath}/t/down.gif\" alt=\"down\" />"; + $updown .= "old_icon_url('t/down') . "\" alt=\"down\" />"; } else { - $updown .= "pixpath}/spacer.gif\" class=\"icon\" alt=\"\" />"; + $updown .= "old_icon_url('spacer.gif') . "\" class=\"icon\" alt=\"\" />"; } $updowncount++; @@ -6028,7 +6028,7 @@ class admin_setting_managewsprotocols extends admin_setting { foreach ($protocols as $i) { $hidetitle = $i->get_protocolid() ? get_string('clicktohide', 'repository') : get_string('clicktoshow', 'repository'); $hiddenshow = ' ' - .'' . $hidetitle . '' .'' . "\n"; diff --git a/lib/ajax/ajaxcourse.js b/lib/ajax/ajaxcourse.js index 09f11d6340..b18eaa23b2 100644 --- a/lib/ajax/ajaxcourse.js +++ b/lib/ajax/ajaxcourse.js @@ -148,13 +148,13 @@ main_class.prototype.get_section_index = function(el) { main_class.prototype.mk_button = function(tag, imgSrc, text, attributes, imgAttributes) { //Create button and return object. //Set the text: the container TITLE or image ALT attributes can be overridden, eg. - // main.mk_button('a', '/i/move_2d.gif', strmove, [['title', strmoveshort]]); + // main.mk_button('a', main.portal.icons['move_2d'], strmove, [['title', strmoveshort]]); var container = document.createElement(tag); container.style.cursor = 'pointer'; container.setAttribute('title', text); var image = document.createElement('img'); - image.setAttribute('src', main.portal.strings['pixpath']+imgSrc); + image.setAttribute('src', imgSrc); image.setAttribute('alt', text); //image.setAttribute('title', ''); container.appendChild(image); diff --git a/lib/ajax/ajaxlib.php b/lib/ajax/ajaxlib.php index 56a0343981..d5406cb792 100644 --- a/lib/ajax/ajaxlib.php +++ b/lib/ajax/ajaxlib.php @@ -40,7 +40,6 @@ function setup_core_javascript(page_requirements_manager $requires) { $config = array( 'wwwroot' => $CFG->httpswwwroot, // Yes, really. See above. - 'pixpath' => $CFG->pixpath, 'sesskey' => sesskey(), ); if (debugging('', DEBUG_DEVELOPER)) { @@ -1302,7 +1301,6 @@ class jsportal { $output .= " main.portal.id = ".$courseid.";\n"; $output .= " main.portal.blocks = new Array(".$blocksoutput.");\n"; $output .= " main.portal.strings['wwwroot']='".$CFG->wwwroot."';\n"; - $output .= " main.portal.strings['pixpath']='".$CFG->pixpath."';\n"; $output .= " main.portal.strings['marker']='".get_string('markthistopic', '', '_var_')."';\n"; $output .= " main.portal.strings['marked']='".get_string('markedthistopic', '', '_var_')."';\n"; $output .= " main.portal.strings['hide']='".get_string('hide')."';\n"; @@ -1322,6 +1320,24 @@ class jsportal { $output .= " main.portal.strings['resource']='".get_string('resource')."';\n"; $output .= " main.portal.strings['activity']='".get_string('activity')."';\n"; $output .= " main.portal.strings['sesskey']='".sesskey()."';\n"; + $output .= " main.portal.icons['spacerimg']='".$OUTPUT->old_icon_url('spaces')."';\n"; + $output .= " main.portal.icons['marker']='".$OUTPUT->old_icon_url('i/marker')."';\n"; + $output .= " main.portal.icons['ihide']='".$OUTPUT->old_icon_url('i/hide')."';\n"; + $output .= " main.portal.icons['move_2d']='".$OUTPUT->old_icon_url('i/move_2d')."';\n"; + $output .= " main.portal.icons['show']='".$OUTPUT->old_icon_url('t/show')."';\n"; + $output .= " main.portal.icons['hide']='".$OUTPUT->old_icon_url('t/hide')."';\n"; + $output .= " main.portal.icons['delete']='".$OUTPUT->old_icon_url('t/delete')."';\n"; + $output .= " main.portal.icons['groupn']='".$OUTPUT->old_icon_url('t/groupn')."';\n"; + $output .= " main.portal.icons['groups']='".$OUTPUT->old_icon_url('t/groups')."';\n"; + $output .= " main.portal.icons['groupv']='".$OUTPUT->old_icon_url('t/groupv')."';\n"; + if (right_to_left()) { + $output .= " main.portal.icons['backwards']='".$OUTPUT->old_icon_url('t/right')."';\n"; + $output .= " main.portal.icons['forwards']='".$OUTPUT->old_icon_url('t/left')."';\n"; + } else { + $output .= " main.portal.icons['backwards']='".$OUTPUT->old_icon_url('t/left')."';\n"; + $output .= " main.portal.icons['forwards']='".$OUTPUT->old_icon_url('t/right')."';\n"; + } + $output .= " onloadobj.load();\n"; $output .= " main.process_blocks();\n"; $output .= ""; diff --git a/lib/ajax/block_classes.js b/lib/ajax/block_classes.js index decb237b6f..2823f3ed14 100644 --- a/lib/ajax/block_classes.js +++ b/lib/ajax/block_classes.js @@ -202,10 +202,10 @@ block_class.prototype.reset_regions = function() { block_class.prototype.init_buttons = function() { - var viewbutton = main.mk_button('a', '/t/hide.gif', main.portal.strings['hide'], [['class', 'icon hide']]); + var viewbutton = main.mk_button('a', main.portal.icons['hide'], main.portal.strings['hide'], [['class', 'icon hide']]); YAHOO.util.Event.addListener(viewbutton, 'click', this.toggle_hide, this, true); - var deletebutton = main.mk_button('a', '/t/delete.gif', main.portal.strings['delete'], [['class', 'icon delete']]); + var deletebutton = main.mk_button('a', main.portal.icons['delete'], main.portal.strings['delete'], [['class', 'icon delete']]); YAHOO.util.Event.addListener(deletebutton, 'click', this.delete_button, this, true); this.viewbutton = viewbutton; diff --git a/lib/ajax/section_classes.js b/lib/ajax/section_classes.js index c86260358d..3a99f67bf4 100755 --- a/lib/ajax/section_classes.js +++ b/lib/ajax/section_classes.js @@ -89,12 +89,12 @@ section_class.prototype.init_buttons = function() { } if (!this.isWeekFormat) { - var highlightbutton = main.mk_button('div', '/i/marker.gif', main.getString('marker', this.sectionId)); + var highlightbutton = main.mk_button('div', main.portal.icons['marker'], main.getString('marker', this.sectionId)); YAHOO.util.Event.addListener(highlightbutton, 'click', this.mk_marker, this, true); commandContainer.appendChild(highlightbutton); this.highlightButton = highlightbutton; } - var viewbutton = main.mk_button('div', '/i/hide.gif', main.getString('hidesection', this.sectionId), + var viewbutton = main.mk_button('div', main.portal.icons['hide'], main.getString('hidesection', this.sectionId), [['title', main.portal.strings['hide'] ]]); YAHOO.util.Event.addListener(viewbutton, 'click', this.toggle_hide, this,true); commandContainer.appendChild(viewbutton); @@ -103,7 +103,7 @@ section_class.prototype.init_buttons = function() { section_class.prototype.add_handle = function() { - var handleRef = main.mk_button('a', '/i/move_2d.gif', main.getString('movesection', this.sectionId), + var handleRef = main.mk_button('a', main.portal.icons['move_2d'], main.getString('movesection', this.sectionId), [['title', main.portal.strings['move'] ], ['style','cursor:move']]); YAHOO.util.Dom.generateId(handleRef, 'sectionHandle'); @@ -620,7 +620,7 @@ resource_class.prototype.init_buttons = function() { commandContainer.innerHTML = ''; // Add move-handle for drag and drop. - var handleRef = main.mk_button('a', '/i/move_2d.gif', main.portal.strings['move'], + var handleRef = main.mk_button('a', main.portal.icons['move_2d'], main.portal.strings['move'], [['style', 'cursor:move']], [['height', '11'], ['width', '11'], ['style', 'margin-right:3px; border:0;']]); @@ -631,7 +631,7 @@ resource_class.prototype.init_buttons = function() { // Add indentation buttons if needed (move left, move right). if (moveLeft) { - var button = main.mk_button('a', (isrtl?'/t/right.gif':'/t/left.gif'), main.portal.strings['moveleft'], + var button = main.mk_button('a', main.portal.icons['backwards'], main.portal.strings['moveleft'], [['class', 'editing_moveleft']]); YAHOO.util.Event.addListener(button, 'click', this.indent_left, this, true); commandContainer.appendChild(button); @@ -639,7 +639,7 @@ resource_class.prototype.init_buttons = function() { } if (moveRight) { - var button = main.mk_button('a', (isrtl?'/t/left.gif':'/t/right.gif'), main.portal.strings['moveright'], + var button = main.mk_button('a', main.portal.icons['forwards'], main.portal.strings['moveright'], [['class', 'editing_moveright']]); YAHOO.util.Event.addListener(button, 'click', this.indent_right, this, true); commandContainer.appendChild(button); @@ -650,15 +650,15 @@ resource_class.prototype.init_buttons = function() { commandContainer.appendChild(updateButton); // Add the delete button. - var button = main.mk_button('a', '/t/delete.gif', main.portal.strings['delete']); + var button = main.mk_button('a', main.portal.icons['delete'], main.portal.strings['delete']); YAHOO.util.Event.addListener(button, 'click', this.delete_button, this, true); commandContainer.appendChild(button); // Add the hide or show button. if (this.hidden) { - var button = main.mk_button('a', '/t/show.gif', main.portal.strings['show']); + var button = main.mk_button('a', main.portal.icons['show'], main.portal.strings['show']); } else { - var button = main.mk_button('a', '/t/hide.gif', main.portal.strings['hide']); + var button = main.mk_button('a', main.portal.icons['hide'], main.portal.strings['hide']); } YAHOO.util.Event.addListener(button, 'click', this.toggle_hide, this, true); commandContainer.appendChild(button); @@ -667,11 +667,11 @@ resource_class.prototype.init_buttons = function() { // Add the groupmode button if needed. if (this.groupmode != null) { if (this.groupmode == this.NOGROUPS) { - var button = main.mk_button('a', '/t/groupn.gif', strgroupsnone); + var button = main.mk_button('a', main.portal.icons['groupn'], strgroupsnone); } else if (this.groupmode == this.SEPARATEGROUPS) { - var button = main.mk_button('a', '/t/groups.gif', strgroupsseparate); + var button = main.mk_button('a', main.portal.icons['groups'], strgroupsseparate); } else { - var button = main.mk_button('a', '/t/groupv.gif', strgroupsvisible); + var button = main.mk_button('a', main.portal.icons['groupv'], strgroupsvisible); } YAHOO.util.Event.addListener(button, 'click', this.toggle_groupmode, this, true); commandContainer.appendChild(button); @@ -719,7 +719,7 @@ resource_class.prototype.indent_right = function() { if (!spacer) { var spacer = document.createElement('img'); - spacer.setAttribute('src', main.portal.strings['pixpath']+'/spacer.gif'); + spacer.setAttribute('src', main.portal.strings['spacerimg']); spacer.className = 'spacer'; spacer.setAttribute('alt', ''); spacer.setAttribute('width', '20'); @@ -735,7 +735,7 @@ resource_class.prototype.indent_right = function() { 'span', this.getEl())[0]; if (!this.indentLeftButton) { - var button = main.mk_button('a', (isrtl?'/t/right.gif':'/t/left.gif'), main.portal.strings['moveleft'], + var button = main.mk_button('a', main.portal.icons['backwards'], main.portal.strings['moveleft'], [['class', 'editing_moveleft']]); YAHOO.util.Event.addListener(button, 'click', this.indent_left, this, true); commandContainer.insertBefore(button, this.indentRightButton); @@ -779,7 +779,7 @@ resource_class.prototype.toggle_hide = function(target, e, superficial, force) { } -resource_class.prototype.groupImages = ['/t/groupn.gif', '/t/groups.gif', '/t/groupv.gif']; +resource_class.prototype.groupImages = ['groupn', 'groups', 'groupvf']; resource_class.prototype.toggle_groupmode = function() { @@ -805,7 +805,7 @@ resource_class.prototype.toggle_groupmode = function() { this.groupButton.getElementsByTagName('img')[0].alt = newtitle; this.groupButton.title = newtitle; - this.groupButton.getElementsByTagName('img')[0].src = main.portal.strings['pixpath']+this.groupImages[this.groupmode]; + this.groupButton.getElementsByTagName('img')[0].src = main.portal.icons[this.groupImages[this.groupmode]]; main.connect('POST', 'class=resource&field=groupmode', null, 'value='+this.groupmode+'&id='+this.id); } diff --git a/lib/form/filemanager.php b/lib/form/filemanager.php index ecc343e23a..0f23323db2 100644 --- a/lib/form/filemanager.php +++ b/lib/form/filemanager.php @@ -208,7 +208,7 @@ function rm_file(id, name, context) { function fp_callback(obj) { var list = document.getElementById('draftfiles-'+obj.client_id); var html = '
  • '+obj['file']+' '; - html += '';; + html += '';; html += '
  • '; list.innerHTML += html; } diff --git a/lib/questionlib.php b/lib/questionlib.php index 926ab4bb14..5833a7c2b8 100644 --- a/lib/questionlib.php +++ b/lib/questionlib.php @@ -1468,8 +1468,8 @@ function question_get_feedback_image($fraction, $selected=true) { $size = 'small'; } $class = question_get_feedback_class($fraction); - return ''; + return '' . get_string($class, 'quiz') . ''; } /** @@ -2091,17 +2091,16 @@ function question_format_grade($cmoptions, $grade) { } /** - * - * @global object * @return string An inline script that creates a JavaScript object storing * various strings and bits of configuration that the scripts in qengine.js need * to get from PHP. */ -function question_init_qenginejs_script() { - global $CFG, $PAGE; +function question_init_qengine_js() { + global $CFG, $PAGE, $OUTPUT; $config = array( - 'pixpath' => $CFG->pixpath, - 'wwwroot' => $CFG->wwwroot, + 'actionurl' => $CFG->wwwroot . '/question/toggleflag.php', + 'flagicon' => $OUTPUT->old_icon_url('i/flagged'), + 'unflagicon' => $OUTPUT->old_icon_url('i/unflagged'), 'flagtooltip' => get_string('clicktoflag', 'question'), 'unflagtooltip' => get_string('clicktounflag', 'question'), 'flaggedalt' => get_string('flagged', 'question'), @@ -2123,8 +2122,6 @@ function question_init_qenginejs_script() { * Must contain all the questions in $questionlist * @param array $states an array of question state objects, whose keys are question ids. * Must contain the state of all the questions in $questionlist - * - * @return string Deprecated. Some HTML code that can go inside the head tag. */ function get_html_head_contributions($questionlist, &$questions, &$states) { global $CFG, $PAGE, $QTYPES; @@ -2132,6 +2129,7 @@ function get_html_head_contributions($questionlist, &$questions, &$states) { // The question engine's own JavaScript. $PAGE->requires->yui_lib('connection'); $PAGE->requires->js('question/qengine.js'); + question_init_qengine_js(); // Anything that questions on this page need. foreach ($questionlist as $questionid) { diff --git a/lib/weblib.php b/lib/weblib.php index 725db41761..a1a1a3fc91 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -2086,7 +2086,7 @@ function replace_smilies(&$text) { * @return string HTML for a list of smilies. */ function get_emoticons_list_for_help_file() { - global $CFG, $SESSION, $PAGE; + global $CFG, $SESSION, $PAGE, $OUTPUT; if (empty($CFG->emoticons)) { return ''; } @@ -2095,7 +2095,7 @@ function get_emoticons_list_for_help_file() { $output = ''; diff --git a/message/lib.php b/message/lib.php index 074bea693d..d3dee92d01 100644 --- a/message/lib.php +++ b/message/lib.php @@ -540,23 +540,23 @@ function message_contact_link($userid, $linktype='add', $return=false, $script=" switch ($linktype) { case 'block': - $icon = '/t/go.gif'; + $icon = 't/go'; break; case 'unblock': - $icon = '/t/stop.gif'; + $icon = 't/stop'; break; case 'remove': - $icon = '/t/user.gif'; + $icon = 't/user'; break; case 'add': default: - $icon = '/t/usernot.gif'; + $icon = 't/usernot'; } $output = ''. ''. - ''.s($alttext).''. + ''.s($alttext).''. $text.''; if ($return) { diff --git a/mod/glossary/editcategories.php b/mod/glossary/editcategories.php index 871989f221..0de8b1f32d 100644 --- a/mod/glossary/editcategories.php +++ b/mod/glossary/editcategories.php @@ -202,8 +202,8 @@ id&action=delete&mode=cat&hook=$category->id\">\""pixpath}/t/delete.gif\" class=\"iconsmall\" /> "; - echo "id&action=edit&mode=cat&hook=$category->id\">\""pixpath}/t/edit.gif\" class=\"iconsmall\" />"; + echo "id&action=delete&mode=cat&hook=$category->id\">\""old_icon_url('t/delete') . "\" class=\"iconsmall\" /> "; + echo "id&action=edit&mode=cat&hook=$category->id\">\""old_icon_url('t/edit') . "\" class=\"iconsmall\" />"; ?> diff --git a/question/contextmove_form.php b/question/contextmove_form.php index c025729542..1c4618ef89 100644 --- a/question/contextmove_form.php +++ b/question/contextmove_form.php @@ -5,7 +5,7 @@ require_once($CFG->libdir.'/formslib.php'); class question_context_move_form extends moodleform { function definition() { - global $CFG; + global $CFG. $OUTPUT; $mform =& $this->_form; //-------------------------------------------------------------------------------- @@ -25,9 +25,9 @@ class question_context_move_form extends moodleform { $i = 0; foreach (array_keys($urls) as $url){ - $iconname = mimeinfo('icon', $url); + $iconname = str_replace(array('.gif', '.png'), '', mimeinfo('icon', $url)); $icontype = mimeinfo('type', $url); - $img = "pixpath/f/$iconname\" class=\"icon\" alt=\"$icontype\" />"; + $img = "old_icon_url('f/' . $iconname) . "\" class=\"icon\" alt=\"$icontype\" />"; if (in_array($url, $brokenurls)){ $mform->addElement('select', "urls[$i]", $img.$url, $brokenfileoptions); } else { diff --git a/question/contextmoveq_form.php b/question/contextmoveq_form.php index 0d59bf8066..94b21f0a2e 100644 --- a/question/contextmoveq_form.php +++ b/question/contextmoveq_form.php @@ -26,9 +26,9 @@ class question_context_move_question_form extends moodleform { $i = 0; foreach (array_keys($urls) as $url){ - $iconname = mimeinfo('icon', $url); + $iconname = str_replace(array('.gif', '.png'), '', mimeinfo('icon', $url)); $icontype = mimeinfo('type', $url); - $img = "pixpath/f/$iconname\" class=\"icon\" alt=\"$icontype\" />"; + $img = "old_icon_url('f/$iconname') . "\" class=\"icon\" alt=\"$icontype\" />"; if (in_array($url, $brokenurls)){ $mform->addElement('select', "urls[$i]", $img.$url, $brokenfileoptions); } else { diff --git a/question/qengine.js b/question/qengine.js index c159f75122..e341089ca0 100644 --- a/question/qengine.js +++ b/question/qengine.js @@ -49,18 +49,18 @@ question_flag_changer = { } else { postdata += '&newstate=0' } - YAHOO.util.Connect.asyncRequest('POST', qengine_config.wwwroot + '/question/toggleflag.php', null, postdata); + YAHOO.util.Connect.asyncRequest('POST', qengine_config.actionurl, null, postdata); question_flag_changer.fire_state_changed(input); YAHOO.util.Event.preventDefault(e); }, update_image: function(image) { if (image.statestore.value == 1) { - image.src = qengine_config.pixpath + '/i/flagged.png'; + image.src = qengine_config.flagicon; image.alt = qengine_config.flaggedalt; image.title = qengine_config.unflagtooltip; } else { - image.src = qengine_config.pixpath + '/i/unflagged.png'; + image.src = qengine_config.unflagicon; image.alt = qengine_config.unflaggedalt; image.title = qengine_config.flagtooltip; } diff --git a/question/type/questiontype.php b/question/type/questiontype.php index ba8dc3ef69..e7a254fab6 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -1003,16 +1003,16 @@ class default_questiontype { * @return string the img tag. */ protected function get_question_flag_tag($flagged, $id = '') { - global $CFG; + global $OUTPUT; if ($id) { $id = 'id="' . $id . '" '; } if ($flagged) { - $img = 'flagged.png'; + $img = 'i/flagged'; } else { - $img = 'unflagged.png'; + $img = 'i/unflagged'; } - return 'old_icon_url($img) . '" alt="' . get_string('flagthisquestion', 'question') . '" />'; } diff --git a/repository/lib.php b/repository/lib.php index 1a07ae0849..a7cc5c49d7 100644 --- a/repository/lib.php +++ b/repository/lib.php @@ -960,7 +960,7 @@ abstract class repository { 'date' => $filedate, //'source' => $child->get_url(), 'source' => base64_encode($source), - 'thumbnail' => $CFG->pixpath .'/f/'. mimeinfo('icon32', $filename) + 'thumbnail' => $OUTPUT->old_icon_url('f/'. str_replace(array('.gif', '.png'), '', mimeinfo('icon32', $filename))) ); $filecount++; } diff --git a/repository/wikimedia/repository.class.php b/repository/wikimedia/repository.class.php index 9b9801a939..bc76c06737 100644 --- a/repository/wikimedia/repository.class.php +++ b/repository/wikimedia/repository.class.php @@ -7,7 +7,7 @@ class repository_wikimedia extends repository { $this->keyword = optional_param('wikimedia_keyword', '', PARAM_RAW); } public function get_listing($path = '', $page = '') { - global $CFG; + global $OUTPUT; $client = new wikimedia; $result = $client->search_images($this->keyword); $list = array(); @@ -15,7 +15,7 @@ class repository_wikimedia extends repository { foreach ($result as $title=>$url) { $list['list'][] = array( 'title'=>substr($title, 5), - 'thumbnail'=>$CFG->pixpath.'/f/'.mimeinfo('icon32', 'xx.jpg'), + 'thumbnail'=>$OUTPUT->old_icon_url('f/'.str_replace(array('.gif', '.png'), '', mimeinfo('icon32', 'xx.jpg'))), // plugin-dependent unique path to the file (id, url, path, etc.) 'source'=>$url, // the accessible url of the file diff --git a/user/index.php b/user/index.php index f604cc24a3..72ae306808 100644 --- a/user/index.php +++ b/user/index.php @@ -736,7 +736,7 @@ $user = make_context_subobj($user); if ( !empty($user->hidden) ) { // if the assignment is hidden, display icon - $hidden = " pixpath}/t/show.gif\" title=\"".get_string('userhashiddenassignments', 'role')."\" alt=\"".get_string('hiddenassign')."\" class=\"hide-show-image\"/>"; + $hidden = " old_icon_url('t/show') . "\" title=\"".get_string('userhashiddenassignments', 'role')."\" alt=\"".get_string('hiddenassign')."\" class=\"hide-show-image\"/>"; } else { $hidden = ''; } diff --git a/user/portfolio.php b/user/portfolio.php index 2d79dd24d1..c413fbe0af 100644 --- a/user/portfolio.php +++ b/user/portfolio.php @@ -90,7 +90,7 @@ if ($display) { $table->data[] = array($i->get('name'), $i->get('plugin'), ($i->has_user_config() ? '' . get_string('configure') . '' : '') . - ' ' . get_string($visible ? 'hide' : 'show') . '
    ' + ' ' . get_string($visible ? 'hide' : 'show') . '
    ' ); } diff --git a/user/selector/lib.php b/user/selector/lib.php index 5c8d1059c5..d8ac4e4976 100644 --- a/user/selector/lib.php +++ b/user/selector/lib.php @@ -626,7 +626,7 @@ abstract class user_selector_base { * @return any HTML needed here. */ protected function initialise_javascript($search) { - global $USER, $PAGE; + global $USER, $PAGE, $OUTPUT; $output = ''; // Put the options into the session, to allow search.php to respond to the ajax requests. @@ -637,7 +637,7 @@ abstract class user_selector_base { // Initialise the selector. $PAGE->requires->js_function_call('new user_selector', array($this->name, $hash, $this->extrafields, $search, get_string('previouslyselectedusers', '', '%%SEARCHTERM%%'), - get_string('nomatchingusers', '', '%%SEARCHTERM%%'), get_string('none')), true); + get_string('nomatchingusers', '', '%%SEARCHTERM%%'), get_string('none'), $OUTPUT->old_icon_url('i/loading'))); return $output; } diff --git a/user/selector/script.js b/user/selector/script.js index 0ced0bffbc..d8f051c3ed 100644 --- a/user/selector/script.js +++ b/user/selector/script.js @@ -11,12 +11,13 @@ * @param Array extrafields extra fields we are displaying for each user in addition to fullname. * @param String label used for the optgroup of users who are selected but who do not match the current search. */ -function user_selector(name, hash, extrafields, lastsearch, strprevselected, strnomatchingusers, strnone) { +function user_selector(name, hash, extrafields, lastsearch, strprevselected, strnomatchingusers, strnone, iconloading) { this.name = name; this.extrafields = extrafields; this.strprevselected = strprevselected; this.strnomatchingusers = strnomatchingusers; this.strnone = strnone; + this.iconloading = iconloading; this.searchurl = moodle_cfg.wwwroot + '/user/selector/search.php?selectorid=' + hash + '&sesskey=' + moodle_cfg.sesskey + '&search=' @@ -137,6 +138,14 @@ user_selector.prototype.strnomatchingusers = ''; */ user_selector.prototype.strnone = ''; +/** + * URL of the loading icon. + * + * @property iconloading + * @type String + */ +user_selector.prototype.iconloading = ''; + // Fields that configure the control's behaviour =============================== /** @@ -320,7 +329,7 @@ user_selector.prototype.send_query = function(forceresearch) { scope: this }); this.lastsearch = value; - this.listbox.style.background = 'url(' + moodle_cfg.pixpath + '/i/loading.gif) no-repeat center center'; + this.listbox.style.background = 'url(' + this.iconloading + ') no-repeat center center'; } /** diff --git a/user/view.php b/user/view.php index 491dc35d62..ec568f4c55 100644 --- a/user/view.php +++ b/user/view.php @@ -270,16 +270,16 @@ $switchparam = 'enable'; $switchtitle = get_string('emaildisable'); $switchclick = get_string('emailenableclick'); - $switchpix = 'emailno.gif'; + $switchpix = 't/emailno'; } else { $switchparam = 'disable'; $switchtitle = get_string('emailenable'); $switchclick = get_string('emaildisableclick'); - $switchpix = 'email.gif'; + $switchpix = 't/email'; } $emailswitch = " id&course=$course->id&$switchparam=1\">". - "pixpath/t/$switchpix\" alt=\"$switchclick\" />"; + "old_icon_url('$switchpix') . "\" alt=\"$switchclick\" />"; } else if ($currentuser) { /// Can only re-enable an email this way if ($user->emailstop) { // Include link that tells how to re-enable their email -- 2.39.5