]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-21198 workshop: rewriting user_picture() calls to respect recent refactoring
authorDavid Mudrak <david.mudrak@gmail.com>
Mon, 4 Jan 2010 18:31:36 +0000 (18:31 +0000)
committerDavid Mudrak <david.mudrak@gmail.com>
Mon, 4 Jan 2010 18:31:36 +0000 (18:31 +0000)
mod/workshop/allocation/manual/renderer.php
mod/workshop/renderer.php

index 10a9d8fd3013e3c054bbd21d1443d726f9105c85..fbf22fb86114e27d10f451ab0486c6f3d039439e 100644 (file)
@@ -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
index dea7aaffa0e277d3f549efbda3578993f231a0e0..36bc4d95abc3c964aa88d1d58fb7bb50e878467e 100644 (file)
@@ -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');