Alexander Nicolaysen Sørnes : comment: Require versionId and message body to be defined

Chris Morgan cmorgan at winehq.org
Mon Oct 22 18:32:03 CDT 2007


Module: appdb
Branch: master
Commit: b48221cdd4d1238e5974f50039fc266da7fbedca
URL:    http://source.winehq.org/git/appdb.git/?a=commit;h=b48221cdd4d1238e5974f50039fc266da7fbedca

Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date:   Mon Oct 22 17:07:31 2007 +0200

comment: Require versionId and message body to be defined

---

 include/comment.php |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/include/comment.php b/include/comment.php
index d26f088..e6646d7 100644
--- a/include/comment.php
+++ b/include/comment.php
@@ -242,8 +242,8 @@ class Comment {
         $oM = new objectManager("comment", "Post new ocmment");
         $oM->setReturnTo($oVersion->objectMakeUrl());
         // reply post buttons
-        echo "	[<a href=\"".$oM->makeUrl("add")."&iAppId=$this->iAppId&amp;iVersionId=$this->iVersionId\"><small>post new</small></a>] \n";
-        echo "	[<a href=\"".$oM->makeUrl("add")."&iAppId=$this->iAppId&amp;iVersionId=$this->iVersionId&amp;sSubject=".
+        echo "	[<a href=\"".$oM->makeUrl("add")."&amp;iVersionId=$this->iVersionId\"><small>post new</small></a>] \n";
+        echo "	[<a href=\"".$oM->makeUrl("add")."&amp;iVersionId=$this->iVersionId&amp;sSubject=".
                 urlencode("$sSubject")."&amp;iThread=$this->iCommentId\"><small>reply to this</small></a>] \n";
 
         echo "</td></tr>\n";
@@ -570,13 +570,26 @@ class Comment {
         switch($sAction)
         {
             case "add":
-                return array("iThread", "iAppId", "iVersionId");
+                return array("iThread", "iVersionId");
 
             default:
                 return null;
         }
     }
 
+    function checkOutputEditorInput($aClean)
+    {
+        $sErrors = "";
+
+        if(!$aClean['iVersionId'])
+            $sErrors .= "<li>No version id defined; something may have gone wrong with the URL</li>\n";
+
+        if(!$aClean['sBody'])
+            $sErrors .= "<li>You need to enter a message!</li>\n";
+
+        return $sErrors;
+    }
+
     function outputEditor($aClean)
     {
         $sMesTitle = "<b>Post New Comment</b>";
@@ -612,7 +625,6 @@ class Comment {
         echo html_frame_end();
 
         echo "<input type=\"hidden\" name=\"iThread\" value=\"".$aClean['iThread']."\" />\n";
-        echo "<input type=\"hidden\" name=\"iAppId\" value=\"".$aClean['iAppId']."\" />\n";
         echo "<input type=\"hidden\" name=\"iVersionId\" value=\"".$aClean['iVersionId']."\" />\n";
     }
 




More information about the wine-cvs mailing list