From: tjhunt Date: Fri, 3 Jul 2009 06:38:41 +0000 (+0000) Subject: MDL-19690 - more $CFG->pixpath to $OUTPUT->old_icon_url X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=a28c92539eb7e85fda3d9c8635a2bc6e14317d9f;p=moodle.git MDL-19690 - more $CFG->pixpath to $OUTPUT->old_icon_url --- diff --git a/lib/form/filemanager.php b/lib/form/filemanager.php index 0f23323db2..1acd7f2133 100644 --- a/lib/form/filemanager.php +++ b/lib/form/filemanager.php @@ -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'); diff --git a/lib/javascript-static.js b/lib/javascript-static.js index 0a9b89aaa2..dc131488ff 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -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. diff --git a/lib/listlib.php b/lib/listlib.php index 23a323501c..eb43e271d4 100644 --- a/lib/listlib.php +++ b/lib/listlib.php @@ -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 ' - ' . $action. ' '; + ' . $action. ' '; } function image_spacer() { - global $CFG; - $pixpath = $CFG->pixpath; - return ''; + global $OUTPUT; + return ''; } /** diff --git a/lib/rsslib.php b/lib/rsslib.php index 27a5fc486b..852c87101d 100644 --- a/lib/rsslib.php +++ b/lib/rsslib.php @@ -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); diff --git a/lib/weblib.php b/lib/weblib.php index a1a1a3fc91..1f6c52f1e8 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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 .= '
'; $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; diff --git a/question/editlib.php b/question/editlib.php index 260c1db1e4..0cab05061a 100644 --- a/question/editlib.php +++ b/question/editlib.php @@ -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))); } } diff --git a/repository/lib.php b/repository/lib.php index a7cc5c49d7..63e7ddadf8 100644 --- a/repository/lib.php +++ b/repository/lib.php @@ -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 diff --git a/repository/repository.src.js b/repository/repository.src.js index b15a395705..b4e2b211fb 100644 --- a/repository/repository.src.js +++ b/repository/repository.src.js @@ -460,10 +460,10 @@ repository_client.loading = function(id, type, name) { panel.get('element').innerHTML = ''; var str = '
'; if(type=='load') { - str += ''; + str += ''; str += '

'+fp_lang.loading+'

'; }else{ - str += ''; + str += ''; str += '

'+fp_lang.copying+' '+name+'

'; } str += '
'; @@ -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 = ' '+fp_lang.mgr; + mgr.innerHTML = ' '+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 = ' '+fp_lang.logout; + logout.innerHTML = ' '+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 = ' '+fp_lang['help']; + help.innerHTML = ' '+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);