From 959f45d7258422581c97104b6abafc233d8ed646 Mon Sep 17 00:00:00 2001 From: dave Date: Wed, 11 Feb 2009 08:07:04 +0000 Subject: [PATCH] - Make the user list a little cleaner for multiple-role users. It makes the code ugly however :( --- admin/user_list.php | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/admin/user_list.php b/admin/user_list.php index 1399f8a..bd83da8 100644 --- a/admin/user_list.php +++ b/admin/user_list.php @@ -175,31 +175,30 @@ function toggleoptions() $completeno=0; while($r=mysql_fetch_assoc($q)) { - echo ""; + $types = split(',', $r['types']); + $span = count($types) > 1 ? "rowspan=\"".count($types)."\"" : ''; + echo ""; echo "{$r['firstname']} {$r['lastname']}"; echo ""; - echo "{$r['email']}"; + echo "{$r['email']}"; - echo "{$r['year']}"; + echo "{$r['year']}"; - echo ""; - $types = split(',', $r['types']); - foreach($types as $t) echo $user_what[$t]."
"; - echo ""; - - echo ""; + $first = true; foreach($types as $t) { + if(!$first) echo ''; + echo "{$user_what[$t]}"; + + echo ""; if($r["{$t}_active"] == 'yes') { echo "
".i18n("yes")."
"; } else { echo "
".i18n("no")."
"; } - } - echo ""; + echo ""; - echo ""; - foreach($types as $t) { + echo ""; if($r["{$t}_complete"] == 'yes') { echo "
".i18n("yes")."
"; $completeyes++; @@ -207,13 +206,19 @@ function toggleoptions() echo "
".i18n("no")."
"; $completeno++; } + echo ""; + + if($first) { + /* Finish off the the first line */ + echo ""; + echo " "; + echo ""; + echo ""; + } + + $first = false; } - echo ""; - echo ""; - echo " "; - echo ""; - echo ""; - echo ""; + echo ''; } echo "";