Add and use vendor::display()

This commit is contained in:
Alexander Nicolaysen Sørnes
2007-01-31 02:16:54 +00:00
committed by WineHQ
parent cc7c6e661a
commit 446191f533
2 changed files with 29 additions and 23 deletions

View File

@@ -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 */

View File

@@ -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);