]> git.mjollnir.org Git - moodle.git/commitdiff
Added messaging buttons to the online users list
authormoodler <moodler>
Tue, 28 Dec 2004 13:50:17 +0000 (13:50 +0000)
committermoodler <moodler>
Tue, 28 Dec 2004 13:50:17 +0000 (13:50 +0000)
blocks/online_users/block_online_users.php

index 18afee531b7a5c7f8370ee862f4c4261f62c2d16..05a67fef5176bba9df10e4649afe69c574026c93 100644 (file)
@@ -106,30 +106,20 @@ class block_online_users extends block_base {
             foreach ($users as $user) {
                 $this->content->text .= '<div style="text-align: left; font-size: 0.75em; padding-top: 5px;">';
                 $timeago = format_time(time() - max($user->timeaccess, $user->lastaccess)); //bruno to calculate correctly on frontpage 
-                if ($user->picture==0) {
-                    $this->content->text .= '<img src="'.$CFG->pixpath.'/i/user.gif" style="height: 16px; width:16px; vertical-align: middle;" alt="" /> ';
-                } else {
+                if ($user->picture) {
                     if ($CFG->slasharguments) {
                         $imgtag = '<img src="'.$CFG->wwwroot.'/user/pix.php/'.$user->id.'/f2.jpg" style="height: 16px; width:16px; vertical-align: middle;" alt="" /> ';
                     } else {
                         $imgtag = '<img src="'.$CFG->wwwroot.'/user/pix.php?file=/'.$user->id.'/f2.jpg" style="height: 16px; width:16px; vertical-align: middle;" alt="" /> ';
                     }
                     $this->content->text .= $imgtag;
+                } else {
+                    $this->content->text .= '<img src="'.$CFG->pixpath.'/i/user.gif" style="height: 16px; width:16px; vertical-align: middle;" alt="" /> ';
                 }
-                $this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$this->instance->pageid.'" title="'.$timeago.'">'.$user->fullname.'</a></div>';
-            }
-/*
-                $table->align = array("right","left");
-                $table->cellpadding = 1;
-                $table->cellspacing = 1;
-                $table->data[] = array("<img src=\"$CFG->pixpath/i/user.gif\" height=\"16\" width=\"16\" alt=\"\" />",$user->fullname);
+                $this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$this->instance->pageid.'" title="'.$timeago.'">'.$user->fullname.'</a>';
+                $this->content->text .= '&nbsp;<a target="message_'.$user->id.'" href="'.$CFG->wwwroot.'/message/user.php?id='.$user->id.'" onclick="return openpopup(\'/message/user.php?id='.$user->id.'\', \'message_'.$user->id.'\', \'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500\', 0);"><img height="11" width="11" src="'.$CFG->pixpath.'/t/message.gif"></a>';
+                $this->content->text .= '</div>';
             }
-            // Slightly hacky way to do it but...
-            ob_start();
-            print_table($table);
-            //$this->content->text .= "<br />".ob_get_contents();
-            ob_end_clean();
-*/
         } else {
             $this->content->text .= "<center><font size=\"-1\">".get_string("none")."</font></center>";
         }