diff admajax.php @ 450:c7cc689071aa

Moar work.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 06 Dec 2013 16:44:56 +0200
parents 3e334425a421
children 772a2138861b
line wrap: on
line diff
--- a/admajax.php	Fri Dec 06 16:20:34 2013 +0200
+++ b/admajax.php	Fri Dec 06 16:44:56 2013 +0200
@@ -323,7 +323,7 @@
     $indent."  <div class=\"ctrlTitle\">Edit rotation list</div>\n".
     $indent."  ".stGetFormTextInput(30, SET_LEN_ROT_LIST_NAME, "ctrlEDRotationListName", "", "", $data["name"])."\n".
     $indent."  ".stGetFormButtonInput("updname", "", "", "Save", "updateRotationListName()")."\n".
-    "<br />\n".
+    "<div>Available slides:</div>\n".
     stGetOptionListStart("ctrlEDDisplaySlides", $indent."  ", TRUE);
 
   $sql = "SELECT * FROM displaySlides";
@@ -335,13 +335,14 @@
 
   $str .=
     stGetOptionListEnd($indent."  ", TRUE).
+    "<div>List content:</div>\n".
     stGetInfoRotationListEditData($indent."  ", TRUE, $list_id).
     $indent."  <div class=\"ctrlButtons\">\n".
     $indent."    ".stGetFormButtonInput("moveslideup", "", "", "Move Up", "moveRotationListSlide(-1)")."\n".
     $indent."    ".stGetFormButtonInput("moveslidedn", "", "", "Move Down", "moveRotationListSlide(1)")."\n".
     $indent."    ".stGetFormButtonInput("addslide", "", "", "Add slide", "addRotationListSlide()")."\n".
     $indent."    ".stGetFormButtonInput("delslide", "", "", "Remove slide", "removeRotationListSlide()")."\n".
-    $indent."    ".stGetFormButtonInput("delslide", "", "", "Close", "jsCloseAdminPopup()")."\n".
+    $indent."    ".stGetFormButtonInput("closeedit", "", "", "Close", "jsCloseAdminPopup()")."\n".
     $indent."  </div>\n".
     ($outer ? $indent."</div>\n" : "");
 
@@ -567,6 +568,20 @@
     //
     switch ($type)
     {
+      case "setRotateDuration":
+        if (stChkRequestItem("duration", $duration,
+          array(CHK_TYPE, VT_INT, "Invalid data."),
+          array(CHK_RANGE, VT_INT, array(5, 60), "Invalid slide time value, must be 5 - 60 seconds.")))
+        {
+          $prev = stGetDisplayVar("rotateDuration");
+          if ($prev != $duration)
+          {
+            stSetDisplayVar("rotateDuration", $duration);
+            stDisplayUpdated();
+          }
+        }
+        break;
+
       case "setShowMode":
         if (stChkRequestItem("mode", $mode,
           array(CHK_TYPE, VT_INT, "Invalid data."),
@@ -580,7 +595,7 @@
           }
         }
         break;
-      
+
       case "setCompoID":
         if (stChkRequestItem("id", $compo_id, array(CHK_TYPE, VT_INT, "Invalid data.")))
         {
@@ -742,7 +757,7 @@
         }
         break;
 
-      case "deleteRotationListSlide":
+      case "removeRotationListSlide":
         if (stChkRequestItem("list_id", $list_id, array(CHK_TYPE, VT_INT, "Invalid data.")) &&
             stChkRequestItem("slide_id", $slide_id, array(CHK_TYPE, VT_INT, "Invalid data.")))
         {
@@ -817,9 +832,12 @@
           "  <div>Disabled for the moment, will be available 'soon'.</div>\n".
 /*
           "  <div class=\"ctrlTitle\">Rotation lists:</div>\n".
-          "  <div class=\"ctrlInfo\">Lists of slides, that are shown for 15 seconds and 'rotated' to next one.</div>\n".
+          "  <div class=\"ctrlInfo\">Lists of slides, that are shown for X seconds and 'rotated' to next one.</div>\n".
           stGetInfoRotationLists("    ", TRUE).
           "  <div class=\"ctrlButtons\">\n".
+          "    ".stGetFormButtonInput("setdur", "", "", "Set", "setRotateDuration()")."\n".
+          "    ".stGetFormTextInput(3, 5, "", "ctrlRotSlideDuration", "", stGetDisplayVar("rotateDuration"))." sec\n".
+          " - ".
           "    ".stGetFormButtonInput("actlist", "", "", "Set Active", "activateRotationList()")."\n".
           "    ".stGetFormButtonInput("editlist", "", "", "Edit", "editRotationList()")."\n".
           "    ".stGetFormButtonInput("newlist", "", "", "New", "newRotationList()")."\n".