MDL-21198 workshop: rewriting user_picture() calls to respect recent refactoring

This commit is contained in:
David Mudrak 2010-01-04 18:31:36 +00:00
parent 0a5ddea5f9
commit dd15f80e25
2 changed files with 11 additions and 41 deletions

View 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

View 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');