changeset 767:1337c483b9f9

Add some comments.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 20 Nov 2014 12:23:13 +0200
parents 4a8bcf738bd4
children 91c9fef38e2d
files admajax.php
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/admajax.php	Thu Nov 20 12:22:54 2014 +0200
+++ b/admajax.php	Thu Nov 20 12:23:13 2014 +0200
@@ -62,6 +62,7 @@
 {
   $res = TRUE;
 
+  // Things common for all compo types
   stChkRequestItemFail("name", $fake, $res,
     array(CHK_ISGT, VT_STR, 0, "Name too short."),
     array(CHK_LTEQ, VT_STR, SET_LEN_ENTRY_NAME, "Name too long."));
@@ -70,6 +71,7 @@
     array(CHK_TYPE, VT_TEXT, "Invalid data."),
     array(CHK_LTEQ, VT_STR, SET_LEN_ENTRY_NOTES, "Entry notes too long."));
 
+  // Check based on compo type
   switch ($ctype)
   {
     case COMPO_NORMAL:
@@ -144,7 +146,7 @@
 
       $str2 =
         "  ".stGetFormCheckBoxInput("voting", $id, $prefix, $item["voting"],
-        "Enable voting", "onChange=\"setCompoData(".$id.",'voting')\"").
+            "Enable voting", "onChange=\"setCompoData(".$id.",'voting')\"").
         "  ".stGetFormCheckBoxInput("show_authors", $id, $prefix, $item["show_authors"], "Show authors")."\n".
         "  ".stGetFormOptionListFromArray($prefix."preview_type".$id, "  ", FALSE, $previewTypeList, $item["preview_type"], 0, 0)."\n";
       break;
@@ -185,10 +187,12 @@
 {
   global $entryFlagsList, $previewTypeList, $compoModeData;
 
+  // Fetch compo data if we don't have it already
   $eid = $item["id"];
   if ($compo === FALSE)
     $compo = stFetchSQL("SELECT * FROM compos WHERE id=".$item["compo_id"]);
 
+  // Output wrapper div only if requested
   if ($tr)
   {
     echo
@@ -196,6 +200,7 @@
       "\" id=\"entry".$eid."\"".($mode == EEMODE_NORMAL ? " onClick=\"activateEntry(".$eid.")\"" : "").">\n";
   }
 
+  // Only show show_id if this is a normal compo and we are not adding
   if ($mode != EEMODE_ADD && $compo["ctype"] == COMPO_NORMAL)
   {
     echo