Mercurial > hg > fapweb
diff admajax.php @ 640:c78e11aa3162
Rename a database field, so that it does not conflict with AJAX request item
name.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 03 Nov 2014 01:58:04 +0200 |
parents | 4ea7a88cdb2f |
children | 1a123c6c2241 |
line wrap: on
line diff
--- a/admajax.php Mon Nov 03 01:40:28 2014 +0200 +++ b/admajax.php Mon Nov 03 01:58:04 2014 +0200 @@ -18,9 +18,9 @@ !stChkRequestItem("description", $fake, array(CHK_ISGT, VT_STR, 10, "Compo description too short"), array(CHK_LTEQ, VT_STR, SET_LEN_COMPO_DESC, "Compo description too long.")) || - !stChkRequestItem("path", $fake, + !stChkRequestItem("cpath", $fake, array(CHK_LTEQ, VT_STR, SET_LEN_COMPO_PATH, "Compo file path too long.")) || - !stChkRequestItem("type", $fake, + !stChkRequestItem("ctype", $fake, array(CHK_RANGE, VT_INT, array(COMPO_NORMAL, COMPO_ASSIGN), "Invalid compo type."))) return FALSE; @@ -85,7 +85,7 @@ function stGetCompoData($id, $item, $prefix) { - switch ($item["type"]) + switch ($item["ctype"]) { case COMPO_NORMAL: $str = " ". @@ -101,13 +101,13 @@ return " <h2>#".$id." - ".chentities($item["name"])."</h2>\n". " Name: ".stGetFormTextInput(40, SET_LEN_COMPO_NAME, "name", $id, $prefix, $item["name"])."<br />\n". - " File path: ".stGetFormTextInput(40, SET_LEN_COMPO_PATH, "path", $id, $prefix, $item["path"])."<br />\n". + " File path: ".stGetFormTextInput(40, SET_LEN_COMPO_PATH, "cpath", $id, $prefix, $item["cpath"])."<br />\n". " ".stGetFormTextArea(8, 60, "description", $id, $prefix, $item["description"])."<br />\n". " ".stGetFormButtonInput("update", $id, $prefix, "Update", "updateCompo(".$id.")")."\n". " ".stGetFormButtonInput("delete", $id, $prefix, "Delete", "deleteCompo(".$id.")")."\n". " ".stGetFormCheckBoxInput("visible", $id, $prefix, $item["visible"], "Visible", "onChange=\"setCompoData(".$id.",'visible')\"")."\n". " ".stGetFormCheckBoxInput("show_authors", $id, $prefix, $item["show_authors"], "Show authors", "onChange=\"setCompoData(".$id.",'show_authors')\"")."\n". - $str; + $str."\n"; } @@ -1434,7 +1434,7 @@ { $sql = stPrepareSQL( "INSERT INTO compos (name,description,visible,voting,show_authors,path,type) VALUES (%S,%Q,%D,0,0,0,%S,%D)", - "name", "description", "path", "type"); + "name", "description", "cpath", "ctype"); stExecSQLCond($sql, "OK, compo added."); } @@ -1520,8 +1520,8 @@ "visible" => "B", "voting" => "B", "show_authors" => "B", - "path" => "S", - "type" => "D", + "cpath" => "S", + "ctype" => "D", )); stExecSQLCond($sql, "OK, compo updated.");