### Eclipse Workspace Patch 1.0
#P course_results
Index: config_instance.html
===================================================================
RCS file: /cvsroot/moodle/contrib/plugins/blocks/course_results/config_instance.html,v
retrieving revision 1.1
diff -u -r1.1 config_instance.html
--- config_instance.html	31 Jan 2009 16:14:07 -0000	1.1
+++ config_instance.html	21 Feb 2009 13:58:27 -0000
@@ -90,6 +90,15 @@
 </tr>
 <tr valign="top">
     <td align="right">
+        <?php print_string('config_showuserpic', 'block_course_results') ?>
+    </td>
+    <td>
+    	<input name="showuserpic" type="checkbox"
+    	<?php if (!empty($this->config->showuserpic)) echo "checked" ?> />
+    </td>
+</tr>
+<tr valign="top">
+    <td align="right">
         <?php print_string('config_header', 'block_course_results') ?>
     </td>
     <td>
Index: block_course_results.php
===================================================================
RCS file: /cvsroot/moodle/contrib/plugins/blocks/course_results/block_course_results.php,v
retrieving revision 1.1
diff -u -r1.1 block_course_results.php
--- block_course_results.php	31 Jan 2009 16:14:07 -0000	1.1
+++ block_course_results.php	21 Feb 2009 13:58:27 -0000
@@ -1,4 +1,4 @@
-<?php //$Id: block_course_results.php,v 1.1 2009/01/31 16:14:07 arborrow Exp $
+<?php //$Id: block_course_results.php,v 1.2 2009/02/21 17:00:00 argentum Exp $
 
 define('B_COURSERESULTS_NAME_FORMAT_FULL', 1);
 define('B_COURSERESULTS_NAME_FORMAT_ID',   2);
@@ -179,11 +179,6 @@
             // Ready for output!
             $gradeformat = intval(empty($this->config->gradeformat) ? B_COURSERESULTS_GRADE_FORMAT_PCT : $this->config->gradeformat);
 
-            /*if($this->instance->pagetype != 'mod-quiz-view') {
-                // Don't show header and link to the quiz if we ARE at the quiz...
-                $this->content->text .= '<h1><a href="'.$CFG->wwwroot.'/mod/quiz/view.php?q='.$quizid.'">'.$quiz->name.'</a></h1>';
-            }*/
-
             if ($nameformat = B_COURSERESULTS_NAME_FORMAT_FULL) {
                 if (has_capability('moodle/course:managegroups', $context)) {
                     $grouplink = $CFG->wwwroot.'/group/overview.php?id='.$courseid.'&amp;group=';
@@ -319,17 +314,12 @@
 
             // Now grab all the users from the database
             $userids = array_merge(array_keys($best), array_keys($worst));
-            $users = get_records_list('user', 'id', implode(',',$userids), '', 'id, firstname, lastname, idnumber');
+            $users = get_records_list('user', 'id', implode(',',$userids), '', 'id, firstname, lastname, idnumber, picture, imagealt');
 
             // Ready for output!
 
             $gradeformat = intval(empty($this->config->gradeformat) ? B_COURSERESULTS_GRADE_FORMAT_PCT : $this->config->gradeformat);
 
-            /*if($this->instance->pagetype != 'mod-quiz-view') {
-                // Don't show header and link to the quiz if we ARE at the quiz...
-                $this->content->text .= '<h1><a href="'.$CFG->wwwroot.'/mod/quiz/view.php?q='.$quizid.'">'.$quiz->name.'</a></h1>';
-            }*/
-
             $rank = 0;
             if(!empty($best)) {
                 $this->content->text .= '<table class="grades generaltable"><caption>';
@@ -345,7 +335,11 @@
                         break;
                         default:
                         case B_COURSERESULTS_NAME_FORMAT_FULL:
-                            $thisname = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$userid.'&amp;course='.$courseid.'">'.fullname($users[$userid]).'</a>';
+                            $thisname = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$userid.'&amp;course='.$courseid.'">';
+                            if (!empty($this->config->showuserpic)) {
+                                $thisname .= print_user_picture($users[$userid], $courseid, NULL, 16, true, false, '', false);
+                            }
+                            $thisname .= fullname($users[$userid]).'</a>';
                         break;
                     }
                     $this->content->text .= '<tr class="r'.($rank%2).'"><td>'.(++$rank).'.</td><td>'.$thisname.'</td><td>';
@@ -386,7 +380,11 @@
                         break;
                         default:
                         case B_COURSERESULTS_NAME_FORMAT_FULL:
-                            $thisname = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$userid.'&amp;course='.$courseid.'">'.fullname($users[$userid]).'</a>';
+                            $thisname = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$userid.'&amp;course='.$courseid.'">';
+                            if (!empty($this->config->showuserpic)) {
+                                $thisname .= print_user_picture($users[$userid], $courseid, NULL, 16, true, false, '', false);
+                            }
+                            $thisname .= fullname($users[$userid]).'</a>';
                         break;
                     }
                     $this->content->text .= '<tr class="r'.($rank%2).'"><td>'.(++$rank).'.</td><td>'.$thisname.'</td><td>';
@@ -421,4 +419,4 @@
     }
 }
 
-?>
+?>
\ No newline at end of file
Index: lang/en_utf8/block_course_results.php
===================================================================
RCS file: /cvsroot/moodle/contrib/plugins/blocks/course_results/lang/en_utf8/block_course_results.php,v
retrieving revision 1.1
diff -u -r1.1 block_course_results.php
--- lang/en_utf8/block_course_results.php	31 Jan 2009 16:14:07 -0000	1.1
+++ lang/en_utf8/block_course_results.php	21 Feb 2009 13:58:27 -0000
@@ -25,8 +25,9 @@
 $string['worstgrades'] = 'The $a lowest results:';
 $string['worstgroupgrade'] = 'The group with the lowest average:';
 $string['worstgroupgrades'] = 'The $a groups with the lowest average:';
+$string['config_showuserpic'] = 'Show user pictures';
 $string['config_title'] = 'Block title';
 $string['config_header'] = 'Block header';
 $string['config_footer'] = 'Block footer';
 
-?>
+?>
\ No newline at end of file
Index: lang/ru_utf8/block_course_results.php
===================================================================
RCS file: /cvsroot/moodle/contrib/plugins/blocks/course_results/lang/ru_utf8/block_course_results.php,v
retrieving revision 1.1
diff -u -r1.1 block_course_results.php
--- lang/ru_utf8/block_course_results.php	31 Jan 2009 16:14:07 -0000	1.1
+++ lang/ru_utf8/block_course_results.php	21 Feb 2009 13:58:27 -0000
@@ -25,8 +25,9 @@
 $string['worstgrades'] = '$a самых низких результата(ов):';
 $string['worstgroupgrade'] = 'Группа с самым низким средним результатом:';
 $string['worstgroupgrades'] = '$a групп(ы) с самым низким средним результатом:';
+$string['config_showuserpic'] = 'Показывать картинки пользователей';
 $string['config_title'] = 'Заголовок блока';
 $string['config_header'] = 'Текст до таблицы';
 $string['config_footer'] = 'Текст после таблицы';
 
-?>
+?>
\ No newline at end of file
