From: David Mudrak Date: Mon, 4 Jan 2010 18:31:36 +0000 (+0000) Subject: MDL-21198 workshop: rewriting user_picture() calls to respect recent refactoring X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=dd15f80e257b81e9d90a0ae7965097454299cee5;p=moodle.git MDL-21198 workshop: rewriting user_picture() calls to respect recent refactoring --- diff --git a/mod/workshop/allocation/manual/renderer.php b/mod/workshop/allocation/manual/renderer.php index 10a9d8fd30..fbf22fb861 100644 --- a/mod/workshop/allocation/manual/renderer.php +++ b/mod/workshop/allocation/manual/renderer.php @@ -86,7 +86,7 @@ class workshopallocation_manual_renderer extends plugin_renderer_base { * @return string HTML code */ protected function participant(stdclass $allocation, array $userinfo) { - $o = $this->output->user_picture($userinfo[$allocation->userid], $this->page->course->id); + $o = $this->output->user_picture($userinfo[$allocation->userid], array('courseid' => $this->page->course->id)); $o .= fullname($userinfo[$allocation->userid]); $o .= $this->output->container_start(array('submission')); if (is_null($allocation->submissionid)) { @@ -132,11 +132,7 @@ class workshopallocation_manual_renderer extends plugin_renderer_base { $o .= $this->output->output_start_tag('ul', array()); foreach ($allocation->reviewedby as $reviewerid => $assessmentid) { $o .= $this->output->output_start_tag('li', array()); - $allocationpic = new moodle_user_picture(); - $allocationpic->user = $userinfo[$reviewerid]; - $allocationpic->courseid = $this->page->course->id; - $allocationpic->size = 16; - $o .= $this->output->user_picture($allocationpic); + $o .= $this->output->user_picture($userinfo[$reviewerid], array('courseid' => $this->page->course->id, 'size' => 16)); $o .= fullname($userinfo[$reviewerid]); // delete icon @@ -180,11 +176,7 @@ class workshopallocation_manual_renderer extends plugin_renderer_base { $o .= $this->output->output_start_tag('ul', array()); foreach ($allocation->reviewerof as $authorid => $assessmentid) { $o .= $this->output->output_start_tag('li', array()); - $allocationpic = new moodle_user_picture(); - $allocationpic->user = $userinfo[$authorid]; - $allocationpic->courseid = $this->page->course->id; - $allocationpic->size = 16; - $o .= $this->output->user_picture($allocationpic, $this->page->course->id); + $o .= $this->output->user_picture($userinfo[$authorid], array('courseid' => $this->page->course->id, 'size' => 16)); $o .= fullname($userinfo[$authorid]); // delete icon diff --git a/mod/workshop/renderer.php b/mod/workshop/renderer.php index dea7aaffa0..36bc4d95ab 100644 --- a/mod/workshop/renderer.php +++ b/mod/workshop/renderer.php @@ -125,12 +125,7 @@ class mod_workshop_renderer extends plugin_renderer_base { $author->lastname = $submission->authorlastname; $author->picture = $submission->authorpicture; $author->imagealt = $submission->authorimagealt; - $userpic = new moodle_user_picture(); - $userpic->user = $author; - $userpic->courseid = $this->page->course->id; - $userpic->url = true; - $userpic->size = 35; - $userpic = $this->output->user_picture($userpic); + $userpic = $this->output->user_picture($author, array('courseid' => $this->page->course->id, 'size' => 35)); $userurl = new moodle_url($CFG->wwwroot . '/user/view.php', array('id' => $author->id, 'course' => $this->page->course->id)); $a = new stdclass(); @@ -180,12 +175,7 @@ class mod_workshop_renderer extends plugin_renderer_base { $author->lastname = $submission->authorlastname; $author->picture = $submission->authorpicture; $author->imagealt = $submission->authorimagealt; - $userpic = new moodle_user_picture(); - $userpic->user = $author; - $userpic->courseid = $this->page->course->id; - $userpic->url = true; - $userpic->size = 64; - $userpic = $this->output->user_picture($userpic); + $userpic = $this->output->user_picture($author, array('courseid' => $this->page->course->id, 'size' => 64)); $userurl = new moodle_url($CFG->wwwroot . '/user/view.php', array('id' => $author->id, 'course' => $this->page->course->id)); $a = new stdclass(); @@ -641,14 +631,8 @@ class mod_workshop_renderer extends plugin_renderer_base { */ protected function grading_report_participant(stdclass $participant, array $userinfo) { $userid = $participant->userid; - $pic = new moodle_user_picture(); - $pic->user = $userinfo[$userid]; - $pic->courseid = $this->page->course->id; - $pic->url = true; - $pic->size = 35; - - $out = $this->output->user_picture($pic); - $out .= $this->output->output_tag('span', '', fullname($userinfo[$userid])); + $out = $this->output->user_picture($userinfo[$userid], array('courseid' => $this->page->course->id, 'size' => 35)); + $out .= $this->output->output_tag('span', array(), fullname($userinfo[$userid])); return $out; } @@ -715,17 +699,11 @@ class mod_workshop_renderer extends plugin_renderer_base { if ($shownames) { $userid = $assessment->userid; - $pic = new moodle_user_picture(); - $pic->user = $userinfo[$userid]; - $pic->courseid = $this->page->course->id; - $pic->url = true; - $pic->size = 16; - - $name = $this->output->user_picture($pic); - $name .= $this->output->output_tag('span', array('class' => 'fullname'), fullname($userinfo[$userid])); - $name = $separator . $this->output->output_tag('span', array('class' => 'user'), $name); + $name = $this->output->user_picture($userinfo[$userid], array('courseid' => $this->page->course->id, 'size' => 16)); + $name .= $this->output->output_tag('span', array('class' => 'fullname'), fullname($userinfo[$userid])); + $name = $separator . $this->output->output_tag('span', array('class' => 'user'), $name); } else { - $name = ''; + $name = ''; } return $this->output->container($grade . $name, 'assessmentdetails');