Make objectGetTableRow() return a TableRow class instance. Added accessors to set the
appropriate parameters in the TableRow class. Removed some unused parameters from the TableRow class.
This commit is contained in:
@@ -503,7 +503,8 @@ class appData
|
||||
$oApp->objectMakeLink(),
|
||||
$this->iVersionId ? $oVersion->objectMakeLink() : "N/A");
|
||||
|
||||
return array($aCells, null, false, null);
|
||||
$oTableRow = new TableRow($aCells);
|
||||
return $oTableRow;
|
||||
}
|
||||
|
||||
function objectDisplayQueueProcessingHelp()
|
||||
|
||||
@@ -864,7 +864,8 @@ class Application {
|
||||
$sVendor,
|
||||
$this->sName);
|
||||
|
||||
return array($aCells, null, false, null);
|
||||
$oTableRow = new TableRow($aCells);
|
||||
return $oTableRow;
|
||||
}
|
||||
|
||||
function canEdit()
|
||||
|
||||
@@ -460,10 +460,12 @@ class distribution {
|
||||
"<a href=\"$this->sUrl\">$this->sUrl</a>",
|
||||
array(sizeof($this->aTestingIds), "align=\"right\""));
|
||||
|
||||
// enable the 'delete' action if this distribution has no testing results
|
||||
$bDeleteLink = sizeof($this->aTestingIds) ? FALSE : TRUE;
|
||||
// enable the 'delete' action if this distribution has no testing results
|
||||
$bDeleteLink = sizeof($this->aTestingIds) ? FALSE : TRUE;
|
||||
|
||||
return array($aCells, null, $bDeleteLink, null);
|
||||
$oTableRow = new TableRow($aCells);
|
||||
$oTableRow->SetRowHasDeleteLink($bDeleteLink);
|
||||
return $oTableRow;
|
||||
}
|
||||
|
||||
// Whether the user has permission to edit distributions
|
||||
|
||||
@@ -474,7 +474,8 @@ class maintainer
|
||||
($this->bSuperMaintainer) ? "Yes" : "No",
|
||||
$oUser->objectMakeLink());
|
||||
|
||||
return array($aCells, null, false, null);
|
||||
$oTableRow = new TableRow($aCells);
|
||||
return $oTableRow;
|
||||
}
|
||||
|
||||
function ObjectDisplayQueueProcessingHelp()
|
||||
|
||||
@@ -133,7 +133,7 @@ class ObjectManager
|
||||
{
|
||||
$oObject = new $this->sClass(null, $oRow);
|
||||
|
||||
$this->oTableRow->TableRow($oObject->objectGetTableRow());
|
||||
$this->oTableRow = $oObject->objectGetTableRow();
|
||||
|
||||
if(!$this->oTableRow->sStyle)
|
||||
$this->oTableRow->sStyle = ($iCount % 2) ? "color0" : "color1";
|
||||
@@ -144,7 +144,7 @@ class ObjectManager
|
||||
if($oObject->canEdit())
|
||||
{
|
||||
$shDeleteLink = "";
|
||||
if($this->oTableRow->bDeleteLink)
|
||||
if($this->oTableRow->bHasDeleteLink)
|
||||
{
|
||||
$shDeleteLink = ' [ <a href="'.$this->makeUrl("delete", $oObject->objectGetid()).
|
||||
'">delete</a> ]';
|
||||
@@ -763,30 +763,38 @@ class MultiPage
|
||||
|
||||
class TableRow
|
||||
{
|
||||
var $aCells;
|
||||
var $sStyle;
|
||||
var $sEditLinkLabel;
|
||||
var $bDeleteLink;
|
||||
var $aRowClickable;
|
||||
var $aCells; // array that contains the columns for a table row
|
||||
var $sStyle; // CSS style to be used
|
||||
var $bHasDeleteLink;
|
||||
var $aRowClickable; //FIXME: we should describe the entries required here by creating a class for a clickable row entry or something
|
||||
var $bCanEdit;
|
||||
var $iId;
|
||||
|
||||
function TableRow($aInput)
|
||||
function TableRow($aCells)
|
||||
{
|
||||
if(!$aInput)
|
||||
if(!$aCells)
|
||||
return;
|
||||
|
||||
/* aInput is returned from objectGetTableRow(); an array with the following members
|
||||
0: an array with the contents of the table row
|
||||
1: CSS style to be used. If it is null we use the default
|
||||
2: Is TRUE if we should display a delete link with the edit link
|
||||
3: Contains an array with info if we should make the entrie table row clickable,
|
||||
null otherwise */
|
||||
$this->aCells = $aCells;
|
||||
|
||||
$this->aCells = $aInput[0];
|
||||
$this->sStyle = $aInput[1];
|
||||
$this->bDeleteLink = $aInput[2];
|
||||
$this->aRowClickable = $aInput[3];
|
||||
// initialize the rest of the variables
|
||||
$this->sStyle = null;
|
||||
$this->bHasDeleteLink = false;
|
||||
$this->aRowClickable = null;
|
||||
}
|
||||
|
||||
function SetStyle($sStyle)
|
||||
{
|
||||
$this->sStyle = $sStyle;
|
||||
}
|
||||
|
||||
function SetRowHasDeleteLink($bHasDeleteLink)
|
||||
{
|
||||
$this->bHasDeleteLink = $bHasDeleteLink;
|
||||
}
|
||||
|
||||
function SetRowClickable($aRowClickableInfo)
|
||||
{
|
||||
$this->aRowClickable = $aRowClickableInfo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@ $watermark = new Image("/images/watermark.png");
|
||||
/**
|
||||
* Screenshot class for handling screenshots and thumbnails
|
||||
*/
|
||||
class screenshot {
|
||||
class screenshot
|
||||
{
|
||||
var $iScreenshotId;
|
||||
|
||||
// parameters necessary for creating a new screenshot with
|
||||
|
||||
@@ -957,7 +957,11 @@ class testData{
|
||||
($bHasMaintainer ? "YES" : "no"),
|
||||
$this->sTestedRating);
|
||||
|
||||
return array($aCells, $this->sTestedRating, true, null);
|
||||
$oTableRow = new TableRow($aCells);
|
||||
$oTableRow->SetStyle($this->sTestedRating);
|
||||
$oTableRow->SetRowHasDeleteLink(true);
|
||||
|
||||
return $oTableRow;
|
||||
}
|
||||
|
||||
function canEdit()
|
||||
|
||||
@@ -231,7 +231,10 @@ class Vendor {
|
||||
|
||||
$bDeleteLink = sizeof($this->aApplicationsIds) ? FALSE : TRUE;
|
||||
|
||||
return array($aCells, null, $bDeleteLink, null);
|
||||
$oTableRow = new TableRow($aCells);
|
||||
$oTableRow->SetRowHasDeleteLink($bDeleteLink);
|
||||
|
||||
return $oTableRow;
|
||||
}
|
||||
|
||||
function canEdit()
|
||||
|
||||
@@ -1350,7 +1350,8 @@ class version {
|
||||
$oApp->objectMakeLink(),
|
||||
$this->sName);
|
||||
|
||||
return array($aCells, null, false, null);
|
||||
$oTableRow = new TableRow($aCells);
|
||||
return $oTableRow;
|
||||
}
|
||||
|
||||
function objectDisplayQueueProcessingHelp()
|
||||
|
||||
Reference in New Issue
Block a user