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