changeset 391:0c1798c9d486

Add disabled mode.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 05 Dec 2013 11:33:12 +0200
parents 3257ae94ba1c
children 5a34126297b1
files admajax.php msite.inc.php showajax.php
diffstat 3 files changed, 20 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/admajax.php	Thu Dec 05 10:51:45 2013 +0200
+++ b/admajax.php	Thu Dec 05 11:33:12 2013 +0200
@@ -380,7 +380,7 @@
       case "setShowMode":
         if (stChkRequestItem("mode", $mode,
           array(CHK_TYPE, VT_INT, "Invalid data."),
-          array(CHK_RANGE, VT_INT, array(SMODE_ROTATE, SMODE_COMPO), "Invalid mode value.")))
+          array(CHK_RANGE, VT_INT, array(SMODE_DISABLED, SMODE_COMPO), "Invalid mode value.")))
         {
           $prev = stGetDisplayVar("showMode");
           if ($prev != $mode)
@@ -450,6 +450,7 @@
           "<div id=\"ctrlGlobalControls\">\n".
           "<div>\n".
           "Active mode:\n".
+          stGetShowModeButton(SMODE_DISABLED, "Off/disabled", $showMode)."\n".
           stGetShowModeButton(SMODE_ROTATE, "Slide rotation", $showMode)."\n".
           stGetShowModeButton(SMODE_COMPO, "Compo mode", $showMode)."\n".
           stGetFormButtonInput("syscheck", "", "", " Perform system check ", "performSystemCheck()")."\n".
--- a/msite.inc.php	Thu Dec 05 10:51:45 2013 +0200
+++ b/msite.inc.php	Thu Dec 05 11:33:12 2013 +0200
@@ -7,6 +7,7 @@
 require_once "msitegen.inc.php";
 
 // Define modes of party information display system
+define("SMODE_DISABLED", 0);
 define("SMODE_ROTATE", 1);
 define("SMODE_COMPO", 2);
 
--- a/showajax.php	Thu Dec 05 10:51:45 2013 +0200
+++ b/showajax.php	Thu Dec 05 11:33:12 2013 +0200
@@ -64,6 +64,16 @@
 }
 
 
+function stGuruMeditation()
+{
+  echo
+    "<div class=\"guru\">".
+    "Software Failure.&nbsp;&nbsp;&nbsp;Press left mouse button to continue.<br />".
+    "Guru Meditation #00000004.0000AAC0".
+    "</div>\n";
+}
+
+
 //
 // Initialize
 //
@@ -80,6 +90,11 @@
 //
 $updated = FALSE;
 
+if (stGetDisplayVar("showMode") == SMODE_DISABLED)
+{
+  stGuruMeditation();
+  exit;
+}
 
 // Temporary slides are handled globally
 if (stGetDisplayVar("tempDuration") > 0 &&
@@ -203,9 +218,7 @@
               stPrintRotationSlide($slide);
           }
           else
-          {
-            echo "<div class=\"guru\">Software Failure.&nbsp;&nbsp;&nbsp;Press left mouse button to continue.<br />Guru Meditation #00000004.0000AAC0</div>\n";
-          }
+            stGuruMeditation();
           break;
         
         case SMODE_COMPO:
@@ -232,7 +245,7 @@
     break;
 
   default:
-    stSetStatus(404, "Not Found");
+    stGuruMeditation();
     break;
 }