From: luizlaydner Date: Thu, 2 Aug 2007 17:23:42 +0000 (+0000) Subject: - improved the layout of the list of user in a tag page X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=327136f7358d6f0be27e49e1d56429f278a6e271;p=moodle.git - improved the layout of the list of user in a tag page --- diff --git a/tag/index.php b/tag/index.php index 6cf7f6741c..48913277b6 100644 --- a/tag/index.php +++ b/tag/index.php @@ -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.'&', 'userpage'); - print_tagged_users_table($tag, 4, $userpage * $perpage, $perpage); + print_tagged_users_table($tag, $userpage * $perpage, $perpage); } diff --git a/tag/lib.php b/tag/lib.php index b372b0b8ad..82f8083c60 100644 --- a/tag/lib.php +++ b/tag/lib.php @@ -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 ); } + } diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index d80cd040ed..0eb2cb9c3e 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -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;