]> git.mjollnir.org Git - moodle.git/commitdiff
Added parameter to print_user_picture to allow links with target windows
authormoodler <moodler>
Sat, 1 Jan 2005 04:22:19 +0000 (04:22 +0000)
committermoodler <moodler>
Sat, 1 Jan 2005 04:22:19 +0000 (04:22 +0000)
lib/weblib.php

index f5a56c238775cbc43ff513d5709cb25d66932aa9..4bd81931a5e3fc08684bc968ddaef95a0c87dce3 100644 (file)
@@ -1981,11 +1981,14 @@ function print_file_picture($path, $courseid=0, $height='', $width='', $link='')
  * return string
  * @todo Finish documenting this function
  */
-function print_user_picture($userid, $courseid, $picture, $size=0, $returnstring=false, $link=true) {
+function print_user_picture($userid, $courseid, $picture, $size=0, $returnstring=false, $link=true, $target='') {
     global $CFG;
 
     if ($link) {
-        $output = '<a href="'. $CFG->wwwroot .'/user/view.php?id='. $userid .'&amp;course='. $courseid .'">';
+        if ($target) {
+            $target=' target="_blank"';
+        }
+        $output = '<a '.$target.' href="'. $CFG->wwwroot .'/user/view.php?id='. $userid .'&amp;course='. $courseid .'">';
     } else {
         $output = '';
     }