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:
authormatt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2009-05-01 11:27:19 +0400
committermatt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2009-05-01 11:27:19 +0400
commit92da6b8181282800f4f28cae77d776b67540b477 (patch)
treea6e07ae46cbfa0b7a969392d00107b74c9f807e4 /core/ViewDataTable.php
parent9722d2680762026150bcbc3c96265bbc09802006 (diff)
- Introducing the new "ExampleUI" plugin which shows how to plot data easily in Piwik, reusing the existing framework (evolution graph, pie chart, bar graph, sparklines, tag clouds, tables, and more!)
Diffstat (limited to 'core/ViewDataTable.php')
-rw-r--r--core/ViewDataTable.php37
1 files changed, 35 insertions, 2 deletions
diff --git a/core/ViewDataTable.php b/core/ViewDataTable.php
index c30cb185d6..0321171ba9 100644
--- a/core/ViewDataTable.php
+++ b/core/ViewDataTable.php
@@ -116,6 +116,9 @@ abstract class Piwik_ViewDataTable
*/
protected $columnsTranslations = array();
+
+ protected $columnsToDisplay = array();
+
/**
* Method to be implemented by the ViewDataTable_*.
* This method should create and initialize a $this->view object @see Piwik_iView
@@ -433,7 +436,7 @@ abstract class Piwik_ViewDataTable
else
{
// the $uniqIdTable variable is used as the DIV ID in the rendered HTML
- // we use the current Controller action name as it is supposed to be unique in the rendered page
+ // we use the current Controller action name as it is supposed to be unique in the rendered page
$uniqIdTable = $this->currentControllerName . $this->currentControllerAction;
}
return $uniqIdTable;
@@ -648,7 +651,7 @@ abstract class Piwik_ViewDataTable
* When this method is called, the output will not contain the template datatable_footer.tpl
* @return void
*/
- public function doNotShowFooter()
+ public function disableFooter()
{
$this->viewProperties['show_footer'] = false;
}
@@ -790,6 +793,36 @@ abstract class Piwik_ViewDataTable
return $columnName;
}
}
+
+ /**
+ * Sets the columns that will be displayed in the HTML output
+ * By default all columns are displayed ($columnsNames = array() will display all columns)
+ *
+ * @param array $columnsNames Array of column names eg. array('nb_visits','nb_hits')
+ */
+ public function setColumnsToDisplay( $columnsNames )
+ {
+ if(!is_array($columnsNames))
+ {
+ $columnsNames = array($columnsNames);
+ }
+ $this->columnsToDisplay = $columnsNames;
+ }
+
+ /**
+ * Returns columns names to display, in order.
+ * If no columns were specified to be displayed, return all columns found in the first row.
+ * @param array PHP array conversion of the data table
+ * @return array
+ */
+ public function getColumnsToDisplay()
+ {
+ if(empty($this->columnsToDisplay))
+ {
+ return array_keys($this->dataTable->getFirstRow()->getColumns());
+ }
+ return $this->columnsToDisplay;
+ }
/**
* Sets columns translations array.