# HG changeset patch # User Matti Hamalainen # Date 1416476549 -7200 # Node ID 1be30385e9d4e6efb8c0fbdc9f72c1c76cc764ae # Parent be0f465de86cafc29779ae1fa3fe5ce8d44c7ae3 More work on the improved(?) entry editing interface. diff -r be0f465de86c -r 1be30385e9d4 admajax.php --- a/admajax.php Thu Nov 20 11:41:36 2014 +0200 +++ b/admajax.php Thu Nov 20 11:42:29 2014 +0200 @@ -193,31 +193,43 @@ if ($mode != 2) { echo - "
".($item["show_id"] > 0 ? $item["show_id"] : "-")."
\n"; + "
".($item["show_id"] > 0 ? $item["show_id"] : "-")."
\n"; } switch ($compo["ctype"]) { case COMPO_NORMAL: echo - "
\n". + "
\n". " ".stGetEditFormTextInput($mode, "Name", 20, SET_LEN_ENTRY_NAME, "name", $eid, $prefix, $item["name"])."\n". " ".stGetEditFormTextInput($mode, "Author", 15, SET_LEN_ENTRY_AUTHOR, "author", $eid, $prefix, $item["author"])."\n". "
\n". - "
\n". - " ".stGetEditFormTextInput($mode, "Filename", 20, SET_LEN_ENTRY_FILENAME, "filename", $eid, $prefix, $item["filename"])."\n". + "
\n". + " ".stGetEditFormTextInput($mode, "Scratch filename", 20, SET_LEN_ENTRY_FILENAME, "filename", $eid, $prefix, $item["filename"])."\n"; + + switch ($mode) + { + case 0: + + break; + + case 2: + echo "
Set above filename only if entry file not available. Otherwise, add entry, then upload.
"; + break; + } + + echo "
\n"; - // XXX TODO UPLOAD BUTTON or something echo - "
\n". + "
\n". " ".stGetEditFormTextArea($mode, $mode == 2 ? "Info shown during compo" : "Info", 2, 30, "info", $eid, $prefix, $item["info"])."\n". " ".stGetEditFormTextArea($mode, $mode == 2 ? "Notes for internal use" : "Notes", 2, 30, "notes", $eid, $prefix, $item["notes"])."\n". "
\n"; if ($mode == 0 || $mode == 1) { - echo "
".$previewTypeList[$compo["preview_type"]][0]." / \n"; + echo "
".$previewTypeList[$compo["preview_type"]][0]." / \n"; if ($mode) echo stGetFormOptionListFromArray($prefix."preview_type".$eid, " ", FALSE, $previewTypeList, $item["preview_type"], 0, 1); @@ -233,13 +245,13 @@ case COMPO_POINTS: case COMPO_ASSIGN: echo - "
". + "
". stGetEditFormTextInput($mode, "Name", 15, SET_LEN_ENTRY_AUTHOR, "name", $eid, $prefix, $item["name"]). "
\n". - "
". + "
". stGetEditFormTextInput($mode, $compoModeData[$compo["ctype"]][2], 5, SET_LEN_ENTRY_AUTHOR, "evalue", $eid, $prefix, $item["evalue"]). "
\n". - "
\n". + "
\n". " ".stGetEditFormTextArea($mode, "Notes", 2, 30, "notes", $eid, $prefix, $item["notes"])."\n". "
\n"; break; @@ -269,7 +281,7 @@ "ORDER BY compos.id DESC"; echo - "
". + "
". stGetFormOptionListStart($prefix."compo_id".$eid, " ", TRUE, 0); foreach (stExecSQL($sql) as $cdata) @@ -283,6 +295,8 @@ echo stGetFormOptionListEnd(" ", TRUE). + "
\n". + "
\n". stGetFormButtonInput("update", $eid, $prefix, "Update", "updateEntry(".$item["compo_id"].",".$eid.")"). stGetFormButtonInput("delete", $eid, $prefix, "Delete", "deleteEntry(".$item["compo_id"].",".$eid.")"). "
\n";