# HG changeset patch # User Matti Hamalainen # Date 1416954077 -7200 # Node ID d0b6daedd21c95d10e22d04aef11c78df27e294d # Parent 2556828aaa93c24c160167df7509c273fa806b3b Remove per entry preview_type, I don't think it is needed after all. diff -r 2556828aaa93 -r d0b6daedd21c admajax.php --- a/admajax.php Wed Nov 26 00:11:10 2014 +0200 +++ b/admajax.php Wed Nov 26 00:21:17 2014 +0200 @@ -85,13 +85,6 @@ stChkRequestItemFail("info", $fake, $res, array(CHK_TYPE, VT_TEXT, "Invalid data."), array(CHK_LTEQ, VT_STR, SET_LEN_ENTRY_INFO, "Entry info text too long (%1 chars, must be less than %2).")); - - if ($full) - { - stChkRequestItemFail("preview_type", $fake, $res, - array(CHK_TYPE, VT_INT, "Invalid data."), - array(CHK_RANGE, VT_INT, array(EPREV_NONE, EPREV_AUDIO), "Invalid preview type value.")); - } break; case COMPO_POINTS: @@ -248,12 +241,6 @@ { echo "
". "Preview". - $previewTypeList[$compo["preview_type"]][0]." / "; - - if ($mode) - echo stGetFormOptionListFromArray($prefix."preview_type".$eid, " ", FALSE, $previewTypeList, $item["preview_type"], 0, 1); - else - echo $previewTypeList[$item["preview_type"]][1]; stPrintPreviewElements($compo, $item); @@ -1529,7 +1516,6 @@ "compo_id" => $id, "info" => "", "notes" => "", - "preview_type" => 0, "flags" => 0, "evalue" => 0, "utime" => 0, @@ -1678,8 +1664,8 @@ { case COMPO_NORMAL: $sql = stPrepareSQL( - "INSERT INTO entries (name,author,compo_id,info,notes,preview_type,utime,owner_id) VALUES (%S,%S,%d,%Q,%Q,%D,%d,0)", - "name", "author", $compo["id"], "info", "notes", "preview_type", time()); + "INSERT INTO entries (name,author,compo_id,info,notes,utime,owner_id) VALUES (%S,%S,%d,%Q,%Q,%D,%d,0)", + "name", "author", $compo["id"], "info", "notes", time()); break; case COMPO_POINTS: @@ -1799,7 +1785,6 @@ $cdata = array( "author" => "S", "info" => "Q", - "preview_type" => "D", "compo_id" => "D", ); break; diff -r 2556828aaa93 -r d0b6daedd21c admin.js --- a/admin.js Wed Nov 26 00:11:10 2014 +0200 +++ b/admin.js Wed Nov 26 00:21:17 2014 +0200 @@ -447,7 +447,7 @@ function updateEntry(cid, id) { - var args = jsMakePostArgs({"name":1, "author":1, "filename":1, "info":1, "notes":1, "compo_id":4, "evalue":2, "preview_type":4}, "en", id, true); + var args = jsMakePostArgs({"name":1, "author":1, "filename":1, "info":1, "notes":1, "compo_id":4, "evalue":2}, "en", id, true); var has_id = "compo_id" in lastPostArgs; var compo_id = lastPostArgs["compo_id"]; diff -r 2556828aaa93 -r d0b6daedd21c dbdefs.inc.php --- a/dbdefs.inc.php Wed Nov 26 00:11:10 2014 +0200 +++ b/dbdefs.inc.php Wed Nov 26 00:21:17 2014 +0200 @@ -286,7 +286,6 @@ array("evalue" , "INT", "DEFAULT 0"), array("file_id" , "INT", "DEFAULT 0"), // uploaded file id from "files" table array("preview_id" , "INT", "DEFAULT 0"), // uploaded preview file id from "files" table - array("preview_type" , "INT", "DEFAULT 0"), // see EPREV_*, overrides compo's general type if != 0 array("utime" , "INT", "DEFAULT 0"), array("owner_id" , "INT", "DEFAULT 0"), // 0 = admin, otherwise votekey id ),