]> git.mjollnir.org Git - moodle.git/commitdiff
Some cleanups for some of the HTML, including addition of new styles
authormoodler <moodler>
Tue, 21 Oct 2003 06:40:39 +0000 (06:40 +0000)
committermoodler <moodler>
Tue, 21 Oct 2003 06:40:39 +0000 (06:40 +0000)
course/lib.php
user/index.php
user/lib.php
user/view.php

index a2a482f879ea0b319753b422ef08b98786ac255a..05efc5089971a7cd3b2b6eef3e73fe982e48e98d 100644 (file)
@@ -1138,13 +1138,13 @@ function print_course($course, $width="100%") {
         error("Could not find a site!");
     }
 
-    print_simple_box_start("center", "$width");
+    print_simple_box_start("center", "$width", $THEME->cellcontent, 5, "coursebox");
 
     $linkcss = $course->visible ? "" : " class=\"dimmed\" ";
 
     echo "<table width=\"100%\">";
     echo "<tr valign=top>";
-    echo "<td valign=top width=50%>";
+    echo "<td valign=top width=\"50%\" class=\"courseboxinfo\">";
     echo "<p><font size=3><b><a title=\"".get_string("entercourse")."\" 
               $linkcss href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</a></b></font></p>";
     if ($teachers = get_course_teachers($course->id)) {
@@ -1171,7 +1171,7 @@ function print_course($course, $width="100%") {
     }
 
 
-    echo "</td><td valign=top width=50%>";
+    echo "</td><td valign=top width=\"50%\" class=\"courseboxsummary\">";
     echo "<p><font size=2>".text_to_html($course->summary)."</font></p>";
     echo "</td></tr>";
     echo "</table>";
index e46dcd3bc9c3244acd8560fce2259702aac521ad..4ce1a9c556b2162b002a2df40caa5e011212245e 100644 (file)
         $table->align = array ("LEFT", "LEFT", "LEFT", "LEFT", "LEFT");
         $table->size = array ("10",  "*", "*", "*", "*");
         $table->size = array ("10",  "*", "*", "*", "*");
-        $table->cellpadding = 2;
+        $table->cellpadding = 4;
         $table->cellspacing = 0;
         
         foreach ($students as $student) {
index 36b3be61973eac28a5d2f06f99540b955425efde..2bbd422d41e3ccd6a580e6caf2edee7ff2c8c89c 100644 (file)
@@ -171,26 +171,25 @@ function save_user_image($userid, $filename) {
 
 
 function print_user($user, $course, $string, $countries) {
+/// Prints a summary of a user in a nice little box
 
-    global $USER;
-    
-    echo "<TABLE WIDTH=80% ALIGN=CENTER BORDER=0 CELLPADDING=1 CELLSPACING=1><TR><TD BGCOLOR=#888888>";
-    echo "<TABLE WIDTH=100% BORDER=0 CELLPADDING=5 CELLSPACING=0><TR>";
-    echo "<TD WIDTH=100 BGCOLOR=#FFFFFF VALIGN=top>";
+    echo "<table width=\"80%\" align=\"center\" border=\"0\" cellpadding=\"10\" cellspacing=\"0\" class=\"userinfobox\">";
+    echo "<tr>";
+    echo "<td width=100 bgcolor=#ffffff valign=top class=\"userinfoboxside\">";
     print_user_picture($user->id, $course->id, $user->picture, true);
-    echo "</A>";
-    echo "</TD><TD WIDTH=100% BGCOLOR=#FFFFFF VALIGN=top>";
-    echo "<FONT SIZE=-1>";
-    echo "<FONT SIZE=3><B>$user->firstname $user->lastname</B></FONT>";
-    echo "<P>";
+    echo "</a>";
+    echo "</td><td width=100% bgcolor=#ffffff valign=top class=\"userinfoboxsummary\">";
+    echo "<font size=-1>";
+    echo "<font size=3><b>$user->firstname $user->lastname</b></font>";
+    echo "<p>";
     if (!empty($user->role) and ($user->role <> $course->teacher)) {
-        echo "$string->role: $user->role<BR>";
+        echo "$string->role: $user->role<br />";
     }
     if ($user->maildisplay == 1 or ($user->maildisplay == 2 and $course->category) or isteacher($course->id)) {
-        echo "$string->email: <A HREF=\"mailto:$user->email\">$user->email</A><BR>";
+        echo "$string->email: <a href=\"mailto:$user->email\">$user->email</a><br />";
     }
     if ($user->city or $user->country) {
-        echo "$string->location: $user->city, ".$countries["$user->country"]."<BR>";
+        echo "$string->location: $user->city, ".$countries["$user->country"]."<br />";
     }
     if ($user->lastaccess) {
         echo "$string->lastaccess: ".userdate($user->lastaccess);
@@ -198,21 +197,21 @@ function print_user($user, $course, $string, $countries) {
     } else {
         echo "$string->lastaccess: $string->never";
     }
-    echo "</TD><TD VALIGN=bottom BGCOLOR=#FFFFFF NOWRAP>";
+    echo "</td><td valign=bottom bgcolor=#ffffff nowrap class=\"userinfoboxlinkcontent\">";
 
-    echo "<FONT SIZE=1>";
+    echo "<font size=1>";
     if (isteacher($course->id)) {
         $timemidnight = usergetmidnight(time());
-        echo "<A HREF=\"../course/user.php?id=$course->id&user=$user->id\">$string->activity</A><BR>";
+        echo "<a href=\"../course/user.php?id=$course->id&user=$user->id\">$string->activity</a><br>";
         if (isstudent($course->id, $user->id)) {
-            echo "<A HREF=\"../course/unenrol.php?id=$course->id&user=$user->id\">$string->unenrol</A><BR>";
-            echo "<A HREF=\"../course/loginas.php?id=$course->id&user=$user->id\">$string->loginas</A><BR>";
+            echo "<a href=\"../course/unenrol.php?id=$course->id&user=$user->id\">$string->unenrol</a><br />";
+            echo "<a href=\"../course/loginas.php?id=$course->id&user=$user->id\">$string->loginas</a><br />";
         }
     } 
-    echo "<A HREF=\"view.php?id=$user->id&course=$course->id\">$string->fullprofile...</A>";
-    echo "</FONT>";
+    echo "<a href=\"view.php?id=$user->id&course=$course->id\">$string->fullprofile...</a>";
+    echo "</font>";
 
-    echo "</TD></TR></TABLE></TD></TR></TABLE>";
+    echo "</td></tr></table>";
 }
 
 ?>
index 7b3d8a028af54d675e396e5e4119271ee88b910c..91c9d7eceeaef22b0b9a6b6d365bf107dde59406 100644 (file)
@@ -34,8 +34,8 @@
 
     if ($course->category) {
         print_header("$personalprofile: $fullname", "$personalprofile: $fullname", 
-                     "<A HREF=\"../course/view.php?id=$course->id\">$course->shortname</A> -> 
-                      <A HREF=\"index.php?id=$course->id\">$participants</A> -> $fullname",
+                     "<a href=\"../course/view.php?id=$course->id\">$course->shortname</a> -> 
+                      <a href=\"index.php?id=$course->id\">$participants</a> -> $fullname",
                       "", "", true, "&nbsp;", $loggedinas);
     } else {
         print_header("$course->fullname: $personalprofile: $fullname", "$course->fullname", 
         print_heading(get_string("userdeleted"));
     }
 
-    echo "<TABLE WIDTH=80% ALIGN=CENTER BORDER=0 CELLPADDING=1 CELLSPACING=1><TR><TD BGCOLOR=#888888>";
-    echo "<TABLE WIDTH=100% BORDER=0 CELLPADDING=3 CELLSPACING=0><TR>";
-    echo "<TD WIDTH=100 BGCOLOR=\"$THEME->body\" VALIGN=top>";
+    echo "<table width=\"80%\" align=\"center\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\" class=\"userinfobox\">";
+    echo "<tr>";
+    echo "<td width=\"100\" valign=\"top\" class=\"userinfoboxside\">";
     print_user_picture($user->id, $course->id, $user->picture, true, false, false);
-    echo "</TD><TD WIDTH=100% BGCOLOR=#FFFFFF>";
+    echo "</td><td width=\"100%\" bgcolor=\"$THEME->cellcontent\" class=\"userinfoboxcontent\">";
 
 
     // Print name and edit button across top
 
-    echo "<TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD NOWRAP>";
-    echo "<H3>$fullname</H3>";
-    echo "</TD><TD align=right>";
+    echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td nowrap>";
+    echo "<h3>$fullname</h3>";
+    echo "</td><td align=\"right\">";
     if (empty($USER->id)) {
        $currentuser = false;
     } else {
        $currentuser = ($user->id == $USER->id);
     }
     if (($currentuser and !isguest()) or isadmin()) {
-        echo "<P><FORM ACTION=edit.php METHOD=GET>";
-        echo "<INPUT type=hidden name=id value=\"$id\">";
-        echo "<INPUT type=hidden name=course value=\"$course->id\">";
-        echo "<INPUT type=submit value=\"".get_string("editmyprofile")."\">";
-        echo "</FORM></P>";
+        echo "<p><form action=edit.php method=get>";
+        echo "<input type=hidden name=id value=\"$id\">";
+        echo "<input type=hidden name=course value=\"$course->id\">";
+        echo "<input type=submit value=\"".get_string("editmyprofile")."\">";
+        echo "</form></p>";
     }
-    echo "</TD></TR></TABLE>";
+    echo "</td></tr></table>";
 
 
     // Print the description
 
     if ($user->description) {
-        echo "<P>".text_to_html($user->description)."</P><HR>";
+        echo "<p>".text_to_html($user->description)."</p><hr>";
     }
 
     // Print all the little details in a list
 
-    echo "<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=2";
+    echo "<table border=\"0\" cellpadding=\"5\" cellspacing=\"2\"";
 
     if ($user->city or $user->country) {
         print_row(get_string("location").":", "$user->city, ".$countries["$user->country"]);
     }
 
     if ($user->url) {
-        print_row(get_string("webpage").":", "<A HREF=\"$user->url\">$user->url</A>");
+        print_row(get_string("webpage").":", "<a href=\"$user->url\">$user->url</a>");
     }
 
     if ($user->icq) {
-        print_row("ICQ:","<A HREF=\"http://web.icq.com/wwp?Uin=$user->icq\">$user->icq <IMG SRC=\"http://web.icq.com/whitepages/online?icq=$user->icq&img=5\" WIDTH=18 HEIGHT=18 BORDER=0></A>");
+        print_row("icq:","<a href=\"http://web.icq.com/wwp?uin=$user->icq\">$user->icq <img src=\"http://web.icq.com/whitepages/online?icq=$user->icq&img=5\" width=18 height=18 border=0></a>");
     }
 
     if ($user->lastaccess) {
     }
     print_row(get_string("lastaccess").":", $datestring);
 
-    echo "</TABLE>";
+    echo "</table>";
 
-    echo "</TD></TR></TABLE></TABLE>";
+    echo "</td></tr></table>";
 
     $internalpassword = false;
     if (is_internal_auth()) {
     }
 
 //  Print other functions
-    echo "<CENTER><TABLE ALIGN=CENTER><TR>";
+    echo "<center><table align=center><tr>";
     if ($currentuser and !isguest()) {
         if ($internalpassword) {
-            echo "<TD NOWRAP><P><FORM ACTION=\"$internalpassword\" METHOD=GET>";
-            echo "<INPUT type=hidden name=id value=\"$course->id\">";
-            echo "<INPUT type=submit value=\"".get_string("changepassword")."\">";
-            echo "</FORM></P></TD>";
+            echo "<td nowrap><p><form action=\"$internalpassword\" method=get>";
+            echo "<input type=hidden name=id value=\"$course->id\">";
+            echo "<input type=submit value=\"".get_string("changepassword")."\">";
+            echo "</form></p></td>";
         } else if (strlen($CFG->changepassword) > 1) {
-            echo "<TD NOWRAP><P><FORM ACTION=\"$CFG->changepassword\" METHOD=GET>";
-            echo "<INPUT type=submit value=\"".get_string("changepassword")."\">";
-            echo "</FORM></P></TD>";
+            echo "<td nowrap><p><form action=\"$CFG->changepassword\" method=get>";
+            echo "<input type=submit value=\"".get_string("changepassword")."\">";
+            echo "</form></p></td>";
         }
     }
     if ($course->category and 
         ((isstudent($course->id) and ($user->id == $USER->id) and !isguest() and $CFG->allowunenroll) or 
         (isteacher($course->id) and isstudent($course->id, $user->id))) ) {
-        echo "<TD NOWRAP><P><FORM ACTION=\"../course/unenrol.php\" METHOD=GET>";
-        echo "<INPUT type=hidden name=id value=\"$course->id\">";
-        echo "<INPUT type=hidden name=user value=\"$user->id\">";
-        echo "<INPUT type=submit value=\"".get_string("unenrolme", "", $course->shortname)."\">";
-        echo "</FORM></P></TD>";
+        echo "<td nowrap><p><form action=\"../course/unenrol.php\" method=get>";
+        echo "<input type=hidden name=id value=\"$course->id\">";
+        echo "<input type=hidden name=user value=\"$user->id\">";
+        echo "<input type=submit value=\"".get_string("unenrolme", "", $course->shortname)."\">";
+        echo "</form></p></td>";
     }
     if (isteacher($course->id)) {
-        echo "<TD NOWRAP><P><FORM ACTION=\"../course/user.php\" METHOD=GET>";
-        echo "<INPUT type=hidden name=id value=\"$course->id\">";
-        echo "<INPUT type=hidden name=user value=\"$user->id\">";
-        echo "<INPUT type=submit value=\"".get_string("activityreport")."\">";
-        echo "</FORM></P></TD>";
+        echo "<td nowrap><p><form action=\"../course/user.php\" method=get>";
+        echo "<input type=hidden name=id value=\"$course->id\">";
+        echo "<input type=hidden name=user value=\"$user->id\">";
+        echo "<input type=submit value=\"".get_string("activityreport")."\">";
+        echo "</form></p></td>";
         if ($user->id != $USER->id) {
-            echo "<TD NOWRAP><P><FORM ACTION=\"../course/loginas.php\" METHOD=GET>";
-            echo "<INPUT type=hidden name=id value=\"$course->id\">";
-            echo "<INPUT type=hidden name=user value=\"$user->id\">";
-            echo "<INPUT type=submit value=\"".get_string("loginas")."\">";
-            echo "</FORM></P></TD>";
+            echo "<td nowrap><p><form action=\"../course/loginas.php\" method=get>";
+            echo "<input type=hidden name=id value=\"$course->id\">";
+            echo "<input type=hidden name=user value=\"$user->id\">";
+            echo "<input type=submit value=\"".get_string("loginas")."\">";
+            echo "</form></p></td>";
         }
     }
-    echo "</TR></TABLE></CENTER>\n";
+    echo "</tr></table></center>\n";
 
     forum_print_user_discussions($course->id, $user->id);
 
 /// Functions ///////
 
 function print_row($left, $right) {
-    echo "<TR><TD NOWRAP ALIGN=right><P>$left</TD><TD align=left><P>$right</P></TD></TR>";
+    echo "<tr><td nowrap align=right><p>$left</td><td align=left><p>$right</p></td></tr>";
 }
 
 ?>