changeset 378:5722c37aba2a

It has begun.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 03 Dec 2013 16:40:52 +0200
parents f7b53225d315
children 47e205b475ef
files admajax.php admin.css admin.php
diffstat 3 files changed, 50 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/admajax.php	Tue Dec 03 16:23:27 2013 +0200
+++ b/admajax.php	Tue Dec 03 16:40:52 2013 +0200
@@ -296,6 +296,7 @@
   die("Could not connect to SQL database.");
 
 stReloadSettings();
+stReloadDisplayVars();
 
 
 $voteKeyMode = stGetSetting("voteKeyMode");
@@ -373,6 +374,19 @@
     //
     switch ($type)
     {
+      case "infosys":
+        $showMode = stGetDisplayVar("showMode");
+        echo
+          "<div id=\"ctrlGlobalControls\">\n".
+          "Active mode:\n".
+          stGetShowModeButton(SMODE_ROTATE, "Slide rotation", $showMode)."\n".
+          stGetShowModeButton(SMODE_COMPO, "Compo mode", $showMode)."\n".
+          stGetFormButtonInput("syscheck", "", "", " Perform system check ", "performSystemCheck()")."\n".
+          stGetFormButtonInput("generate", "", "", " Add missing show positions ", "generateEntryPositions(0, 1)")."\n".
+          stGetFormButtonInput("regenerate", "", "", " ReGenerate show positions ", "generateEntryPositions(0, 0)")."\n".
+          "</div>\n";
+        break;
+
       case "news":
         echo
           "<form method=\"post\" action=\"\" onsubmit=\"return addNews()\">\n".
@@ -899,5 +913,8 @@
     break;
 }
 
+if (!$errorSet)
+  stSaveDisplayVars();
+
 stDumpAJAXStatusErrors();
 ?>
\ No newline at end of file
--- a/admin.css	Tue Dec 03 16:23:27 2013 +0200
+++ b/admin.css	Tue Dec 03 16:40:52 2013 +0200
@@ -103,7 +103,9 @@
 	background: rgba(0,255,0,0.2);
 }
 
-.selectBox {
+#ctrlGlobalControls {
+	border: 2px solid green;
+	padding: 0.5em;
+	border-radius: 0.5em;
 	width: 20em;
-	max-width: 20em;
 }
--- a/admin.php	Tue Dec 03 16:23:27 2013 +0200
+++ b/admin.php	Tue Dec 03 16:40:52 2013 +0200
@@ -467,6 +467,35 @@
 }
 
 
+function performSystemCheck()
+{
+  jsSendPOSTRequest("action=check", jsMessageBox);
+}
+
+
+function generateEntryPositions(id, patch)
+{
+  var mcb_ok = function (data)
+  {
+    if (id == 0)
+      jsSendPOSTRequest("action=randomize&type=all&patch="+patch);
+    else
+      jsSendPOSTRequest("action=randomize&type=compo&id="+id+"&patch="+patch);
+  }
+  
+  if (patch == 0)
+    jsConfirmBox("Are you _sure_ you want to delete and regenerate entry show positions? <b>This will completely annihilate all current show positions!</b>", mcb_ok, 0, 0);
+  else
+    mcb_ok(0);
+}
+
+
+function setDisplayVar(vname, vvalue)
+{
+  jsSendPOSTRequest("action=update&type=displayVar&name="+vname+"&value="+vvalue);
+}
+
+
 function updateTabList(tabset, extra)
 {
   var tabs = "";