Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2013-03-28 03:42:39 +0400
committermattab <matthieu.aubry@gmail.com>2013-03-28 03:42:40 +0400
commitae4b03163792f0b6e933933e5d37df87dc3fd566 (patch)
treed1d7510a9728f587d3d63ebd03e4ecf3d904838b /core/DataTable/Filter/ReplaceSummaryRowLabel.php
parent158c2150f5f2e13ece459b8d131244c11b763997 (diff)
Mass conversion of all files to the newly agreed coding standard: PSR 1/2
Converting Piwik core source files, PHP, JS, TPL, CSS More info: http://piwik.org/participate/coding-standards/
Diffstat (limited to 'core/DataTable/Filter/ReplaceSummaryRowLabel.php')
-rw-r--r--core/DataTable/Filter/ReplaceSummaryRowLabel.php81
1 files changed, 38 insertions, 43 deletions
diff --git a/core/DataTable/Filter/ReplaceSummaryRowLabel.php b/core/DataTable/Filter/ReplaceSummaryRowLabel.php
index ff70d3c4a9..b89f05871c 100644
--- a/core/DataTable/Filter/ReplaceSummaryRowLabel.php
+++ b/core/DataTable/Filter/ReplaceSummaryRowLabel.php
@@ -1,60 +1,55 @@
<?php
/**
* Piwik - Open source web analytics
- *
+ *
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
+ *
* @category Piwik
* @package Piwik
*/
/**
- *
+ *
* @package Piwik
* @subpackage Piwik_DataTable
*/
class Piwik_DataTable_Filter_ReplaceSummaryRowLabel extends Piwik_DataTable_Filter
{
- /**
- * @param Piwik_DataTable $table
- * @param string|null $newLabel new label for summary row
- */
- public function __construct( $table, $newLabel = null)
- {
- parent::__construct($table);
- if(is_null($newLabel))
- {
- $newLabel = Piwik_Translate('General_Others');
- }
- $this->newLabel = $newLabel;
- }
+ /**
+ * @param Piwik_DataTable $table
+ * @param string|null $newLabel new label for summary row
+ */
+ public function __construct($table, $newLabel = null)
+ {
+ parent::__construct($table);
+ if (is_null($newLabel)) {
+ $newLabel = Piwik_Translate('General_Others');
+ }
+ $this->newLabel = $newLabel;
+ }
- /**
- * Updates the summary row label
- *
- * @param Piwik_DataTable $table
- */
- public function filter($table)
- {
- $rows = $table->getRows();
- foreach($rows as $row)
- {
- if($row->getColumn('label') == Piwik_DataTable::LABEL_SUMMARY_ROW)
- {
- $row->setColumn('label', $this->newLabel);
- break;
- }
- }
-
- // recurse
- foreach ($rows as $row)
- {
- if ($row->isSubtableLoaded())
- {
- $subTable = Piwik_DataTable_Manager::getInstance()->getTable($row->getIdSubDataTable());
- $this->filter($subTable);
- }
- }
- }
+ /**
+ * Updates the summary row label
+ *
+ * @param Piwik_DataTable $table
+ */
+ public function filter($table)
+ {
+ $rows = $table->getRows();
+ foreach ($rows as $row) {
+ if ($row->getColumn('label') == Piwik_DataTable::LABEL_SUMMARY_ROW) {
+ $row->setColumn('label', $this->newLabel);
+ break;
+ }
+ }
+
+ // recurse
+ foreach ($rows as $row) {
+ if ($row->isSubtableLoaded()) {
+ $subTable = Piwik_DataTable_Manager::getInstance()->getTable($row->getIdSubDataTable());
+ $this->filter($subTable);
+ }
+ }
+ }
}