mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-19690 - more $CFG->pixpath to $OUTPUT->old_icon_url
This commit is contained in:
parent
4d13d47060
commit
ddedf979b4
@ -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&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>";
|
||||
@ -4594,17 +4594,17 @@ class admin_setting_manageauths extends admin_setting {
|
||||
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;
|
||||
}
|
||||
@ -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&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>";
|
||||
@ -4758,17 +4758,17 @@ class admin_setting_manageeditors extends admin_setting {
|
||||
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;
|
||||
}
|
||||
@ -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 . '&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&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++;
|
||||
@ -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 . '&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";
|
||||
|
@ -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);
|
||||
|
@ -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>";
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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>';
|
||||
|
@ -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.'&'.$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) {
|
||||
|
@ -202,8 +202,8 @@
|
||||
</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>
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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') . '" />';
|
||||
}
|
||||
|
||||
|
@ -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++;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -736,7 +736,7 @@
|
||||
$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 = '';
|
||||
}
|
||||
|
@ -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 />'
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -11,12 +11,13 @@
|
||||
* @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';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -270,16 +270,16 @@
|
||||
$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
|
||||
|
Loading…
x
Reference in New Issue
Block a user