Merge branch 'MDL-47838-master-fix3' of https://github.com/damyon/moodle

This commit is contained in:
Marina Glancy 2014-10-24 15:18:16 +08:00 committed by Eloy Lafuente (stronk7)
commit 681276aad2

View File

@ -33,6 +33,7 @@ use gradereport_singleview\local\ui\range;
use gradereport_singleview\local\ui\bulk_insert;
use grade_item;
use grade_grade;
use stdClass;
defined('MOODLE_INTERNAL') || die;
@ -122,8 +123,6 @@ class user extends tablelike implements selectable_items {
$this->requirespaging = count($this->items) > $this->perpage;
unset($seq);
$this->setup_structure();
$this->definition = array(
@ -181,13 +180,20 @@ class user extends tablelike implements selectable_items {
}
$iconstring = get_string('filtergrades', 'gradereport_singleview', $item->get_name());
$grade->label = $item->get_name();
$itemlabel = $item->get_name();
if (!empty($realmodid)) {
$url = new moodle_url('/mod/' . $item->itemmodule . '/view.php', array('id' => $realmodid));
$itemlabel = html_writer::link($url, $item->get_name());
// Create a fake gradetreeitem so we can call get_element_header().
// The type logic below is from grade_category->_get_children_recursion().
$gradetreeitem = array();
if (in_array($item->itemtype, array('course', 'category'))) {
$gradetreeitem['type'] = $item->itemtype.'item';
} else {
$gradetreeitem['type'] = 'item';
}
$gradetreeitem['object'] = $item;
$gradetreeitem['userid'] = $this->item->id;
$itemlabel = $this->structure->get_element_header($gradetreeitem, true, false);
$grade->label = $item->get_name();
$line = array(
$OUTPUT->action_icon($this->format_link('grade', $item->id), new pix_icon('t/editstring', $iconstring)),