mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
initialized objects and code cleanup
This commit is contained in:
parent
f951066758
commit
e1513ca905
@ -392,7 +392,7 @@ function print_grade_plugin_selector($plugin_info, $active_type, $active_plugin,
|
||||
function grade_print_tabs($active_type, $active_plugin, $plugin_info, $return=false) {
|
||||
global $CFG, $COURSE;
|
||||
|
||||
if (!isset($currenttab)) {
|
||||
if (!isset($currenttab)) { //TODO: this is weird
|
||||
$currenttab = '';
|
||||
}
|
||||
|
||||
@ -1096,6 +1096,7 @@ class grade_structure {
|
||||
if ($withlink and $itemtype=='mod' and $iteminstance and $itemmodule) {
|
||||
if ($cm = get_coursemodule_from_instance($itemmodule, $iteminstance, $this->courseid)) {
|
||||
|
||||
$a = new object();
|
||||
$a->name = get_string('modulename', $element['object']->itemmodule);
|
||||
$title = get_string('linktoactivity', 'grades', $a);
|
||||
$dir = $CFG->dirroot.'/mod/'.$itemmodule;
|
||||
|
@ -512,8 +512,7 @@ class grade_report_grader extends grade_report {
|
||||
|
||||
$string = ${'str' . $showhide};
|
||||
|
||||
$aurl = clone($this->baseurl);
|
||||
$url->params(array('toggle' => $toggleaction, 'toggle_type' => $type));
|
||||
$url = new moodle_url($this->baseurl, array('toggle' => $toggleaction, 'toggle_type' => $type));
|
||||
|
||||
$retval = $OUTPUT->container($OUTPUT->action_icon($url, new pix_icon($imagename, $string))); // TODO: this container looks wrong here
|
||||
|
||||
@ -618,6 +617,7 @@ class grade_report_grader extends grade_report {
|
||||
$userreportcell = new html_table_cell();
|
||||
$userreportcell->attributes['class'] = 'userreport';
|
||||
$userreportcell->header = true;
|
||||
$a = new object();
|
||||
$a->user = fullname($user);
|
||||
$strgradesforuser = get_string('gradesforuser', 'grades', $a);
|
||||
$url = new moodle_url('/grade/report/'.$CFG->grade_profilereport.'/index.php', array('userid' => $user->id, 'id' => $this->course->id));
|
||||
@ -1456,7 +1456,6 @@ class grade_report_grader extends grade_report {
|
||||
} else if (in_array($element['object']->id, $this->collapsed['gradesonly'])) {
|
||||
$url->param('action', 'switch_whole');
|
||||
$icon = $OUTPUT->action_icon($url, new pix_icon('t/switch_whole', $strswitchwhole));
|
||||
$contractexpandicon->image->src = $OUTPUT->pix_url('t/switch_whole');
|
||||
|
||||
} else {
|
||||
$url->param('action', 'switch_minus');
|
||||
|
Loading…
x
Reference in New Issue
Block a user