# HG changeset patch # User Matti Hamalainen # Date 1386081652 -7200 # Node ID 5722c37aba2a2a80f90f2375beaf1b2305215948 # Parent f7b53225d31514d66de8d7891c86ba8a82d09998 It has begun. diff -r f7b53225d315 -r 5722c37aba2a admajax.php --- 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 + "
\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". + "
\n"; + break; + case "news": echo "
\n". @@ -899,5 +913,8 @@ break; } +if (!$errorSet) + stSaveDisplayVars(); + stDumpAJAXStatusErrors(); ?> \ No newline at end of file diff -r f7b53225d315 -r 5722c37aba2a admin.css --- 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; } diff -r f7b53225d315 -r 5722c37aba2a admin.php --- 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? This will completely annihilate all current show positions!", 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 = "";