* @return string highlight
*/
public function output_html($data, $query='') {
- global $CFG;
+ global $CFG, $OUTPUT;
// display strings
// hide/show link
if (in_array($auth, $authsenabled)) {
$hideshow = "<a href=\"$url&action=disable&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&action=disable&auth=$auth\"><input type=\"checkbox\" checked /></a>";
$enabled = true;
$displayname = "<span>$name</span>";
}
else {
$hideshow = "<a href=\"$url&action=enable&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&action=enable&auth=$auth\"><input type=\"checkbox\" /></a>";
$enabled = false;
$displayname = "<span class=\"dimmed_text\">$name</span>";
if ($enabled) {
if ($updowncount > 1) {
$updown .= "<a href=\"$url&action=up&auth=$auth\">";
- $updown .= "<img src=\"{$CFG->pixpath}/t/up.gif\" alt=\"up\" /></a> ";
+ $updown .= "<img src=\"" . $OUTPUT->old_icon_url('t/up') . "\" alt=\"up\" /></a> ";
}
else {
- $updown .= "<img src=\"{$CFG->pixpath}/spacer.gif\" class=\"icon\" alt=\"\" /> ";
+ $updown .= "<img src=\"" . $OUTPUT->old_icon_url('spacer.gif') . "\" class=\"icon\" alt=\"\" /> ";
}
if ($updowncount < $authcount) {
$updown .= "<a href=\"$url&action=down&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;
}
* @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',
// hide/show link
if (in_array($editor, $active_editors)) {
$hideshow = "<a href=\"$url&action=disable&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&action=disable&editor=$editor\"><input type=\"checkbox\" checked /></a>";
$enabled = true;
$displayname = "<span>$name</span>";
}
else {
$hideshow = "<a href=\"$url&action=enable&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&action=enable&editor=$editor\"><input type=\"checkbox\" /></a>";
$enabled = false;
$displayname = "<span class=\"dimmed_text\">$name</span>";
if ($enabled) {
if ($updowncount > 1) {
$updown .= "<a href=\"$url&action=up&editor=$editor\">";
- $updown .= "<img src=\"{$CFG->pixpath}/t/up.gif\" alt=\"up\" /></a> ";
+ $updown .= "<img src=\"" . $OUTPUT->old_icon_url('t/up') . "\" alt=\"up\" /></a> ";
}
else {
- $updown .= "<img src=\"{$CFG->pixpath}/spacer.gif\" class=\"icon\" alt=\"\" /> ";
+ $updown .= "<img src=\"" . $OUTPUT->old_icon_url('spacer.gif') . "\" class=\"icon\" alt=\"\" /> ";
}
if ($updowncount < $editorcount) {
$updown .= "<a href=\"$url&action=down&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;
}
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)) {
* @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');
$hidetitle = $i->get_visible() ? get_string('clicktohide', 'repository') : get_string('clicktoshow', 'repository');
$hiddenshow = ' <a href="' . $this->baseurl . '&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";
if ($updowncount > 1) {
$updown .= "<a href=\"$this->baseurl&move=up&type=".$i->get_typename()."\">";
- $updown .= "<img src=\"{$CFG->pixpath}/t/up.gif\" alt=\"up\" /></a> ";
+ $updown .= "<img src=\"" . $OUTPUT->old_icon_url('t/up') . "\" alt=\"up\" /></a> ";
}
else {
- $updown .= "<img src=\"{$CFG->pixpath}/spacer.gif\" class=\"icon\" alt=\"\" /> ";
+ $updown .= "<img src=\"" . $OUTPUT->old_icon_url('spacer.gif') . "\" class=\"icon\" alt=\"\" /> ";
}
if ($updowncount < count($instances)) {
$updown .= "<a href=\"$this->baseurl&move=down&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++;
foreach ($protocols as $i) {
$hidetitle = $i->get_protocolid() ? get_string('clicktohide', 'repository') : get_string('clicktoshow', 'repository');
$hiddenshow = ' <a href="' . $this->baseurl . '&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";
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);
$config = array(
'wwwroot' => $CFG->httpswwwroot, // Yes, really. See above.
- 'pixpath' => $CFG->pixpath,
'sesskey' => sesskey(),
);
if (debugging('', DEBUG_DEVELOPER)) {
$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";
$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>";
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;
}
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);
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');
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;']]);
// 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);
}
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);
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);
// 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);
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');
'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);
}
-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() {
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);
}
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;
}
$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" />';
}
/**
}
/**
- *
- * @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'),
* 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;
// 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) {
* @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 '';
}
$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>';
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.'&'.$command.'='.$userid.
'&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) {
</td>
<td style="width:10%" align="center"><b>
<?php
- echo "<a href=\"editcategories.php?id=$cm->id&action=delete&mode=cat&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&action=edit&mode=cat&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&action=delete&mode=cat&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&action=edit&mode=cat&hook=$category->id\"><img alt=\"" . get_string("edit") . "\" src=\"" . $OUTPUT->old_icon_url('t/edit') . "\" class=\"iconsmall\" /></a>";
?>
</b></td>
</tr>
class question_context_move_form extends moodleform {
function definition() {
- global $CFG;
+ global $CFG. $OUTPUT;
$mform =& $this->_form;
//--------------------------------------------------------------------------------
$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 {
$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 {
} 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;
}
* @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') . '" />';
}
'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++;
}
$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();
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
$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 = '';
}
$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 />'
);
}
* @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.
// 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;
}
* @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='
*/
user_selector.prototype.strnone = '';
+/**
+ * URL of the loading icon.
+ *
+ * @property iconloading
+ * @type String
+ */
+user_selector.prototype.iconloading = '';
+
// Fields that configure the control's behaviour ===============================
/**
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';
}
/**
$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 = " <a title=\"$switchclick\" ".
"href=\"view.php?id=$user->id&course=$course->id&$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