Mercurial > hg > fapweb
changeset 390:3257ae94ba1c
Work on show display backend logic.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 05 Dec 2013 10:51:45 +0200 |
parents | 6c803b1a7335 |
children | 0c1798c9d486 |
files | admajax.php admin.css admin.php |
diffstat | 3 files changed, 124 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/admajax.php Thu Dec 05 10:03:45 2013 +0200 +++ b/admajax.php Thu Dec 05 10:51:45 2013 +0200 @@ -224,7 +224,7 @@ "showMode", "", "", $mode, $cmode == $mode, $name, - "onClick=\"setDisplayVar('showMode',".$mode.")\""); + "onClick=\"setShowMode(".$mode.")\""); } @@ -370,6 +370,74 @@ break; + case "ctrl": + switch ($type) + { + case "setTempSlide": + + break; + + 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."))) + { + $prev = stGetDisplayVar("showMode"); + if ($prev != $mode) + { + stSetDisplayVar("lastUpdate", time()); + stSetDisplayVar("showMode", $mode); + } + } + break; + + case "setCompoID": + if (stChkRequestItem("id", $compo_id, array(CHK_TYPE, VT_INT, "Invalid data."))) + { + if (stFetchSQL("SELECT id FROM compos WHERE id=".$compo_id) === false) + stError("Invalid compo ID ".$compo_id); + else + stSetDisplayVar("compoID", $compo_id); + } + break; + + case "setEntry": + case "nextEntry": + case "prevEntry": + if (($compo_id = stGetDisplayVar("compoID")) > 0) + { + $prev = $curr = stGetDisplayVar("compoCurrEntry"); + $nentries = stFetchSQLColumn("SELECT COUNT(*) FROM entries WHERE compo_id=".$compo_id); + switch ($type) + { + case "setEntry": + if (stChkRequestItem("index", $tmp, array(CHK_TYPE, VT_INT, "Invalid index."))) + $curr = $tmp; + break; + + case "nextEntry": + if ($curr < $nentries) + $curr++; + break; + + case "prevEntry": + if ($curr > 1) + $curr--; + break; + } + + if (!$errorSet) + { + stSetDisplayVar("compoCurrEntry", $curr); + stSetDisplayVar("compoPrevEntry", $prev); + } + } + else + stError("No valid competition set."); + break; + } + break; + case "get": // // Get specific data
--- a/admin.css Thu Dec 05 10:03:45 2013 +0200 +++ b/admin.css Thu Dec 05 10:51:45 2013 +0200 @@ -107,5 +107,58 @@ border: 2px solid green; padding: 0.5em; border-radius: 0.5em; + background: black; + margin: 0.2em; +} + + +#ctrlEditDisplaySlide { + position: absolute; + top: 15%; + min-width: 25%; + height: auto; + left: 15%; + min-width: 50%; + z-index: 52; + + display: none; +} + +div.ctrlTitle { + font-size: 1.2em; + font-weight: bold; +} + +div.ctrlBox { + display: inline-block; + background: black; + border: 2px solid green; + padding: 1em; + border-radius: 1em; +} + +div.ctrlButtons { + padding: 0.3em; + text-align: right; +} + +#ctrlEditRotationList { + min-height: 10em; width: 20em; } + +#ctrlListRotationLists { + min-height: 10em; + width: 20em; +} + +#ctrlListDisplaySlides { + min-height: 10em; + width: 20em; +} + + +div.ctrlBox .selectBox { + width: 100%; +} +
--- a/admin.php Thu Dec 05 10:03:45 2013 +0200 +++ b/admin.php Thu Dec 05 10:51:45 2013 +0200 @@ -499,9 +499,9 @@ } -function setDisplayVar(vname, vvalue) +function setShowMode(mode) { - jsSendPOSTRequest("action=update&type=displayVar&name="+vname+"&value="+vvalue); + jsSendPOSTRequest("action=ctrl&type=setShowMode&mode="+mode); }