From 0e3472e1bfc07cac3952e12d273613c9a04bd6cf Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Tue, 31 Jul 2007 01:51:40 +0000 Subject: [PATCH] objectGetHeader() should return a TableRow instance as this is closer to what the information represents and is a much more useful form. --- include/appData.php | 13 ++++++------- include/application.php | 13 ++++++------- include/browse_newest_apps.php | 16 +++++++++++----- include/distribution.php | 15 ++++++++++----- include/maintainer.php | 15 +++++++-------- include/objectManager.php | 10 +++++++--- include/table.php | 2 +- include/testData.php | 18 +++++++++--------- include/vendor.php | 15 ++++++++++----- include/version.php | 14 +++++++------- 10 files changed, 74 insertions(+), 57 deletions(-) diff --git a/include/appData.php b/include/appData.php index 6279224..c790213 100644 --- a/include/appData.php +++ b/include/appData.php @@ -305,13 +305,12 @@ class appData function objectGetHeader($sType) { - $aCells = array( - "Submission Date", - "Submitter", - "Application", - "Version"); - - return $aCells; + $oTableRow = new TableRow(); + $oTableRow->AddTextCell("Submission Date"); + $oTableRow->AddTextCell("Submitter"); + $oTableRow->AddTextCell("Application"); + $oTableRow->AddTextCell("Version"); + return $oTableRow; } function objectGetEntries($bQueued, $bRejected, $iRows = 0, $iStart = 0, $sType) diff --git a/include/application.php b/include/application.php index a91e503..083d040 100644 --- a/include/application.php +++ b/include/application.php @@ -884,13 +884,12 @@ class Application { function objectGetHeader() { - $aCells = array( - "Submission Date", - "Submitter", - "Vendor", - "Application"); - - return $aCells; + $oTableRow = new TableRow(); + $oTableRow->AddTextCell("Submission Date"); + $oTableRow->AddTextCell("Submitter"); + $oTableRow->AddTextCell("Vendor"); + $oTableRow->AddTextCell("Application"); + return $oTableRow; } function objectGetTableRow() diff --git a/include/browse_newest_apps.php b/include/browse_newest_apps.php index 4e38c77..733c169 100644 --- a/include/browse_newest_apps.php +++ b/include/browse_newest_apps.php @@ -57,12 +57,18 @@ class browse_newest_apps function objectGetHeader() { - $aCells = array( - array("Submission Date", "color=\"white\""), - array("Application", "color=\"white\""), - array("Description", "color=\"white\"")); + $oTableRow = new TableRow(); - return $aCells; + $oTableCell = new TableCell("Submission Date"); + $oTableRow->AddCell($oTableCell); + + $oTableCell = new TableCell("Application"); + $oTableRow->AddCell($oTableCell); + + $oTableCell = new TableCell("Description"); + $oTableRow->AddCell($oTableCell); + + return $oTableRow; } function objectGetTableRow() diff --git a/include/distribution.php b/include/distribution.php index fce949a..7fff8b5 100644 --- a/include/distribution.php +++ b/include/distribution.php @@ -423,12 +423,17 @@ class distribution { function objectGetHeader() { - $aCells = array( - "Distribution name", - "Distribution url", - array("Linked Tests", "align=\"right\"")); + $oTableRow = new TableRow(); - return $aCells; + $oTableRow->AddTextCell("Distribution name"); + + $oTableRow->AddTextCell("Distribution url"); + + $oTableCell = new TableCell("Linked Tests"); + $oTableCell->SetAlign("right"); + $oTableRow->AddCell($oTableCell); + + return $oTableRow; } function objectGetEntries($bQueued, $bRejected, $iRows = 0, $iStart = 0) diff --git a/include/maintainer.php b/include/maintainer.php index e0b87ae..3cf36c2 100644 --- a/include/maintainer.php +++ b/include/maintainer.php @@ -648,14 +648,13 @@ class maintainer function ObjectGetHeader() { - $aCells = array( - "Submission Date", - "Application Name", - "Version", - "Super maintainer?", - "Submitter"); - - return $aCells; + $oTableRow = new TableRow(); + $oTableRow->AddTextCell("Submission Date"); + $oTableRow->AddTextCell("Application Name"); + $oTableRow->AddTextCell("Version"); + $oTableRow->AddTextCell("Super maintainer?"); + $oTableRow->AddTextCell("Submitter"); + return $oTableRow; } function ObjectGetTableRow() diff --git a/include/objectManager.php b/include/objectManager.php index b79166a..a165fdd 100644 --- a/include/objectManager.php +++ b/include/objectManager.php @@ -643,14 +643,18 @@ class ObjectManager function outputHeader($sClass) { $oObject = new $this->sClass(); - $aCells = $oObject->objectGetHeader(); + $oTableRow = $oObject->objectGetHeader(); /* Add an action column if the user can edit this class, or if it is a queue. Even though a user annot process items, he can edit his queued submissions */ if($oObject->canEdit() || $this->bIsQueue) - $aCells[] = "Action"; + { + $oTableRow->AddTextCell("Action"); + } - echo html_tr($aCells, $sClass); + $oTableRow->SetClass($sClass); + + echo $oTableRow->GetString(); } function handleMultiPageControls($aClean, $bItemsPerPageSelector = TRUE) diff --git a/include/table.php b/include/table.php index ec9d810..6e2e9dc 100644 --- a/include/table.php +++ b/include/table.php @@ -68,7 +68,7 @@ class TableRowClick $sStr.= ' onclick="DoNav(\''.$this->shUrl.'\');"'; - return $sStr; + return $sStr; } } diff --git a/include/testData.php b/include/testData.php index 48557d8..62147c7 100644 --- a/include/testData.php +++ b/include/testData.php @@ -991,15 +991,15 @@ class testData{ function objectGetHeader() { - $aCells = array( - "Submission Date", - "Submitter", - "Application", - "Version", - "Release", - "Has maintainer", - "Rating"); - return $aCells; + $oTableRow = new TableRow(); + $oTableRow->AddTextCell("Submission Date"); + $oTableRow->AddTextCell("Submitter"); + $oTableRow->AddTextCell("Application"); + $oTableRow->AddTextCell("Version"); + $oTableRow->AddTextCell("Release"); + $oTableRow->AddTextCell("Has maintainer"); + $oTableRow->AddTextCell("Rating"); + return $oTableRow; } function objectGetTableRow() diff --git a/include/vendor.php b/include/vendor.php index cb07ad6..830b2ed 100644 --- a/include/vendor.php +++ b/include/vendor.php @@ -237,12 +237,17 @@ class Vendor { function objectGetHeader() { - $aCells = array( - "Name", - "Website", - array("Linked apps", "align=\"right\"")); + $oTableRow = new TableRow(); + + $oTableRow->AddTextCell("Name"); - return $aCells; + $oTableRow->AddTextCell("Website"); + + $oTableCell = new TableCell("Linked apps"); + $oTableCell->SetAlign("right"); + $oTableRow->AddCell($oTableCell); + + return $oTableRow; } // returns an OMTableRow instance diff --git a/include/version.php b/include/version.php index a38f2d9..9def8f4 100644 --- a/include/version.php +++ b/include/version.php @@ -1399,13 +1399,13 @@ class version { function objectGetHeader() { - $aCells = array( - "Submission Date", - "Submitter", - "Vendor", - "Application", - "Version"); - return $aCells; + $oTableRow = new TableRow(); + $oTableRow->AddTextCell("Submission Date"); + $oTableRow->AddTextCell("Submitter"); + $oTableRow->AddTextCell("Vendor"); + $oTableRow->AddTextCell("Application"); + $oTableRow->AddTextCell("Version"); + return $oTableRow; } function objectGetItemsPerPage($bQueued = false)