changeset 849:d0b6daedd21c

Remove per entry preview_type, I don't think it is needed after all.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 26 Nov 2014 00:21:17 +0200
parents 2556828aaa93
children cb281b64cd82
files admajax.php admin.js dbdefs.inc.php
diffstat 3 files changed, 3 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- 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 "   <div class=\"editControl entryPreview\">".
           "<span class=\"editControlTitle\">Preview</span>".
-          $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;
--- 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"];
 
--- 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
   ),