]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19690 - more $CFG->pixpath to $OUTPUT->old_icon_url
authortjhunt <tjhunt>
Fri, 3 Jul 2009 06:38:41 +0000 (06:38 +0000)
committertjhunt <tjhunt>
Fri, 3 Jul 2009 06:38:41 +0000 (06:38 +0000)
lib/form/filemanager.php
lib/javascript-static.js
lib/listlib.php
lib/rsslib.php
lib/weblib.php
question/editlib.php
repository/lib.php
repository/repository.src.js

index 0f23323db2f3e8a5f47a0d4bed8e252f0db3617b..1acd7f21339ca296d25a3a0ce201e0832ee61126 100644 (file)
@@ -130,7 +130,7 @@ class MoodleQuickForm_filemanager extends HTML_QuickForm_element {
     }
 
     function toHtml() {
-        global $CFG, $USER, $COURSE;
+        global $CFG, $USER, $COURSE, $OUTPUT;
         require_once("$CFG->dirroot/repository/lib.php");
 
         $strdelete  = get_string('confirmdeletefile', 'repository');
index 0a9b89aaa22f78f5a28db43dd05fa816d1b9a3bc..dc131488ff1467aef708cec11f989c7d9249cecc 100644 (file)
@@ -876,9 +876,11 @@ function moodle_initialise_body() {
  * @param String userpref the user preference that records the state of this box. false if none.
  * @param Boolean startcollapsed whether the box should start collapsed.
  */
-function collapsible_region(id, userpref, strtooltip) {
+function collapsible_region(id, userpref, strtooltip, collapsedicon, expandedicon) {
     // Record the pref name
     this.userpref = userpref;
+    this.collapsedicon = collapsedicon;
+    this.expandedicon = expandedicon;
 
     // Find the divs in the document.
     this.div = document.getElementById(id);
@@ -912,9 +914,9 @@ function collapsible_region(id, userpref, strtooltip) {
     this.icon.id = id + '_icon';
     this.icon.alt = '';
     if (this.collapsed) {
-        this.icon.src = moodle_cfg.pixpath + '/t/collapsed.png';
+        this.icon.src = this.collapsedicon;
     } else {
-        this.icon.src = moodle_cfg.pixpath + '/t/expanded.png';
+        this.icon.src = this.expandedicon;
     }
     a.appendChild(this.icon);
 
@@ -987,9 +989,9 @@ collapsible_region.prototype.handle_click = function(e) {
 
     // Set the appropriate icon.
     if (this.collapsed) {
-        this.icon.src = moodle_cfg.pixpath + '/t/collapsed.png';
+        this.icon.src =this.collapsedicon;
     } else {
-        this.icon.src = moodle_cfg.pixpath + '/t/expanded.png';
+        this.icon.src = this.expandedicon;
     }
 
     // Update the user preference.
index 23a323501cbfff50a73dd60f36902ce57c2efcd9..eb43e271d40f28724ded66cf8489752efd46f4a7 100644 (file)
@@ -567,7 +567,6 @@ class list_item {
         $strmoveup = get_string('moveup');
         $strmovedown = get_string('movedown');
         $strmoveleft = get_string('maketoplevelitem', 'question');
-        $pixpath = $CFG->pixpath;
 
         if (isset($this->parentlist->parentitem)) {
             $parentitem =& $this->parentlist->parentitem;
@@ -602,16 +601,14 @@ class list_item {
     }
 
     function image_icon($action, $url, $icon) {
-        global $CFG;
-        $pixpath = $CFG->pixpath;
+        global $OUTPUT;
         return '<a title="' . $action .'" href="'.$url.'">
-                <img src="' . $pixpath . '/t/'.$icon.'.gif" class="iconsmall" alt="' . $action. '" /></a> ';
+                <img src="' . $OUTPUT->old_icon_url('t/'.$icon) . '" class="iconsmall" alt="' . $action. '" /></a> ';
     }
 
     function image_spacer() {
-        global $CFG;
-        $pixpath = $CFG->pixpath;
-        return '<img src="' . $pixpath . '/spacer.gif" class="iconsmall" alt="" />';
+        global $OUTPUT;
+        return '<img src="' . $OUTPUT->old_icon_url('spacer') . '" class="iconsmall" alt="" />';
     }
 
     /**
index 27a5fc486b32b906a55491fb385dbdecd9d5457c..852c87101dcab1eb4851029f639d760b68c4f4cf 100644 (file)
@@ -33,7 +33,6 @@ function rss_get_link($courseid, $userid, $modulename, $id, $tooltiptext='') {
 
     global $OUTPUT;
 
-    static $pixpath = '';
     static $rsspath = '';
 
     //In site course, if no logged (userid), use admin->id. Bug 2048.
@@ -172,8 +171,6 @@ function rss_file_name($modname, $mod) {
 function rss_standard_header($title = NULL, $link = NULL, $description = NULL) {
     global $CFG, $USER;
 
-    static $pixpath = '';
-
     $status = true;
     $result = "";
 
@@ -219,7 +216,7 @@ function rss_standard_header($title = NULL, $link = NULL, $description = NULL) {
        */
 
         //write image info
-        $rsspix = $CFG->pixpath."/i/rsssitelogo.gif";
+        $rsspix = $OUTPUT->old_icon_url('i/rsssitelogo');
 
         //write the info
         $result .= rss_start_tag('image', 2, true);
index a1a1a3fc91b3e03e05431abcb410975940d886d6..1f6c52f1e8c14eb0bba4d4154b1e5e496d9312d4 100644 (file)
@@ -2970,7 +2970,7 @@ function print_collapsible_region($contents, $classes, $id, $caption, $userpref
  * @return string|void if $return is false, returns nothing, otherwise returns a string of HTML.
  */
 function print_collapsible_region_start($classes, $id, $caption, $userpref = false, $default = false, $return = false) {
-    global $CFG, $PAGE;
+    global $CFG, $PAGE, $OUTPUT;
 
     // Include required JavaScript libraries.
     $PAGE->requires->yui_lib('animation');
@@ -2995,7 +2995,8 @@ function print_collapsible_region_start($classes, $id, $caption, $userpref = fal
     $output .= $caption . ' ';
     $output .= '</div><div id="' . $id . '_inner" class="collapsibleregioninner">';
     $PAGE->requires->js_function_call('new collapsible_region',
-            array($id, $userpref, get_string('clicktohideshow')));
+            array($id, $userpref, get_string('clicktohideshow'),
+            $OUTPUT->old_icon_url('t/collapsed'), $OUTPUT->old_icon_url('t/expanded')));
 
     if ($return) {
         return $output;
index 260c1db1e42cdeaeb158aa29d86fb97ba6e0db00..0cab05061a0a2b580105c3d58aca14f73e457bdf 100644 (file)
@@ -603,9 +603,9 @@ class question_bank_edit_action_column extends question_bank_action_column_base
     protected function display_content($question, $rowclasses) {
         if (question_has_capability_on($question, 'edit') ||
                 question_has_capability_on($question, 'move')) {
-            $this->print_icon('t/edit.gif', $this->stredit, $this->qbank->edit_question_url($question->id));
+            $this->print_icon('t/edit', $this->stredit, $this->qbank->edit_question_url($question->id));
         } else {
-            $this->print_icon('i/info.gif', $this->strview, $this->qbank->edit_question_url($question->id));
+            $this->print_icon('i/info', $this->strview, $this->qbank->edit_question_url($question->id));
         }
     }
 }
@@ -650,7 +650,7 @@ class question_bank_move_action_column extends question_bank_action_column_base
 
     protected function display_content($question, $rowclasses) {
         if (question_has_capability_on($question, 'move')) {
-            $this->print_icon('t/move.gif', $this->strmove, $this->qbank->move_question_url($question->id));
+            $this->print_icon('t/move', $this->strmove, $this->qbank->move_question_url($question->id));
         }
     }
 }
@@ -675,9 +675,9 @@ class question_bank_delete_action_column extends question_bank_action_column_bas
     protected function display_content($question, $rowclasses) {
         if (question_has_capability_on($question, 'edit')) {
             if ($question->hidden) {
-                $this->print_icon('t/restore.gif', $this->strrestore, $this->qbank->base_url()->out(false, array('unhide' => $question->id)));
+                $this->print_icon('t/restore', $this->strrestore, $this->qbank->base_url()->out(false, array('unhide' => $question->id)));
             } else {
-                $this->print_icon('t/delete.gif', $this->strdelete,
+                $this->print_icon('t/delete', $this->strdelete,
                         $this->qbank->base_url()->out(false, array('deleteselected' => $question->id, 'q' . $question->id => 1)));
             }
         }
index a7cc5c49d769a6e972c0cee618bfacf569f31cce..63e7ddadf84bc3e7a7c8c9f67aaa66776bbab735 100644 (file)
@@ -1761,7 +1761,7 @@ function repository_head_setup() {
  * @return array
  */
 function repository_get_client($context, $id = '',  $accepted_filetypes = '*', $returnvalue = '*') {
-    global $CFG, $USER, $PAGE;
+    global $CFG, $USER, $PAGE, $OUTPUT;
 
     $ft = new file_type_to_ext();
     $image_file_ext = json_encode($ft->get_file_ext(array('image')));
@@ -1817,6 +1817,13 @@ function repository_get_client($context, $id = '',  $accepted_filetypes = '*', $
         $options = array();
         $context = get_system_context();
         $options['contextid'] = $context->id;
+        $options['icons']['loading'] = $OUTPUT->old_icon_url('i/loading');
+        $options['icons']['progressbar'] = $OUTPUT->old_icon_url('i/progressbar');
+        $options['icons']['search'] = $OUTPUT->old_icon_url('a/search');
+        $options['icons']['refresh'] = $OUTPUT->old_icon_url('a/refresh');
+        $options['icons']['setting'] = $OUTPUT->old_icon_url('a/setting');
+        $options['icons']['logout'] = $OUTPUT->old_icon_url('a/logout');
+        $options['icons']['help'] = $OUTPUT->old_icon_url('a/help');
         $options = json_encode($options);
         // fp_config includes filepicker options
 
index b15a39570568b2a79a8a34c3ef312678b63983ae..b4e2b211fb53b3c18217dcbb0290bba9e4f3a320 100644 (file)
@@ -460,10 +460,10 @@ repository_client.loading = function(id, type, name) {
     panel.get('element').innerHTML = '';
     var str = '<div style="text-align:center">';
     if(type=='load') {
-        str += '<img src="'+moodle_cfg.pixpath+'/i/loading.gif" />';
+        str += '<img src="'+fp_config.icons.loading+'" />';
         str += '<p>'+fp_lang.loading+'</p>';
     }else{
-        str += '<img src="'+moodle_cfg.pixpath+'/i/progressbar.gif" />';
+        str += '<img src="'+fp_config.icons.progressbar+'" />';
         str += '<p>'+fp_lang.copying+' <strong>'+name+'</strong></p>';
     }
     str += '</div>';
@@ -890,7 +890,7 @@ repository_client.print_footer = function(client_id) {
     }
     if(!fs.nosearch) {
         var img = document.createElement('img');
-        img.src = moodle_cfg.pixpath+'/a/search.png';
+        img.src = fp_config.icons.search;
         var search = document.createElement('A');
         search.href = '###';
         search.appendChild(document.createTextNode(fp_lang.search));
@@ -903,7 +903,7 @@ repository_client.print_footer = function(client_id) {
     // weather we use cache for this instance, this button will reload listing anyway
     if(!fs.norefresh) {
         var img = document.createElement('img');
-        img.src = moodle_cfg.pixpath+'/a/refresh.png';
+        img.src = fp_config.icons.refresh;
         var ccache = document.createElement('A');
         ccache.href = "###";
         ccache.appendChild(document.createTextNode(fp_lang.refresh));
@@ -923,7 +923,7 @@ repository_client.print_footer = function(client_id) {
     }
     if(fs.manage) {
         var mgr = document.createElement('A');
-        mgr.innerHTML = '<img src="'+moodle_cfg.pixpath+'/a/setting.png" /> '+fp_lang.mgr;
+        mgr.innerHTML = '<img src="'+fp_config.icons.setting+'" /> '+fp_lang.mgr;
         mgr.href = fs.manage;
         mgr.target = "_blank";
         oDiv.appendChild(mgr);
@@ -931,7 +931,7 @@ repository_client.print_footer = function(client_id) {
     if(!fs.nologin) {
         var logout = document.createElement('A');
         logout.href = '###';
-        logout.innerHTML = '<img src="'+moodle_cfg.pixpath+'/a/logout.png" /> '+fp_lang.logout;
+        logout.innerHTML = '<img src="'+fp_config.icons.logout+'" /> '+fp_lang.logout;
         oDiv.appendChild(logout);
         logout.onclick = function() {
             repository_client.logout(client_id, fs.repo_id);
@@ -941,7 +941,7 @@ repository_client.print_footer = function(client_id) {
         var help = document.createElement('A');
         help.href = fs.help;
         help.target = "_blank";
-        help.innerHTML = '<img src="'+moodle_cfg.pixpath+'/a/help.png" /> '+fp_lang['help'];
+        help.innerHTML = '<img src="'+fp_config.icons.help+'" /> '+fp_lang['help'];
         oDiv.appendChild(help);
     }
 }
@@ -1071,7 +1071,7 @@ repository_client.upload = function(client_id) {
         container.id = id+'_loading';
         container.style.textAlign='center';
         var img = document.createElement('IMG');
-        img.src = moodle_cfg.pixpath+'/i/progressbar.gif';
+        img.src = fp_config.icons.progressbar;
         var para = document.createElement('p');
         para.innerHTML = fp_lang.uploading;
         container.appendChild(para);