}
function toHtml() {
- global $CFG, $USER, $COURSE;
+ global $CFG, $USER, $COURSE, $OUTPUT;
require_once("$CFG->dirroot/repository/lib.php");
$strdelete = get_string('confirmdeletefile', 'repository');
* @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);
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);
// 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.
$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;
}
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="" />';
}
/**
global $OUTPUT;
- static $pixpath = '';
static $rsspath = '';
//In site course, if no logged (userid), use admin->id. Bug 2048.
function rss_standard_header($title = NULL, $link = NULL, $description = NULL) {
global $CFG, $USER;
- static $pixpath = '';
-
$status = true;
$result = "";
*/
//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);
* @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');
$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;
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));
}
}
}
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));
}
}
}
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)));
}
}
* @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')));
$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
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>';
}
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));
// 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));
}
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);
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);
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);
}
}
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);