]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19690 - more $CFG->pixpath to $OUTPUT->old_icon_url
authortjhunt <tjhunt>
Fri, 3 Jul 2009 06:19:25 +0000 (06:19 +0000)
committertjhunt <tjhunt>
Fri, 3 Jul 2009 06:19:25 +0000 (06:19 +0000)
21 files changed:
lib/adminlib.php
lib/ajax/ajaxcourse.js
lib/ajax/ajaxlib.php
lib/ajax/block_classes.js
lib/ajax/section_classes.js
lib/form/filemanager.php
lib/questionlib.php
lib/weblib.php
message/lib.php
mod/glossary/editcategories.php
question/contextmove_form.php
question/contextmoveq_form.php
question/qengine.js
question/type/questiontype.php
repository/lib.php
repository/wikimedia/repository.class.php
user/index.php
user/portfolio.php
user/selector/lib.php
user/selector/script.js
user/view.php

index 9d51420d123979e0174c69ac019d8c889ab6cf74..62e7408c57e91ea0243f04c3464edd75c1aeb9cd 100644 (file)
@@ -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 = "<a href=\"$url&amp;action=disable&amp;auth=$auth\">";
-                $hideshow .= "<img src=\"{$CFG->pixpath}/i/hide.gif\" class=\"icon\" alt=\"disable\" /></a>";
+                $hideshow .= "<img src=\"" . $OUTPUT->old_icon_url('i/hide') . "\" class=\"icon\" alt=\"disable\" /></a>";
                 // $hideshow = "<a href=\"$url&amp;action=disable&amp;auth=$auth\"><input type=\"checkbox\" checked /></a>";
                 $enabled = true;
                 $displayname = "<span>$name</span>";
             }
             else {
                 $hideshow = "<a href=\"$url&amp;action=enable&amp;auth=$auth\">";
-                $hideshow .= "<img src=\"{$CFG->pixpath}/i/show.gif\" class=\"icon\" alt=\"enable\" /></a>";
+                $hideshow .= "<img src=\"" . $OUTPUT->old_icon_url('i/show') . "\" class=\"icon\" alt=\"enable\" /></a>";
                 // $hideshow = "<a href=\"$url&amp;action=enable&amp;auth=$auth\"><input type=\"checkbox\" /></a>";
                 $enabled = false;
                 $displayname = "<span class=\"dimmed_text\">$name</span>";
@@ -4594,17 +4594,17 @@ class admin_setting_manageauths extends admin_setting {
             if ($enabled) {
                 if ($updowncount > 1) {
                     $updown .= "<a href=\"$url&amp;action=up&amp;auth=$auth\">";
-                    $updown .= "<img src=\"{$CFG->pixpath}/t/up.gif\" alt=\"up\" /></a>&nbsp;";
+                    $updown .= "<img src=\"" . $OUTPUT->old_icon_url('t/up') . "\" alt=\"up\" /></a>&nbsp;";
                 }
                 else {
-                    $updown .= "<img src=\"{$CFG->pixpath}/spacer.gif\" class=\"icon\" alt=\"\" />&nbsp;";
+                    $updown .= "<img src=\"" . $OUTPUT->old_icon_url('spacer.gif') . "\" class=\"icon\" alt=\"\" />&nbsp;";
                 }
                 if ($updowncount < $authcount) {
                     $updown .= "<a href=\"$url&amp;action=down&amp;auth=$auth\">";
-                    $updown .= "<img src=\"{$CFG->pixpath}/t/down.gif\" alt=\"down\" /></a>";
+                    $updown .= "<img src=\"" . $OUTPUT->old_icon_url('t/down') . "\" alt=\"down\" /></a>";
                 }
                 else {
-                    $updown .= "<img src=\"{$CFG->pixpath}/spacer.gif\" class=\"icon\" alt=\"\" />";
+                    $updown .= "<img src=\"" . $OUTPUT->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 = "<a href=\"$url&amp;action=disable&amp;editor=$editor\">";
-                $hideshow .= "<img src=\"{$CFG->pixpath}/i/hide.gif\" class=\"icon\" alt=\"disable\" /></a>";
+                $hideshow .= "<img src=\"" . $OUTPUT->old_icon_url('i/hide') . "\" class=\"icon\" alt=\"disable\" /></a>";
                 // $hideshow = "<a href=\"$url&amp;action=disable&amp;editor=$editor\"><input type=\"checkbox\" checked /></a>";
                 $enabled = true;
                 $displayname = "<span>$name</span>";
             }
             else {
                 $hideshow = "<a href=\"$url&amp;action=enable&amp;editor=$editor\">";
-                $hideshow .= "<img src=\"{$CFG->pixpath}/i/show.gif\" class=\"icon\" alt=\"enable\" /></a>";
+                $hideshow .= "<img src=\"" . $OUTPUT->old_icon_url('i/show') . "\" class=\"icon\" alt=\"enable\" /></a>";
                 // $hideshow = "<a href=\"$url&amp;action=enable&amp;editor=$editor\"><input type=\"checkbox\" /></a>";
                 $enabled = false;
                 $displayname = "<span class=\"dimmed_text\">$name</span>";
@@ -4758,17 +4758,17 @@ class admin_setting_manageeditors extends admin_setting {
             if ($enabled) {
                 if ($updowncount > 1) {
                     $updown .= "<a href=\"$url&amp;action=up&amp;editor=$editor\">";
-                    $updown .= "<img src=\"{$CFG->pixpath}/t/up.gif\" alt=\"up\" /></a>&nbsp;";
+                    $updown .= "<img src=\"" . $OUTPUT->old_icon_url('t/up') . "\" alt=\"up\" /></a>&nbsp;";
                 }
                 else {
-                    $updown .= "<img src=\"{$CFG->pixpath}/spacer.gif\" class=\"icon\" alt=\"\" />&nbsp;";
+                    $updown .= "<img src=\"" . $OUTPUT->old_icon_url('spacer.gif') . "\" class=\"icon\" alt=\"\" />&nbsp;";
                 }
                 if ($updowncount < $editorcount) {
                     $updown .= "<a href=\"$url&amp;action=down&amp;editor=$editor\">";
-                    $updown .= "<img src=\"{$CFG->pixpath}/t/down.gif\" alt=\"down\" /></a>";
+                    $updown .= "<img src=\"" . $OUTPUT->old_icon_url('t/down') . "\" alt=\"down\" /></a>";
                 }
                 else {
-                    $updown .= "<img src=\"{$CFG->pixpath}/spacer.gif\" class=\"icon\" alt=\"\" />";
+                    $updown .= "<img src=\"" . $OUTPUT->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 .=  '<img src="' . $OUTPUT->old_icon_url('t/show') . '" alt="' . get_string('hidden', 'portfolio') . '" />' . "\n";
             } else {
-                $row .= ' <a href="' . $this->baseurl . '&hide=' . $i->get('id') . '"><img src="' . $CFG->pixpath . '/t/'
-                    . ($i->get('visible') ? 'hide' : 'show') . '.gif" alt="' . get_string($i->get('visible') ? 'hide' : 'show') . '" /></a>' . "\n";
+                $row .= ' <a href="' . $this->baseurl . '&hide=' . $i->get('id') . '"><img src="' .
+                    $OUTPUT->old_icon_url('t/' . ($i->get('visible') ? 'hide' : 'show')) . '" alt="' . get_string($i->get('visible') ? 'hide' : 'show') . '" /></a>' . "\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 = ' <a href="' . $this->baseurl . '&amp;hide=' . $i->get_typename() . '">'
-                          .'<img src="' . $CFG->pixpath . '/i/' . ($i->get_visible() ? 'hide' : 'show') . '.gif"'
+                          .'<img src="' . $OUTPUT->old_icon_url('i/' . ($i->get_visible() ? 'hide' : 'show')) . '"'
                               .' alt="' . $hidetitle . '" '
                               .' title="' . $hidetitle . '" />'
                           .'</a>' . "\n";
@@ -5916,17 +5916,17 @@ class admin_setting_managerepository extends admin_setting {
 
                 if ($updowncount > 1) {
                     $updown .= "<a href=\"$this->baseurl&amp;move=up&amp;type=".$i->get_typename()."\">";
-                    $updown .= "<img src=\"{$CFG->pixpath}/t/up.gif\" alt=\"up\" /></a>&nbsp;";
+                    $updown .= "<img src=\"" . $OUTPUT->old_icon_url('t/up') . "\" alt=\"up\" /></a>&nbsp;";
                 }
                 else {
-                    $updown .= "<img src=\"{$CFG->pixpath}/spacer.gif\" class=\"icon\" alt=\"\" />&nbsp;";
+                    $updown .= "<img src=\"" . $OUTPUT->old_icon_url('spacer.gif') . "\" class=\"icon\" alt=\"\" />&nbsp;";
                 }
                 if ($updowncount < count($instances)) {
                     $updown .= "<a href=\"$this->baseurl&amp;move=down&amp;type=".$i->get_typename()."\">";
-                    $updown .= "<img src=\"{$CFG->pixpath}/t/down.gif\" alt=\"down\" /></a>";
+                    $updown .= "<img src=\"" . $OUTPUT->old_icon_url('t/down') . "\" alt=\"down\" /></a>";
                 }
                 else {
-                    $updown .= "<img src=\"{$CFG->pixpath}/spacer.gif\" class=\"icon\" alt=\"\" />";
+                    $updown .= "<img src=\"" . $OUTPUT->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 = ' <a href="' . $this->baseurl . '&amp;hide=' . $i->get_protocolid() . '">'
-                          .'<img src="' . $CFG->pixpath . '/i/' . ($i->get_enable() ? 'hide' : 'show') . '.gif"'
+                          .'<img src="' . $OUTPUT->old_icon_url('i/' . ($i->get_enable() ? 'hide' : 'show')) . '"'
                               .' alt="' . $hidetitle . '" '
                               .' title="' . $hidetitle . '" />'
                           .'</a>' . "\n";
index 09f11d634005ee963f21c46a66e8b18a5f75b63f..b18eaa23b208c58d6c42e5bbbd5df7241ed40e1f 100644 (file)
@@ -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);
index 56a034398118284e8b0d534dbf04bc47616f6a7b..d5406cb792e09b7686cee2b20e3598b09bb166b1 100644 (file)
@@ -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 .= "</script>";
index decb237b6f2a497eab9d024f845d8d0edaa6f6a5..2823f3ed148122164222c15791db0747784c8559 100644 (file)
@@ -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;
index c86260358d376264855cafe4522a4d23d85f6904..3a99f67bf49e22586830cae4326bbfa7eeff7d9b 100755 (executable)
@@ -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);
 }
 
index ecc343e23a77f7d868c9449699e84da9ce33af96..0f23323db2f3e8a5f47a0d4bed8e252f0db3617b 100644 (file)
@@ -208,7 +208,7 @@ function rm_file(id, name, context) {
 function fp_callback(obj) {
     var list = document.getElementById('draftfiles-'+obj.client_id);
     var html = '<li><a href="'+obj['url']+'"><img src="'+obj['icon']+'" class="icon" /> '+obj['file']+'</a> ';
-    html += '<a href="###" onclick=\'rm_file('+obj['id']+', "'+obj['file']+'", this)\'><img src="{$CFG->pixpath}/t/delete.gif" class="iconsmall" /></a>';;
+    html += '<a href="###" onclick=\'rm_file('+obj['id']+', "'+obj['file']+'", this)\'><img src="{$OUTPUT->old_icon_url('t/delete')}" class="iconsmall" /></a>';;
     html += '</li>';
     list.innerHTML += html;
 }
index 926ab4bb1416fa1f41c36c776d7858faecbd6e8e..5833a7c2b87033267813694d231d544a538381c2 100644 (file)
@@ -1468,8 +1468,8 @@ function question_get_feedback_image($fraction, $selected=true) {
         $size = 'small';
     }
     $class = question_get_feedback_class($fraction);
-    return '<img src="' . $CFG->pixpath.'/i/' . $icons[$class] . '_' . $size . '.gif" '.
-            'alt="' . get_string($class, 'quiz') . '" class="icon" />';
+    return '<img src="' . $OUTPUT->old_icon_url('i/' . $icons[$class] . '_' . $size) .
+            'alt="' . get_string($class, 'quiz') . '" class="icon" />';
 }
 
 /**
@@ -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) {
index 725db41761023a7cae3a43906868cc0421d01f7e..a1a1a3fc91b3e03e05431abcb410975940d886d6 100644 (file)
@@ -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 = '<ul id="emoticonlist">';
     foreach ($items as $item) {
         $item = explode('{:}', $item);
-        $output .= '<li><img src="' . $CFG->pixpath . '/s/' . $item[1] . '.gif" alt="' .
+        $output .= '<li><img src="' . $OUTPUT->old_icon_url('s/' . $item[1]) . '" alt="' .
                 $item[0] . '" /><code>' . $item[0] . '</code></li>';
     }
     $output .= '</ul>';
index 074bea693de36a2a29695f828ad4d55acdfd58e9..d3dee92d0104de624a88a32e2686f86f2d4b9b84 100644 (file)
@@ -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 = '<span class="'.$linktype.'">'.
               '<a href="'.$script.'&amp;'.$command.'='.$userid.
               '&amp;sesskey='.sesskey().'" title="'.s($string).'">'.
-              '<img src="'.$CFG->pixpath.$icon.'" class="iconsmall" alt="'.s($alttext).'" />'.
+              '<img src="'.$OUTPUT->old_icon_url($icon).'" class="iconsmall" alt="'.s($alttext).'" />'.
               $text.'</a></span>';
 
     if ($return) {
index 871989f221226208b2882813254ac583daa35fb4..0de8b1f32db1a4612da342b318eeff87d504595c 100644 (file)
                </td>
                <td style="width:10%" align="center"><b>
                <?php
-                echo "<a href=\"editcategories.php?id=$cm->id&amp;action=delete&amp;mode=cat&amp;hook=$category->id\"><img  alt=\"" . get_string("delete") . "\"src=\"{$CFG->pixpath}/t/delete.gif\" class=\"iconsmall\" /></a> ";
-                echo "<a href=\"editcategories.php?id=$cm->id&amp;action=edit&amp;mode=cat&amp;hook=$category->id\"><img  alt=\"" . get_string("edit") . "\" src=\"{$CFG->pixpath}/t/edit.gif\" class=\"iconsmall\" /></a>";
+                echo "<a href=\"editcategories.php?id=$cm->id&amp;action=delete&amp;mode=cat&amp;hook=$category->id\"><img  alt=\"" . get_string("delete") . "\"src=\"" . $OUTPUT->old_icon_url('t/delete') . "\" class=\"iconsmall\" /></a> ";
+                echo "<a href=\"editcategories.php?id=$cm->id&amp;action=edit&amp;mode=cat&amp;hook=$category->id\"><img  alt=\"" . get_string("edit") . "\" src=\"" . $OUTPUT->old_icon_url('t/edit') . "\" class=\"iconsmall\" /></a>";
                ?>
                </b></td>
              </tr>
index c025729542bb8c3c4f721085bb5fd6161426b7a1..1c4618ef89a67fc4265df48b9c3b2ab3d8dc8b60 100644 (file)
@@ -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 = "<img src=\"$CFG->pixpath/f/$iconname\"  class=\"icon\" alt=\"$icontype\" />";
+                $img = "<img src=\"" . $OUTPUT->old_icon_url('f/' . $iconname) . "\"  class=\"icon\" alt=\"$icontype\" />";
                 if (in_array($url, $brokenurls)){
                     $mform->addElement('select', "urls[$i]", $img.$url, $brokenfileoptions);
                 } else {
index 0d59bf80668ccc0c4ecacc742de3c6075521e306..94b21f0a2ec206d133f6187ad7c5134f9f7e3555 100644 (file)
@@ -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 = "<img src=\"$CFG->pixpath/f/$iconname\"  class=\"icon\" alt=\"$icontype\" />";
+                $img = "<img src=\"" . $OUTPUT->old_icon_url('f/$iconname') . "\"  class=\"icon\" alt=\"$icontype\" />";
                 if (in_array($url, $brokenurls)){
                     $mform->addElement('select', "urls[$i]", $img.$url, $brokenfileoptions);
                 } else {
index c159f751226f14dee4996e026e4d89bddcc8a1b3..e341089ca06b2749bfee06050258787dfd949a7c 100644 (file)
@@ -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;
         }
index ba8dc3ef69b51233f8f127d7bd97fd8d78dc85dc..e7a254fab6b3e9d9c7f108da4e3895cda533b958 100644 (file)
@@ -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 '<img ' . $id . 'src="' . $CFG->pixpath . '/i/' . $img .
+        return '<img ' . $id . 'src="' . $OUTPUT->old_icon_url($img) .
                 '" alt="' . get_string('flagthisquestion', 'question') . '" />';
     }
 
index 1a07ae0849d1698ca1526f417e6457ceb7183804..a7cc5c49d769a6e972c0cee618bfacf569f31cce 100644 (file)
@@ -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++;
             }
index 9b9801a939ff714dd76b26c7b3130a2c1ca289de..bc76c06737815b4196fd4523f29a2282c1face9e 100644 (file)
@@ -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
index f604cc24a3483e4c881462c817853406a213130a..72ae30680886f05efb201d9ac9b257aeca7e436e 100644 (file)
                 $user = make_context_subobj($user);
                 if ( !empty($user->hidden) ) {
                 // if the assignment is hidden, display icon
-                    $hidden = " <img src=\"{$CFG->pixpath}/t/show.gif\" title=\"".get_string('userhashiddenassignments', 'role')."\" alt=\"".get_string('hiddenassign')."\" class=\"hide-show-image\"/>";
+                    $hidden = " <img src=\"" . $OUTPUT->old_icon_url('t/show') . "\" title=\"".get_string('userhashiddenassignments', 'role')."\" alt=\"".get_string('hiddenassign')."\" class=\"hide-show-image\"/>";
                 } else {
                     $hidden = '';
                 }
index 2d79dd24d1291259265b93ca910de4ac5d08bfb9..c413fbe0af27bb9afed8276cdfd6839ef4fe7412 100644 (file)
@@ -90,7 +90,7 @@ if ($display) {
         $table->data[] = array($i->get('name'), $i->get('plugin'),
             ($i->has_user_config()
                 ?  '<a href="' . $baseurl . '?config=' . $i->get('id') . '"><img src="' . $OUTPUT->old_icon_url('t/edit') . '" alt="' . get_string('configure') . '" /></a>' : '') .
-                   ' <a href="' . $baseurl . '?hide=' . $i->get('id') . '"><img src="' . $CFG->pixpath . '/t/' . (($visible) ? 'hide' : 'show') . '.gif" alt="' . get_string($visible ? 'hide' : 'show') . '" /></a><br />'
+                   ' <a href="' . $baseurl . '?hide=' . $i->get('id') . '"><img src="' . $OUTPUT->old_icon_url('t/' . (($visible) ? 'hide' : 'show')) . '" alt="' . get_string($visible ? 'hide' : 'show') . '" /></a><br />'
         );
     }
 
index 5c8d1059c564aa1daf30fd34572ab6a8f592160a..d8ac4e4976046522162cc3ce66a094542c7d8505 100644 (file)
@@ -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;
     }
index 0ced0bffbc7a731e16805c4b1bd75ac35b385752..d8f051c3ed3c7fce9649fcbd568fff0e61ed289a 100644 (file)
  * @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';
 }
 
 /**
index 491dc35d62a35cb43fcc1f23e642e1de1e439061..ec568f4c555abf5b5c50a864f9ee66d1b359a36a 100644 (file)
                 $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 = "&nbsp;<a title=\"$switchclick\" ".
                            "href=\"view.php?id=$user->id&amp;course=$course->id&amp;$switchparam=1\">".
-                           "<img src=\"$CFG->pixpath/t/$switchpix\" alt=\"$switchclick\" /></a>";
+                           "<img src=\"" . $OUTPUT->old_icon_url('$switchpix') . "\" alt=\"$switchclick\" /></a>";
 
         } else if ($currentuser) {         /// Can only re-enable an email this way
             if ($user->emailstop) {   // Include link that tells how to re-enable their email