appdb/ ./vendorview.php include/vendor.php

WineHQ wineowner at wine.codeweavers.com
Tue Jan 30 20:16:54 CST 2007


ChangeSet ID:	30918
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2007/01/30 20:16:54

Modified files:
	.              : vendorview.php 
	include        : vendor.php 

Log message:
	Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
	Add and use vendor::display()

Patch: http://cvs.winehq.org/patch.py?id=30918

Old revision  New revision  Changes     Path
 1.24          1.25          +1 -22      appdb/vendorview.php
 1.10          1.11          +28 -1      appdb/include/vendor.php

Index: appdb/vendorview.php
diff -u -p appdb/vendorview.php:1.24 appdb/vendorview.php:1.25
--- appdb/vendorview.php:1.24	31 Jan 2007  2:16:54 -0000
+++ appdb/vendorview.php	31 Jan 2007  2:16:54 -0000
@@ -33,28 +33,7 @@ if($oVendor->iVendorId)
     apidb_header("View Vendor");
     echo html_frame_start("Vendor Information",500);
 
-    echo 'Vendor Name: '.$oVendor->sName,"\n";
-    if($_SESSION['current']->hasPriv("admin"))
-    {
-        echo ' [<a href="'.apidb_fullurl("admin/editVendor.php").'?iVendorId='.$oVendor->iVendorId.'">edit</a>]',"\n";
-    }
-
-    echo '<br />',"\n";
-    if ($oVendor->sWebpage)
-        echo 'Vendor URL:  <a href="'.$oVendor->sWebpage.'">'.$oVendor->sWebpage.'</a> <br />',"\n";
-
-
-    if($oVendor->aApplicationsIds)
-    {
-        echo '<br />Applications by '.$oVendor->sName.'<br /><ol>',"\n";
-        foreach($oVendor->aApplicationsIds as $iAppId)
-        {
-            $oApp  = new Application($iAppId);
-            echo '<li> <a href="appview.php?iAppId='.$oApp->iAppId.'">'.$oApp->sName.'</a> </li>',"\n";
-        }
-        echo '</ol>',"\n";
-    }
-
+    $oVendor->display();
 
     echo html_frame_end();
     echo html_back_link(1);
Index: appdb/include/vendor.php
diff -u -p appdb/include/vendor.php:1.10 appdb/include/vendor.php:1.11
--- appdb/include/vendor.php:1.10	31 Jan 2007  2:16:54 -0000
+++ appdb/include/vendor.php	31 Jan 2007  2:16:54 -0000
@@ -148,11 +148,38 @@ class Vendor {
             return FALSE;
     }
 
-   function getOutputEditorValues($aClean)
+    function getOutputEditorValues($aClean)
     {
         $this->sName = $aClean['sVendorName'];
         $this->sWebpage = $aClean['sVendorWebpage'];
     }
+
+    function display()
+    {
+        echo 'Vendor Name: '.$this->sName,"\n";
+        if($this->canEdit())
+        {
+            echo "[<a href=\"".BASE."admin/editVendor.php?iVendorId=$this->iVendorId\">edit</a>]";
+        }
+
+        echo '<br />',"\n";
+        if ($this->sWebpage)
+            echo 'Vendor URL:  <a href="'.$this->sWebpage.'">'.
+                 $this->sWebpage.'</a> <br />',"\n";
+
+
+        if($this->aApplicationsIds)
+        {
+            echo '<br />Applications by '.$this->sName.'<br /><ol>',"\n";
+            foreach($this->aApplicationsIds as $iAppId)
+            {
+                $oApp  = new Application($iAppId);
+                echo '<li> <a href="appview.php?iAppId='.$oApp->iAppId.'">'.
+                     $oApp->sName.'</a> </li>',"\n";
+            }
+            echo '</ol>',"\n";
+        }
+    }
 }
 
 /* Get the total number of Vendors in the database */



More information about the wine-cvs mailing list