# HG changeset patch # User Matti Hamalainen # Date 1386251968 -7200 # Node ID d454f7eebddd51da0ada83c074db38a14ded0654 # Parent 05debbea33c175b552de2684a0c47ad9f88692a2 Moar work. diff -r 05debbea33c1 -r d454f7eebddd admajax.php --- a/admajax.php Thu Dec 05 15:57:48 2013 +0200 +++ b/admajax.php Thu Dec 05 15:59:28 2013 +0200 @@ -226,8 +226,25 @@ } -function stGet() +function stGetInfoCurrEntryList() { + $sql = stPrepareSQL( + "SELECT * FROM entries WHERE compo_id=%d ORDER BY show_id ASC", + stGetDisplayVar("compoID")); + + $currShowID = stGetDisplayVar("compoCurrEntry"); + $str = ""; + if (($res = stExecSQL($sql)) !== false) + { + foreach ($res as $item) + { + $str .= + " ".stGetOptionListItem($item["id"], + ($item["show_id"] == $currShowID), + sprintf("%3d. %s by %s", $item["show_id"], $item["name"], $item["author"])); + } + } + return $str; } @@ -500,6 +517,10 @@ case "infoCurrEntryData": echo stGetInfoCurrEntryData(); break; + + case "infoCurrEntryList": + echo stGetInfoCurrEntryList(); + break; case "infoEditRotationList": echo @@ -655,24 +676,8 @@ echo "
\n". - " ".stGetOptionListStart("ctrlEntryList"); - - $sql = stPrepareSQL( - "SELECT * FROM entries WHERE compo_id=%d ORDER BY show_id ASC", - $currCompoID); - - $currShowID = stGetDisplayVar("compoCurrEntry"); - if (($res = stExecSQL($sql)) !== false) - { - foreach ($res as $item) - { - echo " ".stGetOptionListItem($item["id"], - ($item["show_id"] == $currShowID), - sprintf("%3d. %s by %s", $item["show_id"], $item["name"], $item["author"])); - } - } - - echo + " ".stGetOptionListStart("ctrlEntryList"). + stGetInfoCurrEntryList(). " ".stGetOptionListEnd(). "
\n". " ".stGetFormButtonInput("setentry", "", "", "Set selected entry", "setSelectedEntry()")."\n". diff -r 05debbea33c1 -r d454f7eebddd admin.php --- a/admin.php Thu Dec 05 15:57:48 2013 +0200 +++ b/admin.php Thu Dec 05 15:59:28 2013 +0200 @@ -505,6 +505,18 @@ } +function activateCompo() +{ + var msuccess = function () + { + jsRefreshItems("ctrlEntryList", "infoCurrEntryList", ""); + jsRefreshItems("ctrlCurrEntryData", "infoCurrEntryData", ""); + } + + jsSendPOSTRequest("action=ctrl&type=setCompoID&id="+jsGetValue("ctrlCompoList", 4), msuccess); +} + + function updateTabList(tabset, extra) { var tabs = "";