Replace objectOutputTableRow() with objectGetTableRow(). Redesign the table output mechanism so

that we fetch a table row from a class instead of letting the class display it. Move adding of
edit/delete links from the classes to the objectManager. Fix a hole in the distribution class
where an uninitialized variable could have been used in the constructor.
This commit is contained in:
Alexander Nicolaysen Sørnes
2007-06-14 00:50:35 +00:00
committed by WineHQ
parent 46f4f20ce6
commit cd198f44d7
14 changed files with 134 additions and 108 deletions

View File

@@ -222,27 +222,16 @@ class Vendor {
return $aCells;
}
/* arg1 = OM object, arg2 = CSS style, arg3 = text for edit link */
function objectOutputTableRow($oObject, $sClass = "", $sEditLinkLabel)
function objectGetTableRow()
{
$aCells = array(
"<a href=\"".$oObject->makeUrl("view", $this->iVendorId,
"View Vendor")."\">$this->sName</a>",
$this->objectMakeLink(),
"<a href=\"$this->sWebpage\">$this->sWebpage</a>",
array(sizeof($this->aApplicationsIds), "align=\"right\""));
if($this->canEdit())
{
if(!sizeof($this->aApplicationsIds))
$shDeleteLink = " &nbsp; [<a href=\"".$oObject->makeUrl("delete",
$this->iVendorId, "View Vendors")."\">".
"delete</a>]";
$bDeleteLink = sizeof($this->aApplicationsIds) ? FALSE : TRUE;
$aCells[sizeof($aCells)] = "[<a href=\"".$oObject->makeUrl("edit",
$this->iVendorId, "Edit Vendor")."\">$sEditLinkLabel</a>]$shDeleteLink";
}
echo html_tr($aCells, $sClass);
return array($aCells, null, $bDeleteLink, null);
}
function canEdit()