diff --git a/plugins/ExampleReport/API.php b/plugins/ExampleReport/API.php new file mode 100644 index 0000000000000000000000000000000000000000..3c7c3866c45c374ec3a61fc3f53f7b404688b01f --- /dev/null +++ b/plugins/ExampleReport/API.php @@ -0,0 +1,38 @@ +<?php +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + */ +namespace Piwik\Plugins\ExampleReport; + +use Piwik\DataTable; +use Piwik\DataTable\Row; + +/** + * API for plugin ExampleReport + * + * @method static \Piwik\Plugins\ExampleReport\API getInstance() + */ +class API extends \Piwik\Plugin\API +{ + + /** + * Another example method that returns a data table. + * @param int $idSite + * @param string $period + * @param string $date + * @param bool|string $segment + * @return DataTable + */ + public function getExampleReport($idSite, $period, $date, $segment = false) + { + $table = new DataTable(); + + $table->addRowFromArray(array(Row::COLUMNS => array('nb_visits' => 5))); + + return $table; + } +} diff --git a/plugins/ExampleReport/ExampleReport.php b/plugins/ExampleReport/ExampleReport.php new file mode 100644 index 0000000000000000000000000000000000000000..b1d2d1c708e9a1ee65bd1b248e00a6a1ef637dad --- /dev/null +++ b/plugins/ExampleReport/ExampleReport.php @@ -0,0 +1,13 @@ +<?php +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + */ +namespace Piwik\Plugins\ExampleReport; + +class ExampleReport extends \Piwik\Plugin +{ +} diff --git a/plugins/ExampleReport/plugin.json b/plugins/ExampleReport/plugin.json new file mode 100644 index 0000000000000000000000000000000000000000..92b90becb44c078c4ac796cfa4e382c7bdf7e61d --- /dev/null +++ b/plugins/ExampleReport/plugin.json @@ -0,0 +1,13 @@ +{ + "name": "ExampleReport", + "version": "0.1.0", + "description": "A plugin that shows how to define a report", + "theme": false, + "authors": [ + { + "name": "Piwik", + "email": "", + "homepage": "" + } + ] +} \ No newline at end of file