Mercurial > hg > fapweb
changeset 454:ea7fc4e9f602
Moar work.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 06 Dec 2013 17:16:46 +0200 |
parents | f2a0da566e30 |
children | a23441096913 |
files | admajax.php admin.php msite.inc.php |
diffstat | 3 files changed, 28 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/admajax.php Fri Dec 06 17:09:06 2013 +0200 +++ b/admajax.php Fri Dec 06 17:16:46 2013 +0200 @@ -561,12 +561,14 @@ 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(); - } + stSetDisplayVarUpd("rotateDuration", $duration); + } + break; + + case "setRotateDuration": + if (stChkRequestItem("id", $list_id, array(CHK_TYPE, VT_INT, "Invalid data."))) + { + stSetDisplayVarUpd("rotateList", $list_id); } break; @@ -575,12 +577,7 @@ array(CHK_TYPE, VT_INT, "Invalid data."), array(CHK_RANGE, VT_INT, array(SMODE_DISABLED, SMODE_COMPO), "Invalid mode value."))) { - $prev = stGetDisplayVar("showMode"); - if ($prev != $mode) - { - stDisplayUpdated(); - stSetDisplayVar("showMode", $mode); - } + stSetDisplayVarUpd("showMode", $mode); } break; @@ -590,15 +587,10 @@ if (stFetchSQL("SELECT id FROM compos WHERE id=".$compo_id) === false) stError("Invalid compo ID ".$compo_id); else + if (stSetDisplayVarUpd("compoID", $compo_id)) { - $prev = stGetDisplayVar("compoID"); - if ($prev != $compo_id) - { - stSetDisplayVar("compoCurrEntry", 0); - stSetDisplayVar("compoPrevEntry", 0); - stSetDisplayVar("compoID", $compo_id); - stDisplayUpdated(); - } + stSetDisplayVar("compoCurrEntry", 0); + stSetDisplayVar("compoPrevEntry", 0); } } break; @@ -846,7 +838,7 @@ " ".stGetFormButtonInput("setdur", "", "", "Set", "setRotateDuration()")."\n". " ".stGetFormTextInput(3, 5, "", "ctrlRotSlideDuration", "", stGetDisplayVar("rotateDuration"))." sec\n". " - ". - " ".stGetFormButtonInput("actlist", "", "", "Set Active", "activateRotationList()")."\n". + " ".stGetFormButtonInput("actlist", "", "", "Set Active", "setActiveRotationList()")."\n". " ".stGetFormButtonInput("editlist", "", "", "Edit", "editRotationList()")."\n". " ".stGetFormButtonInput("newlist", "", "", "New", "newRotationList()")."\n". " ".stGetFormButtonInput("dellist", "", "", "Delete", "deleteRotationList()")."\n".
--- a/admin.php Fri Dec 06 17:09:06 2013 +0200 +++ b/admin.php Fri Dec 06 17:16:46 2013 +0200 @@ -575,11 +575,11 @@ } -function activateRotationList() +function setActiveRotationList() { var id = jsGetValue("ctrlRotationListsSel", 4); if (id > 0) - jsSendPOSTRequest("action=ctrl&type=activateRotationList&id="+id); + jsSendPOSTRequest("action=ctrl&type=setActiveRotationList&id="+id); else jsMessageBox("No rotation list selected?"); }
--- a/msite.inc.php Fri Dec 06 17:09:06 2013 +0200 +++ b/msite.inc.php Fri Dec 06 17:16:46 2013 +0200 @@ -96,6 +96,19 @@ } +function stSetDisplayVarUpd($name, $value) +{ + if (stGetDisplayVar($name) != $value) + { + stSetDisplayVar($name, $value); + stDisplayUpdated(); + return TRUE; + } + else + return FALSE; +} + + function stGetDisplayVar($name) { global $displayVars;