changeset 626:abda11cd3259

Make the settings panels slightly nicer.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 01 Nov 2014 06:37:43 +0200
parents b6e64ad83ece
children 18f52c7daf77
files admajax.php
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/admajax.php	Sat Nov 01 06:37:20 2014 +0200
+++ b/admajax.php	Sat Nov 01 06:37:43 2014 +0200
@@ -1206,16 +1206,23 @@
         if ($group !== FALSE)
         {
           $prefix = "st";
+          $first = TRUE;
           echo
             "<h1>".chentities($group["description"])."</h1>\n".
-            "<form method=\"post\" action=\"\" onsubmit=\"return jsUpdateSettings(".$group["id"].")\">\n".
-            "<table>\n";
+            "<form method=\"post\" action=\"\" onsubmit=\"return jsUpdateSettings(".$group["id"].")\">\n";
 
           foreach (stExecSQL("SELECT * FROM settings WHERE vtype<>".VT_TEXT." AND vgroup=".$group["id"]." ORDER BY vtype ASC") as $item)
           {
+            if ($first)
+            {
+              echo "<table>\n";
+              $first = FALSE;
+            }
+
             echo
               " <tr>\n".
               "  <td>";
+
             $id = $item["key"];
             switch ($item["vtype"])
             {
@@ -1234,7 +1241,8 @@
               "  <td><label for=\"".$prefix.$id."\">".chentities($item["sdesc"])."</label></td>\n".
               " </tr>\n";
           }
-          echo "</table>\n".stGetSaveButton();
+          if (!$first)
+            echo "</table>\n".stGetSaveButton();
 
           foreach (stExecSQL("SELECT * FROM settings WHERE vtype=".VT_TEXT." AND vgroup=".$group["id"]." ORDER BY key DESC") as $item)
           {