closedalt: null,
openalt: null,
- init: function(numdivs, expandnodes, pixpath, openalt, closedalt) {
+ init: function(numdivs, expandnodes, openimg, closedimg, openalt, closedalt) {
// Store the information we were passed in.
- admin_tree.closedimg = pixpath + '/i/closed.gif';
- admin_tree.openimg = pixpath + '/i/open.gif';
- admin_tree.closedalt = closedalt;
+ admin_tree.openimg = openimg;
+ admin_tree.closedimg = closedimg;
admin_tree.openalt = openalt;
+ admin_tree.closedalt = closedalt;
admin_tree.numdivs = numdivs;
// Initialise the hiddennodes array.
}
function get_content() {
- global $CFG;
+ global $CFG, $OUTPUT;
if ($this->content !== NULL) {
return $this->content;
if ($this->tempcontent !== '') {
$this->page->requires->js('blocks/admin_tree/admintree.js');
$this->page->requires->js_function_call('admin_tree.init',
- array($this->divcounter - 1, $this->expandnodes, $CFG->pixpath,
+ array($this->divcounter - 1, $this->expandnodes,
+ $OUTPUT->old_icon_url('i/open'), $OUTPUT->old_icon_url('i/closed'),
get_string('folderopened'), get_string('folderclosed')));
$this->content = new object();
}
function get_content() {
- global $CFG, $USER, $DB;
+ global $CFG, $USER, $DB, $OUTPUT;
// only for logged in users!
if (!isloggedin() || isguest()) {
if ($hosts) {
foreach ($hosts as $host) {
- $icon = '<img src="'.$CFG->pixpath.'/i/'.$host->application.'_host.gif"'.
+ $icon = '<img src="'.$OUTPUT->old_icon_url('i/'.$host->application.'_host') . '"'.
' class="icon" alt="'.get_string('server', 'block_mnet_hosts').'" />';
$this->content->icons[]=$icon;
// RTL support - exchange right and left arrows
if (right_to_left()) {
- $rightarrow = 'left.gif';
- $leftarrow = 'right.gif';
+ $rightarrow = 't/left';
+ $leftarrow = 't/right';
} else {
- $rightarrow = 'right.gif';
- $leftarrow = 'left.gif';
+ $rightarrow = 't/right';
+ $leftarrow = 't/left';
}
$movebuttons = '<div class="commands">';
if ($this->instance->visible) {
- $icon = '/t/hide.gif';
+ $icon = 't/hide';
$title = $this->str->hide;
} else {
- $icon = '/t/show.gif';
+ $icon = 't/show';
$title = $this->str->show;
}
// TODO MDL-19010 fix and re-enable.
if (false && $this->user_can_edit()) {
$movebuttons .= '<a class="icon hide" title="'. $title .'" href="'.$script.'&blockaction=toggle">' .
- '<img src="'. $CFG->pixpath.$icon .'" alt="'.$title.'" /></a>';
+ '<img src="'. $OUTPUT->old_icon_url($icon) .'" alt="'.$title.'" /></a>';
}
if ($options & BLOCK_CONFIGURE && $this->user_can_edit()) {
if ($options & BLOCK_MOVE_LEFT) {
$movebuttons .= '<a class="icon left" title="'. $this->str->moveleft .'" href="'.$script.'&blockaction=moveleft">' .
- '<img src="'. $CFG->pixpath .'/t/'.$leftarrow.'" alt="'. $this->str->moveleft .'" /></a>';
+ '<img src="'. $OUTPUT->old_icon_url($leftarrow).'" alt="'. $this->str->moveleft .'" /></a>';
}
if ($options & BLOCK_MOVE_UP) {
$movebuttons .= '<a class="icon up" title="'. $this->str->moveup .'" href="'.$script.'&blockaction=moveup">' .
}
if ($options & BLOCK_MOVE_RIGHT) {
$movebuttons .= '<a class="icon right" title="'. $this->str->moveright .'" href="'.$script.'&blockaction=moveright">' .
- '<img src="'. $CFG->pixpath .'/t/'.$rightarrow.'" alt="'. $this->str->moveright .'" /></a>';
+ '<img src="'. $OUTPUT->old_icon_url($rightarrow).'" alt="'. $this->str->moveright .'" /></a>';
}
$movebuttons .= '</div>';
/// MDL-9291, blog this feature needs further discussion/implementation
/// temporarily disabling for now.
- // print '<img src="'. $CFG->pixpath .'/blog/blog.gif" alt="'. get_string('blogthis', 'blog').'" title="'. get_string('blogthis', 'blog') .'" border="0" align="middle" />'."\n";
+ // print '<img src="'. $OUTPUT->old_icon_url('blog/blog') . '" alt="'. get_string('blogthis', 'blog').'" title="'. get_string('blogthis', 'blog') .'" border="0" align="middle" />'."\n";
//print '<a href="'. $CFG->wwwroot .'/blog/blogthis.php?userid='. $USER->id .'&act=use&item='. $y .'&rssid='. $rssid .'"><small><strong>'. get_string('blogthis', 'blog') .'</strong></small></a>'."\n";
} else {
print '<td> ';
$filename = $file->get_filename();
$ffurl = file_encode_url($CFG->wwwroot.'/pluginfile.php', '/'.SYSCONTEXTID.'/blog/'.$blogentry->id.'/'.$filename);
$type = $file->get_mimetype();
- $icon = mimeinfo_from_type("icon", $type);
+ $icon = str_replace(array('.gif', '.png'), '', mimeinfo_from_type("icon", $type));
$type = mimeinfo_from_type("type", $type);
- $image = "<img src=\"$CFG->pixpath/f/$icon\" class=\"icon\" alt=\"\" />";
+ $image = "<img src=\"" . $OUTPUT->old_icon_url('f/' . $icon) . "\" class=\"icon\" alt=\"\" />";
if ($return == "html") {
$output .= "<a href=\"$ffurl\">$image</a> ";
}
}
if ($completionicon) {
- $imgsrc = $CFG->pixpath.'/i/completion-'.$completionicon.'.gif';
+ $imgsrc = $OUTPUT->old_icon_url('i/completion-'.$completionicon);
$imgalt = get_string('completion-alt-'.$completionicon,'completion');
if ($completion==COMPLETION_TRACKING_MANUAL && !$isediting) {
$imgtitle = get_string('completion-title-'.$completionicon,'completion');
* @param string $highlightterms (optional) some search terms that should be highlighted in the display.
*/
function print_course($course, $highlightterms = '') {
- global $CFG, $USER, $DB;
+ global $CFG, $USER, $DB, $OUTPUT;
if (isset($course->context)) {
$context = $course->context;
if ($ra->hidden == 0 || $canseehidden) {
$fullname = fullname($ra->user, $canviewfullnames);
if ($ra->hidden == 1) {
- $status = " <img src=\"{$CFG->pixpath}/t/show.gif\" title=\"".get_string('userhashiddenassignments', 'role')."\" alt=\"".get_string('hiddenassign')."\" class=\"hide-show-image\"/>";
+ $status = " <img src=\"" . $OUTPUT->old_icon_url('t/show') . "\" title=\"".get_string('userhashiddenassignments', 'role')."\" alt=\"".get_string('hiddenassign')."\" class=\"hide-show-image\"/>";
} else {
$status = '';
}
if (has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $mod->course))) {
if (right_to_left()) { // Exchange arrows on RTL
- $rightarrow = 'left.gif';
- $leftarrow = 'right.gif';
+ $rightarrow = 't/left.gif';
+ $leftarrow = 't/right.gif';
} else {
- $rightarrow = 'right.gif';
- $leftarrow = 'left.gif';
+ $rightarrow = 't/right.gif';
+ $leftarrow = 't/left.gif';
}
if ($indent > 0) {
$leftright .= '<a class="editing_moveleft" title="'.$str->moveleft.'" href="'.$path.'/mod.php?id='.$mod->id.
'&indent=-1&sesskey='.$sesskey.$section.'"><img'.
- ' src="'.$CFG->pixpath.'/t/'.$leftarrow.'" class="iconsmall" '.
+ ' src="'.$OUTPUT->old_icon_url($leftarrow).'" class="iconsmall" '.
' alt="'.$str->moveleft.'" /></a>'."\n";
}
if ($indent >= 0) {
$leftright .= '<a class="editing_moveright" title="'.$str->moveright.'" href="'.$path.'/mod.php?id='.$mod->id.
'&indent=1&sesskey='.$sesskey.$section.'"><img'.
- ' src="'.$CFG->pixpath.'/t/'.$rightarrow.'" class="iconsmall" '.
+ ' src="'.$OUTPUT->old_icon_url($rightarrow).'" class="iconsmall" '.
' alt="'.$str->moveright.'" /></a>'."\n";
}
}
print '<th scope="col" class="'.$activity->datepassedclass.'">'.
'<a href="'.$CFG->wwwroot.'/mod/'.$activity->modname.
'/view.php?id='.$activity->id.'">'.
- '<img src="'.$CFG->pixpath.'/mod/'.$activity->modname.'/icon.gif" alt="'.
+ '<img src="'.$OUTPUT->mod_icon_url('icon', $activity->modname).'/icon.gif" alt="'.
get_string('modulename',$activity->modname).'" /> <span class="completion-activityname">'.
format_string($activity->name).'</span></a>';
if($activity->completionexpected) {
print $sep.csv_quote($describe).$sep.csv_quote($date);
} else {
print '<td class="completion-progresscell '.$activity->datepassedclass.'">'.
- '<img src="'.$CFG->pixpath.'/i/'.$completionicon.
- '.gif" alt="'.$describe.'" title="'.$fulldescribe.'" /></td>';
+ '<img src="'.$OUTPUT->old_icon_url('i/'.$completionicon).
+ '" alt="'.$describe.'" title="'.$fulldescribe.'" /></td>';
}
}
echo "</td>\n";
echo "<td>\n";
- $pixpath = $CFG->pixpath;
// checks whether user can update course settings
if (has_capability('moodle/course:update', $coursecontext)) {
echo "<a title=\"".get_string("settings")."\" href=\"$CFG->wwwroot/course/edit.php?id=$course->id\">\n<img".
- " src=\"$pixpath/t/edit.gif\" class=\"iconsmall\" alt=\"".get_string("settings")."\" /></a>\n ";
+ " src=\"" . $OUTPUT->old_icon_url('t/edit') . "\" class=\"iconsmall\" alt=\"".get_string("settings")."\" /></a>\n ";
}
// checks whether user can do role assignment
// checks whether user can delete course
if (has_capability('moodle/course:delete', $coursecontext)) {
echo "<a title=\"".get_string("delete")."\" href=\"delete.php?id=$course->id\">\n<img".
- " src=\"$pixpath/t/delete.gif\" class=\"iconsmall\" alt=\"".get_string("delete")."\" /></a>\n ";
+ " src=\"" . $OUTPUT->old_icon_url('t/delete') . "\" class=\"iconsmall\" alt=\"".get_string("delete")."\" /></a>\n ";
}
// checks whether user can change visibility
if (has_capability('moodle/course:visibility', $coursecontext)) {
if (!empty($course->visible)) {
echo "<a title=\"".get_string("hide")."\" href=\"search.php?search=$encodedsearch&perpage=$perpage&page=$page&hide=$course->id&sesskey=".sesskey()."\">\n<img".
- " src=\"$pixpath/t/hide.gif\" class=\"iconsmall\" alt=\"".get_string("hide")."\" /></a>\n ";
+ " src=\"" . $OUTPUT->old_icon_url('t/hide') . "\" class=\"iconsmall\" alt=\"".get_string("hide")."\" /></a>\n ";
} else {
echo "<a title=\"".get_string("show")."\" href=\"search.php?search=$encodedsearch&perpage=$perpage&page=$page&show=$course->id&sesskey=".sesskey()."\">\n<img".
- " src=\"$pixpath/t/show.gif\" class=\"iconsmall\" alt=\"".get_string("show")."\" /></a>\n ";
+ " src=\"" . $OUTPUT->old_icon_url('t/show') . "\" class=\"iconsmall\" alt=\"".get_string("show")."\" /></a>\n ";
}
}
// checks whether user can do site backup
if (has_capability('moodle/site:backup', $coursecontext)) {
echo "<a title=\"".get_string("backup")."\" href=\"../backup/backup.php?id=$course->id\">\n<img".
- " src=\"$pixpath/t/backup.gif\" class=\"iconsmall\" alt=\"".get_string("backup")."\" /></a>\n ";
+ " src=\"" . $OUTPUT->old_icon_url('t/backup') . "\" class=\"iconsmall\" alt=\"".get_string("backup")."\" /></a>\n ";
}
// checks whether user can do restore
if (has_capability('moodle/site:restore', $coursecontext)) {
echo "<a title=\"".get_string("restore")."\" href=\"../files/index.php?id=$course->id&wdir=/backupdata\">\n<img".
- " src=\"$pixpath/t/restore.gif\" class=\"iconsmall\" alt=\"".get_string("restore")."\" /></a>\n ";
+ " src=\"" . $OUTPUT->old_icon_url('t/restore') . "\" class=\"iconsmall\" alt=\"".get_string("restore")."\" /></a>\n ";
}
echo "</td>\n</tr>\n";
}
} else {
- $icon = mimeinfo_from_type('icon', $mimetype);
+ $icon = str_replace(array('.gif', '.png'), '', mimeinfo_from_type('icon', $mimetype));
$viewurl = file_encode_url("$CFG->wwwroot/draftfile.php", "/$contextid/user_draft/$itemid".$filepath.$filename, false, false);
echo '<div class="file">';
- echo "<a href=\"$viewurl\"><img src=\"$CFG->pixpath/f/$icon\" class=\"icon\" alt=\"$strfile\" /> ".s($filename)." ($filesize)</a> ";
+ echo "<a href=\"$viewurl\"><img src=\"" . $OUTPUT->old_icon_url('f/' . $icon) . "\" class=\"icon\" alt=\"$strfile\" /> ".s($filename)." ($filesize)</a> ";
echo "<a href=\"draftfiles.php?itemid=$itemid&filepath=$filepath&delete=$filenameurl&subdirs=$subdirs&maxbytes=$maxbytes\"><img src=\"" . $OUTPUT->old_icon_url('t/delete') . "\" class=\"iconsmall\" alt=\"$strdelete\" /></a>";;
echo '</div>';
}
} else {
- $icon = mimeinfo_from_type("icon", $mimetype);
+ $icon = str_replace(array('.gif', '.png'), '', mimeinfo_from_type("icon", $mimetype));
if ($downloadurl = $child_info->get_url(true)) {
$downloadurl = " <a href=\"$downloadurl\" title=\"" . get_string('downloadfile') . "\"><img src=\"" . $OUTPUT->old_icon_url('t/down') . "\" class=\"iconsmall\" alt=\"$strdownload\" /></a>";
} else {
echo "<tr class=\"file\">";
print_cell();
- print_cell("left", "<img src=\"$CFG->pixpath/f/$icon\" class=\"icon\" alt=\"$strfile\" /> ".s($filename).$downloadurl.$viewurl, 'name');
+ print_cell("left", "<img src=\"" . $OUTPUT->old_icon_url('f/' . $icon) . "\" class=\"icon\" alt=\"$strfile\" /> ".s($filename).$downloadurl.$viewurl, 'name');
print_cell("right", $filesize, 'size');
print_cell("right", $filedate, 'date');
if ($parentwritable) {
'&eid='.$element['eid'];
$url = $gpr->add_url_params($url);
- $action = '<a href="'.$url.'" class="lock"><img src="'.$CFG->pixpath.
- '/t/'.$icon.'.gif" alt="'.s($strunlock).
+ $action = '<a href="'.$url.'" class="lock"><img src="'.$OUTPUT->old_icon_url('t/'.$icon).'" alt="'.s($strunlock).
'" class="iconsmall" title="'.s($tooltip).'"/></a>';
} else {
* @return string
*/
public function get_calculation_icon($element, $gpr) {
- global $CFG;
+ global $CFG, $OUTPUT;
if (!has_capability('moodle/grade:manage', $this->context)) {
return '';
}
// show calculation icon only when calculation possible
if (!$object->is_external_item() and ($is_scale or $is_value)) {
if ($object->is_calculated()) {
- $icon = 'calc.gif';
+ $icon = 't/calc';
} else {
- $icon = 'calc_off.gif';
+ $icon = 't/calc_off';
}
$url = $CFG->wwwroot.'/grade/edit/tree/calculation.php?courseid='.
$this->courseid.'&id='.$object->id;
$url = $gpr->add_url_params($url);
$calculation_icon = '<a href="'. $url.'" class="calculation">' .
- '<img src="'.$CFG->pixpath.'/t/'.$icon.'" class="iconsmall" alt="' .
+ '<img src="'.$OUTPUT->old_icon_url($icon).'" class="iconsmall" alt="' .
s($streditcalculation).'" title="'.s($streditcalculation).'" /></a>'. "\n";
}
}