]> git.mjollnir.org Git - moodle.git/commitdiff
- improved the layout of the list of user in a tag page
authorluizlaydner <luizlaydner>
Thu, 2 Aug 2007 17:23:42 +0000 (17:23 +0000)
committerluizlaydner <luizlaydner>
Thu, 2 Aug 2007 17:23:42 +0000 (17:23 +0000)
tag/index.php
tag/lib.php
theme/standard/styles_layout.css

index 6cf7f6741c4c8df6b10a2848cd5c4824a0c1d7d7..48913277b62d1a726a2586b190acfc317ca27a6c 100644 (file)
@@ -12,7 +12,7 @@ if (empty($CFG->usetags)) {
 
 $tagid       = optional_param('id',     0,      PARAM_INT);   // tag id
 $userpage    = optional_param('userpage', 0, PARAM_INT);      // which page to show
-$perpage     = optional_param('perpage', 16, PARAM_INT);
+$perpage     = optional_param('perpage', 20, PARAM_INT);
 
 $tag      = tag_by_id($tagid);
 
@@ -51,7 +51,7 @@ if ($usercount > 0) {
     
     print_paging_bar($usercount, $userpage, $perpage, $baseurl.'&amp;', 'userpage');
     
-    print_tagged_users_table($tag, 4, $userpage * $perpage, $perpage);
+    print_tagged_users_table($tag, $userpage * $perpage, $perpage);
 
 }
 
index b372b0b8ad877c7c566b0b9538f804268dad9d5e..82f8083c608ae6ce3b6cb777b6510cba7a0104ee 100644 (file)
@@ -1165,7 +1165,7 @@ function print_tag_description_box($tag_object) {
  * @param int $limitnum prints this many users (optional, required if $limitfrom is set).
  */
 
-function print_tagged_users_table($tag_object, $users_per_row='5', $limitfrom='' , $limitnum='') {
+function print_tagged_users_table($tag_object, $limitfrom='' , $limitnum='') {
 
     //List of users with this tag
     $userlist = array_values( get_items_tagged_with(
@@ -1179,7 +1179,7 @@ function print_tagged_users_table($tag_object, $users_per_row='5', $limitfrom=''
     //user table box
     print_box_start('generalbox', 'tag-user-table');
 
-        print_user_table($userlist, $users_per_row);
+        print_user_list($userlist);
 
     print_box_end();
     //end table box
@@ -1189,35 +1189,16 @@ function print_tagged_users_table($tag_object, $users_per_row='5', $limitfrom=''
 }
 
 /**
- *  Prints a table of users
+ *  Prints a list of users
  *
  * @param array $userlist an array of user objects
- * @param int $users_per_row number of users per row to display
  */
-function print_user_table($userlist, $users_per_row='5') {
+function print_user_list($userlist) {
     
-    $nrofrows = ceil( count($userlist) / $users_per_row );
-    for($row = 0; $row < $nrofrows; $row++){
-
-        //table row box
-        print_box_start('user-table-row', 'row_'.$row);
-
-        for($col = 0; ($col < $users_per_row) ; $col++ ) {
-
-            $index = $row * $users_per_row + $col;
-
-            if ($index < count($userlist) ) {
-
-                print_user_box( $userlist[$index] );
-
-            }
-
-        }
-
-        print_box_end();
-        //end table row box
-
+    foreach ($userlist as $user){
+        print_user_box( $user );
     }
+
     
 }
 
index d80cd040edd571e475bcf320a9254b8f46ce5df6..0eb2cb9c3ef9d41b712d6f94e97baf7989af428c 100644 (file)
@@ -2751,7 +2751,7 @@ ul.tabrow1 li.here.selected a {
  ***/
 
 div#tag-description {
-       width:600px;
+       width:60%;
        padding-top:0px;
        margin-top:20px;
        margin-left:auto;
@@ -2766,25 +2766,19 @@ div#tag-management-box {
 }
          
 div#tag-user-table {
-       width:600px;
+       width:60%;
        margin-left:auto;
        margin-right:auto;      
        display:table;
 }
 
-div.user-table-row {
-       width:100%;
-       min-height:150px;       
-       margin-top:20px;
-       margin-bottom:20px;     
-       margin-left:auto;
-       margin-right:auto;
-       text-align:center;
-       display:block;
-}
-
 div.user-box {
-       width:150px;
+       margin-left:15px;
+       margin-right:15px;
+       margin-top:5px;
+       margin-bottom:5px;                      
+       width:115px;
+       height:150px;   
        text-align:center;
        display:block;  
        float:left;