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:
Diffstat (limited to 'modules/DataTable')
-rw-r--r--modules/DataTable/Filter.php22
-rw-r--r--modules/DataTable/Filter/AddConstantDetail.php22
-rw-r--r--modules/DataTable/Filter/ColumnCallbackAddDetail.php22
-rw-r--r--modules/DataTable/Filter/ColumnCallbackDeleteRow.php22
-rw-r--r--modules/DataTable/Filter/ColumnCallbackReplace.php22
-rw-r--r--modules/DataTable/Filter/DetailCallbackAddDetail.php22
-rw-r--r--modules/DataTable/Filter/Empty.php22
-rw-r--r--modules/DataTable/Filter/ExcludeLowPopulation.php22
-rw-r--r--modules/DataTable/Filter/Limit.php22
-rw-r--r--modules/DataTable/Filter/Pattern.php22
-rw-r--r--modules/DataTable/Filter/PatternRecursive.php24
-rw-r--r--modules/DataTable/Filter/ReplaceColumnNames.php22
-rw-r--r--modules/DataTable/Filter/Sort.php30
-rw-r--r--modules/DataTable/Manager.php22
-rw-r--r--modules/DataTable/Renderer.php50
-rw-r--r--modules/DataTable/Renderer/Console.php22
-rw-r--r--modules/DataTable/Renderer/Csv.php40
-rw-r--r--modules/DataTable/Renderer/Html.php22
-rw-r--r--modules/DataTable/Renderer/Json.php26
-rw-r--r--modules/DataTable/Renderer/Php.php112
-rw-r--r--modules/DataTable/Renderer/Xml.php24
-rw-r--r--modules/DataTable/Row.php70
-rw-r--r--modules/DataTable/Row/DataTableSummary.php22
-rw-r--r--modules/DataTable/Simple.php22
24 files changed, 364 insertions, 364 deletions
diff --git a/modules/DataTable/Filter.php b/modules/DataTable/Filter.php
index 561e3c3baa..4bd93267c3 100644
--- a/modules/DataTable/Filter.php
+++ b/modules/DataTable/Filter.php
@@ -1,14 +1,14 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* A filter is applied instantly to a given DataTable and can
* - remove rows
diff --git a/modules/DataTable/Filter/AddConstantDetail.php b/modules/DataTable/Filter/AddConstantDetail.php
index 340779ed38..9452c29678 100644
--- a/modules/DataTable/Filter/AddConstantDetail.php
+++ b/modules/DataTable/Filter/AddConstantDetail.php
@@ -1,14 +1,14 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* Add a new detail column to the table.
*
diff --git a/modules/DataTable/Filter/ColumnCallbackAddDetail.php b/modules/DataTable/Filter/ColumnCallbackAddDetail.php
index b604734484..38773f4a9b 100644
--- a/modules/DataTable/Filter/ColumnCallbackAddDetail.php
+++ b/modules/DataTable/Filter/ColumnCallbackAddDetail.php
@@ -1,14 +1,14 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* Add a new 'detail' column to the table based on the value resulting
diff --git a/modules/DataTable/Filter/ColumnCallbackDeleteRow.php b/modules/DataTable/Filter/ColumnCallbackDeleteRow.php
index df2c244f0b..8367d67b44 100644
--- a/modules/DataTable/Filter/ColumnCallbackDeleteRow.php
+++ b/modules/DataTable/Filter/ColumnCallbackDeleteRow.php
@@ -1,14 +1,14 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* Delete all rows for which a given function returns false for a given column.
*
diff --git a/modules/DataTable/Filter/ColumnCallbackReplace.php b/modules/DataTable/Filter/ColumnCallbackReplace.php
index d15dc72b1c..6bdeb73545 100644
--- a/modules/DataTable/Filter/ColumnCallbackReplace.php
+++ b/modules/DataTable/Filter/ColumnCallbackReplace.php
@@ -1,14 +1,14 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* Replace a column value with a new value resulting
* from the function called with the column's value
diff --git a/modules/DataTable/Filter/DetailCallbackAddDetail.php b/modules/DataTable/Filter/DetailCallbackAddDetail.php
index d2a6bf0c31..6bd62c65e9 100644
--- a/modules/DataTable/Filter/DetailCallbackAddDetail.php
+++ b/modules/DataTable/Filter/DetailCallbackAddDetail.php
@@ -1,14 +1,14 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* Add a new detail to the table based on the value resulting
* from a callback function with the parameter being another detail's value
diff --git a/modules/DataTable/Filter/Empty.php b/modules/DataTable/Filter/Empty.php
index 476e234ed4..e15f74063f 100644
--- a/modules/DataTable/Filter/Empty.php
+++ b/modules/DataTable/Filter/Empty.php
@@ -1,14 +1,14 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* Filter template.
* You can use it if you want to create a new filter.
diff --git a/modules/DataTable/Filter/ExcludeLowPopulation.php b/modules/DataTable/Filter/ExcludeLowPopulation.php
index 33117e5a2c..7523bcd293 100644
--- a/modules/DataTable/Filter/ExcludeLowPopulation.php
+++ b/modules/DataTable/Filter/ExcludeLowPopulation.php
@@ -1,14 +1,14 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* Delete all rows that have a $columnToFilter value less than the $minimumValue
*
diff --git a/modules/DataTable/Filter/Limit.php b/modules/DataTable/Filter/Limit.php
index 7fcada2096..8dea88945d 100644
--- a/modules/DataTable/Filter/Limit.php
+++ b/modules/DataTable/Filter/Limit.php
@@ -1,14 +1,14 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* Delete all rows from the table that are not in the offset,offset+limit range
*
diff --git a/modules/DataTable/Filter/Pattern.php b/modules/DataTable/Filter/Pattern.php
index 5505da98e5..8ffae09c84 100644
--- a/modules/DataTable/Filter/Pattern.php
+++ b/modules/DataTable/Filter/Pattern.php
@@ -1,14 +1,14 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* Delete all rows for which the given $columnToFilter do not contain the $patternToSearch
* This filter is to be used on columns containing strings.
diff --git a/modules/DataTable/Filter/PatternRecursive.php b/modules/DataTable/Filter/PatternRecursive.php
index 50921b12a5..cb875b5326 100644
--- a/modules/DataTable/Filter/PatternRecursive.php
+++ b/modules/DataTable/Filter/PatternRecursive.php
@@ -1,14 +1,14 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* Delete all rows for which
* - the given $columnToFilter do not contain the $patternToSearch
@@ -40,7 +40,7 @@ class Piwik_DataTable_Filter_PatternRecursive extends Piwik_DataTable_Filter
{
$table = $this->table;
}
- $rows = $table->getRows();
+ $rows = $table->getRows();
foreach($rows as $key => $row)
{
diff --git a/modules/DataTable/Filter/ReplaceColumnNames.php b/modules/DataTable/Filter/ReplaceColumnNames.php
index 2b33bc04aa..4296128511 100644
--- a/modules/DataTable/Filter/ReplaceColumnNames.php
+++ b/modules/DataTable/Filter/ReplaceColumnNames.php
@@ -1,14 +1,14 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* This filter replaces column names using a mapping table that maps from the old name to the new name.
*
diff --git a/modules/DataTable/Filter/Sort.php b/modules/DataTable/Filter/Sort.php
index be69d05c60..2807d46733 100644
--- a/modules/DataTable/Filter/Sort.php
+++ b/modules/DataTable/Filter/Sort.php
@@ -1,14 +1,14 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* Sort the DataTable based on the value of column $columnToSort ordered by $order.
* Possible to specify a natural sorting (see php.net/natsort for details)
@@ -93,10 +93,10 @@ class Piwik_DataTable_Filter_Sort extends Piwik_DataTable_Filter
$value = $row->getColumn($this->columnToSort);
if($value === false)
- {
- // we don't throw the exception because we sometimes export a DataTable without a column labelled '2'
- // and when the generic filters tries to sort by default using this column 2, this shouldnt raise an exception...
- //throw new Exception("The column to sort by '".$this->columnToSort."' is unknown in the row ". implode(array_keys($row->getColumns()), ','));
+ {
+ // we don't throw the exception because we sometimes export a DataTable without a column labelled '2'
+ // and when the generic filters tries to sort by default using this column 2, this shouldnt raise an exception...
+ //throw new Exception("The column to sort by '".$this->columnToSort."' is unknown in the row ". implode(array_keys($row->getColumns()), ','));
return;
}
diff --git a/modules/DataTable/Manager.php b/modules/DataTable/Manager.php
index 81d1229d01..7f59e831d9 100644
--- a/modules/DataTable/Manager.php
+++ b/modules/DataTable/Manager.php
@@ -1,14 +1,14 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* The DataTable_Manager registers all the instanciated DataTable and provides an
* easy way to access them. This is used to store all the DataTable during the archiving process.
diff --git a/modules/DataTable/Renderer.php b/modules/DataTable/Renderer.php
index 12e0c34d2f..5cf6622ae3 100644
--- a/modules/DataTable/Renderer.php
+++ b/modules/DataTable/Renderer.php
@@ -1,22 +1,22 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* A DataTable Renderer can produce an output given a DataTable object.
* All new Renderers must be copied in DataTable/Renderer and added to the factory() method.
* To use a renderer, simply do:
* $render = new Piwik_DataTable_Renderer_Xml( $myTable );
* echo $render;
- *
- * @package Piwik_DataTable
+ *
+ * @package Piwik_DataTable
* @subpackage Piwik_DataTable_Renderer
*/
abstract class Piwik_DataTable_Renderer
@@ -70,24 +70,24 @@ abstract class Piwik_DataTable_Renderer
/**
* Returns the DataTable associated to the output format $name
- *
+ *
* @throws exception If the renderer is unknown
* @return Piwik_DataTable_Renderer
*/
static public function factory( $name )
{
$name = ucfirst(strtolower($name));
- $path = PIWIK_INCLUDE_PATH . "/modules/DataTable/Renderer/".$name.".php";
- $className = 'Piwik_DataTable_Renderer_' . $name;
-
- if( Piwik_Common::isValidFilename($name)
- && is_file($path)
- )
- {
- require_once $path;
- return new $className;
- }
- else
+ $path = PIWIK_INCLUDE_PATH . "/modules/DataTable/Renderer/".$name.".php";
+ $className = 'Piwik_DataTable_Renderer_' . $name;
+
+ if( Piwik_Common::isValidFilename($name)
+ && is_file($path)
+ )
+ {
+ require_once $path;
+ return new $className;
+ }
+ else
{
throw new Exception("Renderer format '$name' not valid. Try 'xml' or 'json' or 'csv' or 'html' or 'php' or 'original' instead.");
}
diff --git a/modules/DataTable/Renderer/Console.php b/modules/DataTable/Renderer/Console.php
index b092ef94b9..97d0f114c2 100644
--- a/modules/DataTable/Renderer/Console.php
+++ b/modules/DataTable/Renderer/Console.php
@@ -1,14 +1,14 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* Simple output
*
diff --git a/modules/DataTable/Renderer/Csv.php b/modules/DataTable/Renderer/Csv.php
index ea4c7920a1..0e00028904 100644
--- a/modules/DataTable/Renderer/Csv.php
+++ b/modules/DataTable/Renderer/Csv.php
@@ -1,30 +1,30 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
-require_once "DataTable/Renderer/Php.php";
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
+require_once "DataTable/Renderer/Php.php";
/**
* CSV export
- *
- * When rendered using the default settings, a CSV report has the following characteristics:
- * The first record contains headers for all the columns in the report.
- * All rows have the same number of columns.
- * The default field delimiter string is a comma (,).
- * Formatting and layout are ignored.
+ *
+ * When rendered using the default settings, a CSV report has the following characteristics:
+ * The first record contains headers for all the columns in the report.
+ * All rows have the same number of columns.
+ * The default field delimiter string is a comma (,).
+ * Formatting and layout are ignored.
*
* Note that CSV output doesn't handle recursive dataTable. It will output only the first parent level of the tables.
*
* @package Piwik_DataTable
- * @subpackage Piwik_DataTable_Renderer
+ * @subpackage Piwik_DataTable_Renderer
*
- */
+ */
class Piwik_DataTable_Renderer_Csv extends Piwik_DataTable_Renderer
{
diff --git a/modules/DataTable/Renderer/Html.php b/modules/DataTable/Renderer/Html.php
index a80230a137..2ef404653c 100644
--- a/modules/DataTable/Renderer/Html.php
+++ b/modules/DataTable/Renderer/Html.php
@@ -1,14 +1,14 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* Simple HTML output
* Works with recursive DataTable (when a row can be associated with a subDataTable).
diff --git a/modules/DataTable/Renderer/Json.php b/modules/DataTable/Renderer/Json.php
index 2a91b754e4..158fa8dae8 100644
--- a/modules/DataTable/Renderer/Json.php
+++ b/modules/DataTable/Renderer/Json.php
@@ -1,15 +1,15 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
-require_once "DataTable/Renderer/Php.php";
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
+require_once "DataTable/Renderer/Php.php";
/**
* JSON export. Using the php 5.2 feature json_encode.
* Works with recursive DataTable (when a row can be associated with a subDataTable).
@@ -37,7 +37,7 @@ class Piwik_DataTable_Renderer_Json extends Piwik_DataTable_Renderer
if(!is_array($array))
{
$array = array('value' => $array);
- }
+ }
$str = json_encode($array);
return $str;
}
diff --git a/modules/DataTable/Renderer/Php.php b/modules/DataTable/Renderer/Php.php
index 50aa9df284..7d80ed23e4 100644
--- a/modules/DataTable/Renderer/Php.php
+++ b/modules/DataTable/Renderer/Php.php
@@ -1,18 +1,18 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* Returns the equivalent PHP array for a given DataTable.
- * You can specify in the constructor if you want the serialized version.
- * Please note that by default it will produce a flat version of the array.
+ * You can specify in the constructor if you want the serialized version.
+ * Please note that by default it will produce a flat version of the array.
* See the method flatRender() for details. @see flatRender();
*
* Works with recursive DataTable (when a row can be associated with a subDataTable).
@@ -44,23 +44,23 @@ class Piwik_DataTable_Renderer_Php extends Piwik_DataTable_Renderer
}
return $data;
}
-
- /**
- * Produces a flat php array from the DataTable, putting "columns" and "details" on the same level.
- *
- * For example, when a originalRender() would be
- * array( 'columns' => array( 'col1_name' => value1, 'col2_name' => value2 ),
- * 'details' => array( 'detail1_name' => value_detail) )
- *
- * a flatRender() is
- * array( 'col1_name' => value1,
- * 'col2_name' => value2,
- * 'detail1_name' => value_detail )
- *
- * @return array Php array representing the 'flat' version of the datatable
- *
- */
- public function flatRender( $dataTable = null, $doRenderSubTablesIfAvailable = true )
+
+ /**
+ * Produces a flat php array from the DataTable, putting "columns" and "details" on the same level.
+ *
+ * For example, when a originalRender() would be
+ * array( 'columns' => array( 'col1_name' => value1, 'col2_name' => value2 ),
+ * 'details' => array( 'detail1_name' => value_detail) )
+ *
+ * a flatRender() is
+ * array( 'col1_name' => value1,
+ * 'col2_name' => value2,
+ * 'detail1_name' => value_detail )
+ *
+ * @return array Php array representing the 'flat' version of the datatable
+ *
+ */
+ public function flatRender( $dataTable = null, $doRenderSubTablesIfAvailable = true )
{
if(is_null($dataTable))
{
@@ -78,10 +78,10 @@ class Piwik_DataTable_Renderer_Php extends Piwik_DataTable_Renderer
$this->serialize = $serializeSave;
}
}
-
- // A DataTable_Simple is already flattened so no need to do some crazy stuff to convert it
- else if($dataTable instanceof Piwik_DataTable_Simple)
- {
+
+ // A DataTable_Simple is already flattened so no need to do some crazy stuff to convert it
+ else if($dataTable instanceof Piwik_DataTable_Simple)
+ {
$flatArray = $this->renderSimpleTable($dataTable);
// if we return only one numeric value then we print out the result in a simple <result> tag
@@ -90,22 +90,22 @@ class Piwik_DataTable_Renderer_Php extends Piwik_DataTable_Renderer
{
$flatArray = current($flatArray);
}
-
- }
- // A normal DataTable needs to be handled specifically
- else
- {
+
+ }
+ // A normal DataTable needs to be handled specifically
+ else
+ {
$array = $this->renderTable($dataTable, $doRenderSubTablesIfAvailable);
- $flatArray = $this->flattenArray($array);
- }
-
- if($this->serialize)
- {
- $flatArray = serialize($flatArray);
- }
-
- return $flatArray;
- }
+ $flatArray = $this->flattenArray($array);
+ }
+
+ if($this->serialize)
+ {
+ $flatArray = serialize($flatArray);
+ }
+
+ return $flatArray;
+ }
protected function flattenArray($array)
{
@@ -124,13 +124,13 @@ class Piwik_DataTable_Renderer_Php extends Piwik_DataTable_Renderer
$flatArray[] = $newRow;
}
return $flatArray;
- }
- public function render( $dataTable = null)
+ }
+ public function render( $dataTable = null)
{
if(is_null($dataTable))
{
$dataTable = $this->table;
- }
+ }
$toReturn = $this->flatRender( $dataTable );
if( false !== Piwik_Common::getRequestVar('prettyDisplay', false) )
@@ -140,9 +140,9 @@ class Piwik_DataTable_Renderer_Php extends Piwik_DataTable_Renderer
$toReturn = unserialize($toReturn);
}
$toReturn = "<pre>" . var_export($toReturn, true ) . "</pre>";
- }
- return $toReturn;
- }
+ }
+ return $toReturn;
+ }
public function originalRender()
{
@@ -162,7 +162,7 @@ class Piwik_DataTable_Renderer_Php extends Piwik_DataTable_Renderer
return $array;
}
-
+
protected function renderTable($table, $doRenderSubTablesIfAvailable = true)
{
diff --git a/modules/DataTable/Renderer/Xml.php b/modules/DataTable/Renderer/Xml.php
index ec6f6cff06..1792b33261 100644
--- a/modules/DataTable/Renderer/Xml.php
+++ b/modules/DataTable/Renderer/Xml.php
@@ -1,15 +1,15 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
-require_once "DataTable/Renderer/Php.php";
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
+require_once "DataTable/Renderer/Php.php";
/**
* XML export of a given DataTable.
* See the tests cases for more information about the XML format (/tests/modules/DataTable/Renderer.test.php)
diff --git a/modules/DataTable/Row.php b/modules/DataTable/Row.php
index 329d8600ab..11c110f254 100644
--- a/modules/DataTable/Row.php
+++ b/modules/DataTable/Row.php
@@ -1,14 +1,14 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* A DataTable is composed of rows.
*
@@ -21,8 +21,8 @@
* IMPORTANT: Make sure that the column named 'label' contains at least one non-numeric character.
* Otherwise the method addDataTable() or sumRow() would fail because they would consider
* the 'label' as being a numeric column to sum.
- *
- * @package Piwik_DataTable
+ *
+ * @package Piwik_DataTable
* @subpackage Piwik_DataTable_Row
*
*/
@@ -99,28 +99,28 @@ class Piwik_DataTable_Row
* Applys a basic rendering to the Row and returns the output
*
* @return string characterizing the row. Example: - 1 ['label' => 'piwik', 'nb_uniq_visitors' => 1685, 'nb_visits' => 1861, 'nb_actions' => 2271, 'max_actions' => 13, 'sum_visit_length' => 920131, 'bounce_count' => 1599] [] [idsubtable = 1375]
- */
- public function __toString()
- {
- $columns = array();
- foreach($this->getColumns() as $column => $value)
- {
- if(is_string($value)) $value = "'$value'";
- $columns[] = "'$column' => $value";
- }
- $columns = implode(", ", $columns);
- $details=array();
-
- foreach($this->getDetails() as $detail => $value)
- {
- if(is_string($value)) $value = "'$value'";
- $details[] = "'$detail' => $value";
- }
- $details = implode(", ", $details);
- $output = "# [".$columns."] [".$details."] [idsubtable = "
- . $this->getIdSubDataTable()."]<br>\n";
- return $output;
- }
+ */
+ public function __toString()
+ {
+ $columns = array();
+ foreach($this->getColumns() as $column => $value)
+ {
+ if(is_string($value)) $value = "'$value'";
+ $columns[] = "'$column' => $value";
+ }
+ $columns = implode(", ", $columns);
+ $details=array();
+
+ foreach($this->getDetails() as $detail => $value)
+ {
+ if(is_string($value)) $value = "'$value'";
+ $details[] = "'$detail' => $value";
+ }
+ $details = implode(", ", $details);
+ $output = "# [".$columns."] [".$details."] [idsubtable = "
+ . $this->getIdSubDataTable()."]<br>\n";
+ return $output;
+ }
/**
* Deletes the given column
diff --git a/modules/DataTable/Row/DataTableSummary.php b/modules/DataTable/Row/DataTableSummary.php
index 8f34a79655..011014bd1b 100644
--- a/modules/DataTable/Row/DataTableSummary.php
+++ b/modules/DataTable/Row/DataTableSummary.php
@@ -1,14 +1,14 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* This class creates a row from a given DataTable.
* The row contains
diff --git a/modules/DataTable/Simple.php b/modules/DataTable/Simple.php
index d369d48fe0..08e5d0f0d0 100644
--- a/modules/DataTable/Simple.php
+++ b/modules/DataTable/Simple.php
@@ -1,14 +1,14 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_DataTable
- */
-
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik_DataTable
+ */
+
/**
* The DataTable_Simple is used to provide an easy way to create simple DataGrid.
* A DataTable_Simple actually is a DataTable with 2 columns: 'label' and 'value'.