diff dbdefs.inc.php @ 620:8444fe96120e

Implement setting groups for admin interface settings. This is just the backend and database stuff tho, still needs the actual interface code.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 01 Nov 2014 05:41:21 +0200
parents 135efe0c3b49
children b58495c2d01a
line wrap: on
line diff
--- a/dbdefs.inc.php	Sat Nov 01 05:40:22 2014 +0200
+++ b/dbdefs.inc.php	Sat Nov 01 05:41:21 2014 +0200
@@ -1,45 +1,106 @@
 <?
 
-$dbVersion = 13;
+$dbVersion = 14;
 
 //
 // Site settings and defaults we put in
 //
-$siteDefaults = array(
-  "maxAttendeesHard" => array(VT_INT, 60, "Maximum attendees (HARD limit, <= 0 means no limit)"),
-  "maxAttendeesSoft" => array(VT_INT, 50, "Maximum attendees (soft limit, <= 0 means no limit)"),
+$siteSettingsGroups = array(
+  "general"   => array("General", "General settings"),
+  "html"      => array("HTML", "Global HTML blurbs"),
+  "news"      => array("News", "News related settings"),
+  "register"  => array("Register", "Visitor registration"),
+  "event"     => array("Event", "Event related settings"),
+  "compos"    => array("Compos", "Compo related settings"),
+);
+
+$siteDefaultSettings = array(
+
+  //
+  // General site settings
+  //
+  "general" => array(
+    "maxAttendeesHard" => array(VT_INT, 60, "Maximum attendees (HARD limit, <= 0 means no limit)"),
+    "maxAttendeesSoft" => array(VT_INT, 50, "Maximum attendees (soft limit, <= 0 means no limit)"),
 
-  "userTimeout"      => array(VT_INT, 120, "User pages (voting) timeout in minutes"),
-  "admTimeout"       => array(VT_INT, 15, "Administration interface timeout in minutes"),
+    "userTimeout"      => array(VT_INT, 120, "User pages (voting) timeout in minutes"),
+    "admTimeout"       => array(VT_INT, 15, "Administration interface timeout in minutes"),
+
+    "showAdmin"        => array(VT_BOOL, false, "Always show administration interface link on the menu"),
+    "showAttendees"    => array(VT_BOOL, true, "Show attendees list"),
+    "allowVoting"      => array(VT_BOOL, false, "Enable voting (individual compos must be enabled as well)"),
 
-  "showAdmin"        => array(VT_BOOL, false, "Always show administration interface link on the menu"),
-  "showAttendees"    => array(VT_BOOL, true, "Show attendees list"),
-  "allowRegister"    => array(VT_BOOL, false, "Enable event registration"),
-  "allowVoting"      => array(VT_BOOL, false, "Enable voting (individual compos must be enabled as well)"),
+    "showResults"      => array(VT_BOOL, false, "Enable results page"),
+    "showResAuthors"   => array(VT_BOOL, true, "Show entry authors on results page"),
+
+    "showInfoTextOnAbout" => array(VT_BOOL, false, "Show site info HTML on About page"),
+
+  ),
+
+  "html" => array(
+    "siteMenuHeader" => array(VT_TEXT, "<div>13.FAP:&gt; <span class=\"mblink\">&#9632;</span></div>", "Site menu header text"),
+    "siteMenuFooter" => array(VT_TEXT, "", "Site menu footer text"),
+    "siteExtraHTML" => array(VT_TEXT, "<div id=\"sponsors\">Gentle Eye</div>", "Extra global HTML code (f.e. sponsors box)"),
 
-  "showResults"      => array(VT_BOOL, false, "Enable results page"),
-  "showResAuthors"   => array(VT_BOOL, true, "Show entry authors on results page"),
+    "siteInfoText" => array(VT_TEXT, "
+<a href=\"about\">
+<img src=\"img/fapsm.png\" alt=\"Finnish Amiga Party 2013\" class=\"logo\" /></a>
+<div id=\"date\">
+5.-8.12.2013<br />
+Helsinki, Finland<br />
+@ old location<br />
+<span class=\"notice\">Entry 15 EUR + prod</span>
+</div>", "Site header text"),
 
-  "requireEMail"     => array(VT_BOOL, false, "Require e-mail address in registrations"),
+  "aboutDescription" => array(VT_TEXT, "
+<div style=\"text-align: center;\">
+<img src=\"img/fap.png\" alt=\"FAP\" />
+<p>
+Pure Amiga demoscene party, all traditional Amiga compos and purely Amiga-oriented program.
+<br />
+<span class=\"notice\">
+YOU <b>MUST</b> HAVE AT LEAST ONE ENTRY TO COMPETITIONS IF YOU COME TO THE PARTY.
+</span>
+</p>
+</div>",
+  "About page text"),
+
 
-  "showNews"         => array(VT_BOOL, true, "Enable News link on main menu + News page"),
-  "showNewsOnAbout"  => array(VT_BOOL, true, "Show latest news item on About page"),
-  "showSchedule"     => array(VT_BOOL, true, "Enable Schedule link on main menu + Schedule page"),
-  "showCompos"       => array(VT_BOOL, true, "Enable Compos link on main menu + Compos page"),
+  "voteFinishedText" => array(VT_TEXT, "
+<h1>Yay, you have voted!</h1>
+<p>Now go FAP some more! And make a demo about it.</p>",
+  "Message shown after successful voting"),
+
+  ),
 
-  "registerInfoText" => array(VT_TEXT, "<p>
+  //
+  // News related
+  //
+  "news" => array(
+    "showNews"         => array(VT_BOOL, true, "Enable News link on main menu + News page"),
+    "showNewsOnAbout"  => array(VT_BOOL, true, "Show latest news item on About page"),
+    "newsHeader"  => array(VT_TEXT, "", "News page header text"),
+  ),
+  
+  //
+  // Attendee/visitor registration
+  //
+  "register" => array(
+    "requireEMail"     => array(VT_BOOL, false, "Require e-mail address in registrations"),
+    "allowRegister"    => array(VT_BOOL, false, "Enable event registration"),
+    "registerInfoText" => array(VT_TEXT, "<p>
 Only your <b>handle</b> and the answer to the botcheck are strictly required.
 If you plan on joining the IRC channel
 (<a href=\"irc://#fap2013@ircnet\">#fap2013 @ IRCNet</a>) or staying up to date by other means,
 <b>e-mail</b> is not required either.
 </p>", "Registration page info text"),
 
-  "registerPostText" => array(VT_TEXT, "
+    "registerPostText" => array(VT_TEXT, "
 <h1>Registration successful</h1>
 <p>Now go make a demo about it!</p>",
   "Successful post-registration note text"),
 
-  "registerLimitExceeded" => array(VT_TEXT, "
+    "registerLimitExceeded" => array(VT_TEXT, "
 <h1>Sorry, registration disabled!</h1>
 <p>
 Registration to the event is not available at this time due to
@@ -48,7 +109,7 @@
 ",
   "Registration attendee limit exceeded note text"),
 
-  "registerNotEnabled" => array(VT_TEXT, "
+    "registerNotEnabled" => array(VT_TEXT, "
 <h1>Sorry, registration disabled!</h1>
 <p>
 Registration to the event is not enabled at this time.
@@ -63,7 +124,15 @@
 some other means (IRC, for example.)</p>
 ", "No e-mail address registration note"),
 
-  "eventDescription" => array(VT_TEXT, "
+  ),
+
+  //
+  // Event / schedule information
+  //
+  "event" => array(
+    "showSchedule"     => array(VT_BOOL, true, "Enable Schedule link on main menu + Schedule page"),
+
+    "eventDescription" => array(VT_TEXT, "
 <h1>Event program &amp; schedule</h1>
 <ul>
  <li><b>Aegis</b> of DSS and FAG will be performing a DJ gig.</li>
@@ -91,8 +160,15 @@
 </ul>
 ", "Event general description / timetables etc."),
 
-
-  "compoDescription" => array(VT_TEXT, "
+  ),
+  
+  //
+  // Competitions
+  //
+  "compos" => array(
+    "showCompos"       => array(VT_BOOL, true, "Enable Compos link on main menu + Compos page"),
+  
+    "compoDescription" => array(VT_TEXT, "
 <h1>General</h1>
 <p class=\"notice\">
 YOU <b>MUST</b> HAVE AT LEAST ONE ENTRY TO COMPETITIONS IF YOU COME TO THE PARTY.
@@ -112,43 +188,7 @@
 
 <h1>Compos</h1>
 ", "Compo general description"),
-
-
-  "siteInfoText"     => array(VT_TEXT, "
-<a href=\"about\">
-<img src=\"img/fapsm.png\" alt=\"Finnish Amiga Party 2013\" class=\"logo\" /></a>
-<div id=\"date\">
-5.-8.12.2013<br />
-Helsinki, Finland<br />
-@ old location<br />
-<span class=\"notice\">Entry 15 EUR + prod</span>
-</div>", "Site header text"),
-
-
-  "newsHeader"  => array(VT_TEXT, "", "News page header text"),
-
-
-  "aboutDescription"  => array(VT_TEXT, "
-<div style=\"text-align: center;\">
-<img src=\"img/fap.png\" alt=\"FAP\" />
-<p>
-Pure Amiga demoscene party, all traditional Amiga compos and purely Amiga-oriented program.
-<br />
-<span class=\"notice\">
-YOU <b>MUST</b> HAVE AT LEAST ONE ENTRY TO COMPETITIONS IF YOU COME TO THE PARTY.
-</span>
-</p>
-</div>",
-  "About page text"),
-
-  "voteFinishedText" => array(VT_TEXT, "
-<h1>Yay, you have voted!</h1>
-<p>Now go FAP some more! And make a demo about it.</p>",
-  "Message shown after successful voting."),
-
-  "siteMenuHeader" => array(VT_TEXT, "<div>13.FAP:&gt; <span class=\"mblink\">&#9632;</span></div>", "Site menu header text"),
-  "siteMenuFooter" => array(VT_TEXT, "", "Site menu footer text"),
-  "siteExtraHTML" => array(VT_TEXT, "<div id=\"sponsors\">Gentle Eye</div>", "Extra global HTML code (f.e. sponsors box)"),
+  ),
 );
 
 
@@ -157,6 +197,12 @@
 //
 $sqlTables = array(
   // Site settings
+  "settings_groups" => array(
+    array("id"           , "INTEGER", "PRIMARY KEY", "AUTOINCREMENT"),
+    array("name"         , "VARCHAR(64)"),
+    array("description"  , "VARCHAR(128)"),
+  ),
+
   "settings" => array(
     array("key"          , "VARCHAR(32)", "PRIMARY KEY"),
     array("vtype"        , "INT"),
@@ -164,6 +210,7 @@
     array("vtext"        , "TEXT"),
     array("vint"         , "INT"),
     array("sdesc"        , "VARCHAR(128)"),
+    array("vgroup"       , "INT"),
   ),
 
   "news" => array(
@@ -362,6 +409,10 @@
     "rot_list_data" => array("table" => "rotationListData"),
     "rot_list_slides" => array("table" => "rotationListSlides"),
   ),
+  
+  14 => array(
+    "settings_groups" => array("table" => FALSE),
+  ),
 );