Alexander Nicolaysen Sørnes : vendor: Show versions and their ratings along with app names

Alexander Nicolaysen Sørnes asornes at winehq.org
Thu Apr 21 19:38:46 CDT 2011


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

Author: Alexander Nicolaysen Sørnes <alexsornes at gmail.com>
Date:   Thu Apr 21 16:55:35 2011 +0200

vendor: Show versions and their ratings along with app names

---

 include/vendor.php |   53 ++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 49 insertions(+), 4 deletions(-)

diff --git a/include/vendor.php b/include/vendor.php
index 820741b..189a3d0 100644
--- a/include/vendor.php
+++ b/include/vendor.php
@@ -392,15 +392,60 @@ class Vendor {
 
         if($this->aApplicationsIds)
         {
-            echo '<br>Applications by '.$this->sName.'<br><ol>',"\n";
+            echo '<br>Applications by '.$this->sName.'<br><br>',"\n";
+
+            $oTable = new Table();
+
+            $oRow = new TableRow();
+            $oRow->AddTextCell('Name');
+            $oRow->AddTextCell('Rating');
+            $oRow->AddTextCell('Tested Wine version');
+            $oRow->SetClass('color4');
+            $oRow->SetStyle('color: #ffffff;');
+            $oTable->AddRow($oRow);
+
+            $i = 0;
+
             foreach($this->aApplicationsIds as $iAppId)
             {
                 $oApp  = new Application($iAppId);
 
-                if($oApp->objectGetState() == 'accepted')
-                    echo '<li>'.$oApp->objectMakeLink().'</li>',"\n";
+                if($oApp->objectGetState() != 'accepted')
+                    continue;
+
+                $i++;
+                $oRow = new TableRow();
+                $oRow->SetClass(($i % 2) ? 'color0' : 'color1');
+                $oRow->AddTextCell($oApp->objectMakeLink());
+                $oRow->AddTextCell('');
+                $oRow->AddTextCell('');
+                $oTable->AddRow($oRow);
+
+                $aVersions = $oApp->objectGetChildrenClassSpecific('version');
+                
+                foreach($aVersions as $oVersion)
+                {
+                    if($oVersion->objectGetState() != 'accepted')
+                        continue;
+                        
+                    $i++;
+                    $oRow = new TableRow();
+                    $oRow->SetClass(($i % 2) ? 'color0' : 'color1');
+                    $oRow->AddTextCell(' &nbsp; '.$oVersion->objectMakeLink());
+                    
+                    $oCell = new TableCell($oVersion->sTestedRating);
+                    $oCell->setClass($oVersion->sTestedRating);
+                    $oRow->AddCell($oCell);
+
+                    $oCell = new TableCell($oVersion->sTestedRelease);
+                    $oCell->setClass($oVersion->sTestedRating);
+                    $oRow->AddCell($oCell);
+
+                    $oTable->AddRow($oRow);
+                }
+                
             }
-            echo '</ol>',"\n";
+            echo $oTable->GetString(),"\n";
         }
     }
 




More information about the wine-cvs mailing list