Alexander Nicolaysen Sørnes : note: When showing for specific versions, make sure at least one version is selected

Alexander Nicolaysen Sørnes asornes at winehq.org
Fri Aug 7 21:14:20 CDT 2009


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

Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date:   Sat Aug  8 04:13:20 2009 +0200

note: When showing for specific versions, make sure at least one version is selected

---

 include/note.php |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/include/note.php b/include/note.php
index b88727b..92891b5 100644
--- a/include/note.php
+++ b/include/note.php
@@ -443,7 +443,10 @@ class Note {
 
     public function getNoteLinksFromInput($aValues)
     {
-        $oApp = new application($this->iAppId);
+        $iAppId = $this->iAppId;
+        if(!$iAppId)
+            $iAppId = getInput('iAppId', $aValues);
+        $oApp = new application($iAppId);
         $iCount = sizeof($oApp->getVersions());
         $aLinkedVersions = html_read_input_series('iVersionId', $aValues, $iCount);
         $aLinks = array();
@@ -595,6 +598,20 @@ class Note {
         echo html_frame_end();
     }
 
+    public function checkOutputEditorInput($aClean)
+    {
+        $shErrors = '';
+        $iVersionId = getInput('iVersionId', $aClean);
+
+        if($iVersionId == APPNOTE_SHOW_FOR_SPECIFIC_VERSIONS)
+        {
+            $aNoteLinks = $this->getNoteLinksFromInput($aClean);
+            if(!sizeof($aNoteLinks))
+                $shErrors .= '<li>You need to show the note for at least one version, or choose another display mode</li>';
+        }
+        return $shErrors;
+    }
+
     /* retrieves values from $aValue that were output by outputEditor() */
     /* $aValues can be $_REQUEST or any array with the values from outputEditor() */
     function GetOutputEditorValues($aValues)




More information about the wine-cvs mailing list