MDL-19690 fix some breakage.

This commit is contained in:
tjhunt 2009-07-02 12:35:13 +00:00
parent 5ef444007d
commit 42d5737a94
3 changed files with 5 additions and 8 deletions

View file

@ -1333,9 +1333,9 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
if (!empty($customicon)) { if (!empty($customicon)) {
if (substr($customicon, 0, 4) === 'mod/') { if (substr($customicon, 0, 4) === 'mod/') {
list($modname, $iconname) = explode('/', substr($customicon, 4), 2); list($modname, $iconname) = explode('/', substr($customicon, 4), 2);
$icon = $OUTPUT->mod_icon_url($iconname, $modname); $icon = $OUTPUT->mod_icon_url(str_replace(array('.gif', '.png'), '', $iconname), $modname);
} else { } else {
$icon = $OUTPUT->old_icon_url($customicon); $icon = $OUTPUT->old_icon_url(str_replace(array('.gif', '.png'), '', $customicon));
} }
} else { } else {
$icon = "" . $OUTPUT->mod_icon_url('icon', $mod->modname) . ""; $icon = "" . $OUTPUT->mod_icon_url('icon', $mod->modname) . "";

View file

@ -207,7 +207,7 @@ function print_cell($alignment='center', $text=' ', $class='') {
} }
function displaydir($file_info) { function displaydir($file_info) {
global $CFG; global $CFG, $OUTPUT;
$children = $file_info->get_children(); $children = $file_info->get_children();
$parent_info = $file_info->get_parent(); $parent_info = $file_info->get_parent();

View file

@ -84,8 +84,7 @@ class question_category_list_item extends list_item {
} }
} }
public function item_html($extraargs = array()){ public function item_html($extraargs = array()){
global $CFG; global $CFG, $OUTPUT;
$pixpath = $CFG->pixpath;
$str = $extraargs['str']; $str = $extraargs['str'];
$category = $this->item; $category = $this->item;
@ -101,7 +100,7 @@ class question_category_list_item extends list_item {
if (count($this->parentlist->records)!=1){ // don't allow delete if this is the last category in this context. if (count($this->parentlist->records)!=1){ // don't allow delete if this is the last category in this context.
$item .= '<a title="' . $str->delete . '" href="'.$this->parentlist->pageurl->out_action(array('delete'=>$this->id)).'"> $item .= '<a title="' . $str->delete . '" href="'.$this->parentlist->pageurl->out_action(array('delete'=>$this->id)).'">
<img src="' . $pixpath . '/t/delete.gif" class="iconsmall" alt="' .$str->delete. '" /></a>'; <img src="' . $OUTPUT->old_icon_url('t/delete.gif') . '" class="iconsmall" alt="' .$str->delete. '" /></a>';
} }
return $item; return $item;
@ -118,7 +117,6 @@ class question_category_list_item extends list_item {
class question_category_object { class question_category_object {
var $str; var $str;
var $pixpath;
/** /**
* Nested lists to display categories. * Nested lists to display categories.
* *
@ -173,7 +171,6 @@ class question_category_object {
$this->str->cancel = get_string('cancel'); $this->str->cancel = get_string('cancel');
$this->str->editcategories = get_string('editcategories', 'quiz'); $this->str->editcategories = get_string('editcategories', 'quiz');
$this->str->page = get_string('page'); $this->str->page = get_string('page');
$this->pixpath = $CFG->pixpath;
$this->pageurl = $pageurl; $this->pageurl = $pageurl;