]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed up some history linking
authormoodler <moodler>
Sat, 1 Jan 2005 04:37:40 +0000 (04:37 +0000)
committermoodler <moodler>
Sat, 1 Jan 2005 04:37:40 +0000 (04:37 +0000)
message/lib.php
message/user.php

index 3478d48afc896cde9fcf1e0a03159a36560b3a10..68480fdd854a532f20181a7c25e89a69885c2005 100644 (file)
@@ -547,6 +547,24 @@ function message_contact_link ($userid, $linktype='add', $returnstr=false) {
     }
 }
 
+function message_history_link ($userid1, $userid2=0, $returnstr=false) {
+    global $USER;
+
+    if (!$userid2) {
+        $userid2 = $USER->id;
+    }
+
+    $str = link_to_popup_window("/message/history.php?user1=$userid1&user2=$userid2", "message_history_$user->id", 
+                    get_string('messagehistory', 'message'), 500, 500, '', 
+                    'menubar=0,location=0,statusbar,scrollbars,resizable,width=500,height=500', true);
+
+    if ($returnstr) {
+        return $str;
+    } else {
+        echo $str;
+        return true;
+    }
+}
 
 
 /**
index 7de2486533d825355e8aa12a2808282e9113ada8..0085571948dea33cb17cda8efe0186888b8cc3b8 100644 (file)
@@ -1,6 +1,7 @@
 <?php // $Id$
       
     require('../config.php');
+    require('lib.php');
 
     require_login();
 
             }
             echo get_string("lastaccess").":", $datestring;
             echo '</font>';
-            echo '<br /><font size="2">';
-            echo '<a target="message_history'.$user->id.'" '.
-            link_to_popup_window("/message/history.php?user1=$user->id", "message_history_$user->id", 
-                    get_string('messagehistory', 'message'), 500, 500, '');
+            echo '<br />';
+            message_history_link($user->id);
             echo '</td>';
             echo '</tr></table>';
             echo '</table></table></body>'; // Close possible theme tables off