--- question/category_class.php.orig 2011-06-10 10:23:32.000000000 +0300 +++ question/category_class.php 2011-06-10 16:01:28.000000000 +0300 @@ -66,14 +66,27 @@ "{$CFG->wwwroot}/question/category.php?".$this->parentlist->pageurl->get_query_string(array('edit'=>$category->id)), 'edit'); parent::set_icon_html($first, $last, $lastitem); $toplevel = ($this->parentlist->parentitem === null);//this is a top level item + if (isset($this->parentlist->parentitem)) { + $parentitem =& $this->parentlist->parentitem; + if (isset($parentitem->parentlist->parentitem)) { + $action = get_string('makechildof', 'question', format_string($parentitem->parentlist->parentitem->name)); + } else { + $action = get_string('maketoplevelitem', 'question'); + } + $this->icons['left'] = $this->image_icon($action, $this->parentlist->pageurl->out_action(array('left'=>$this->id)), 'left'); + } if (($this->parentlist->nextlist !== null) && $last && $toplevel && (count($this->parentlist->items)>1)){ - $this->icons['down'] = $this->image_icon(get_string('shareincontext', 'question', print_context_name($this->parentlist->nextlist->context)), + $this->icons['down'] = $this->image_icon(get_string('shareincontext', 'question', format_string(print_context_name($this->parentlist->nextlist->context))), $this->parentlist->pageurl->out_action(array('movedowncontext'=>$this->id, 'tocontext'=>$this->parentlist->nextlist->context->id)), 'down'); } if (($this->parentlist->lastlist !== null) && $first && $toplevel && (count($this->parentlist->items)>1)){ - $this->icons['up'] = $this->image_icon(get_string('shareincontext', 'question', print_context_name($this->parentlist->lastlist->context)), + $this->icons['up'] = $this->image_icon(get_string('shareincontext', 'question', format_string(print_context_name($this->parentlist->lastlist->context))), $this->parentlist->pageurl->out_action(array('moveupcontext'=>$this->id, 'tocontext'=>$this->parentlist->lastlist->context->id)), 'up'); } + if (!empty($lastitem)) { + $makechildof = get_string('makechildof', 'question', format_string($lastitem->name)); + $this->icons['right'] = $this->image_icon($makechildof, $this->parentlist->pageurl->out_action(array('right'=>$this->id)), 'right'); + } } function item_html($extraargs = array()){ global $CFG;