update Piwik to version 2.16 (fixes #91)
This commit is contained in:
parent
296343bf3b
commit
d885a4baa9
5833 changed files with 418860 additions and 226988 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - Open source web analytics
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - Open source web analytics
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
|
|
@ -46,7 +46,7 @@ class Controller extends \Piwik\Plugin\Controller
|
|||
$view = new View('@ExampleUI/evolutiongraph');
|
||||
|
||||
$this->setPeriodVariablesView($view);
|
||||
$view->evolutionGraph = $this->getEvolutionGraph(array('server1', 'server2'));
|
||||
$view->evolutionGraph = $this->getEvolutionGraph(array(), array('server1', 'server2'));
|
||||
|
||||
return $view->render();
|
||||
}
|
||||
|
|
@ -78,16 +78,23 @@ class Controller extends \Piwik\Plugin\Controller
|
|||
return $view->render();
|
||||
}
|
||||
|
||||
public function getEvolutionGraph(array $columns = array())
|
||||
public function getEvolutionGraph(array $columns = array(), array $defaultColumns = array())
|
||||
{
|
||||
if (empty($columns)) {
|
||||
$columns = Common::getRequestVar('columns');
|
||||
$columns = Piwik::getArrayFromApiParameter($columns);
|
||||
$columns = Common::getRequestVar('columns', false);
|
||||
if (false !== $columns) {
|
||||
$columns = Piwik::getArrayFromApiParameter($columns);
|
||||
}
|
||||
}
|
||||
|
||||
$view = $this->getLastUnitGraphAcrossPlugins($this->pluginName, __FUNCTION__, $columns,
|
||||
$selectableColumns = array('server1', 'server2'), 'My documentation', 'ExampleUI.getTemperaturesEvolution');
|
||||
$view->requestConfig->filter_sort_column = 'label';
|
||||
$view->requestConfig->filter_sort_order = 'asc';
|
||||
|
||||
if (empty($view->config->columns_to_display) && !empty($defaultColumns)) {
|
||||
$view->config->columns_to_display = $defaultColumns;
|
||||
}
|
||||
|
||||
return $this->renderView($view);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,55 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - Open source web analytics
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Piwik\Plugins\ExampleUI;
|
||||
use Piwik\Menu\MenuMain;
|
||||
use Piwik\Menu\MenuTop;
|
||||
|
||||
/**
|
||||
*/
|
||||
class ExampleUI extends \Piwik\Plugin
|
||||
{
|
||||
/**
|
||||
* @see Piwik\Plugin::getListHooksRegistered
|
||||
*/
|
||||
public function getListHooksRegistered()
|
||||
{
|
||||
return array(
|
||||
'Menu.Reporting.addItems' => 'addReportingMenuItems',
|
||||
'Menu.Top.addItems' => 'addTopMenuItems',
|
||||
);
|
||||
}
|
||||
|
||||
function addReportingMenuItems()
|
||||
{
|
||||
MenuMain::getInstance()->add('UI Framework', '', array('module' => 'ExampleUI', 'action' => 'dataTables'), true, 30);
|
||||
|
||||
$this->addSubMenu('Data tables', 'dataTables', 1);
|
||||
$this->addSubMenu('Bar graph', 'barGraph', 2);
|
||||
$this->addSubMenu('Pie graph', 'pieGraph', 3);
|
||||
$this->addSubMenu('Tag clouds', 'tagClouds', 4);
|
||||
$this->addSubMenu('Sparklines', 'sparklines', 5);
|
||||
$this->addSubMenu('Evolution Graph', 'evolutionGraph', 6);
|
||||
|
||||
if (\Piwik\Plugin\Manager::getInstance()->isPluginActivated('TreemapVisualization')) {
|
||||
$this->addSubMenu('Treemap', 'treemap', 7);
|
||||
}
|
||||
}
|
||||
|
||||
function addTopMenuItems()
|
||||
{
|
||||
$urlParams = array('module' => 'ExampleUI', 'action' => 'notifications');
|
||||
MenuTop::getInstance()->addEntry('UI Notifications', $urlParams, $displayedForCurrentUser = true, $order = 3);
|
||||
}
|
||||
|
||||
private function addSubMenu($subMenu, $action, $order)
|
||||
{
|
||||
MenuMain::getInstance()->add('UI Framework', $subMenu, array('module' => 'ExampleUI', 'action' => $action), true, $order);
|
||||
}
|
||||
}
|
||||
44
www/analytics/plugins/ExampleUI/Menu.php
Normal file
44
www/analytics/plugins/ExampleUI/Menu.php
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<?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\ExampleUI;
|
||||
|
||||
use Piwik\Menu\MenuReporting;
|
||||
use Piwik\Menu\MenuUser;
|
||||
use Piwik\Plugin\Manager as PluginManager;
|
||||
|
||||
/**
|
||||
*/
|
||||
class Menu extends \Piwik\Plugin\Menu
|
||||
{
|
||||
public function configureReportingMenu(MenuReporting $menu)
|
||||
{
|
||||
$menu->addItem('UI Framework', '', array(), 30);
|
||||
|
||||
$this->addSubMenu($menu, 'Data tables', 'dataTables', 1);
|
||||
$this->addSubMenu($menu, 'Bar graph', 'barGraph', 2);
|
||||
$this->addSubMenu($menu, 'Pie graph', 'pieGraph', 3);
|
||||
$this->addSubMenu($menu, 'Tag clouds', 'tagClouds', 4);
|
||||
$this->addSubMenu($menu, 'Sparklines', 'sparklines', 5);
|
||||
$this->addSubMenu($menu, 'Evolution Graph', 'evolutionGraph', 6);
|
||||
|
||||
if (PluginManager::getInstance()->isPluginActivated('TreemapVisualization')) {
|
||||
$this->addSubMenu($menu, 'Treemap', 'treemap', 7);
|
||||
}
|
||||
}
|
||||
|
||||
public function configureUserMenu(MenuUser $menu)
|
||||
{
|
||||
$menu->addPlatformItem('UI Notifications', $this->urlForAction('notifications'), $order = 10);
|
||||
}
|
||||
|
||||
private function addSubMenu(MenuReporting $menu, $subMenu, $action, $order)
|
||||
{
|
||||
$menu->addItem('UI Framework', $subMenu, $this->urlForAction($action), $order);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "ExampleUI",
|
||||
"description": "Example Plugin: This plugin showcases the Piwik User Interface framework, how to easily display custom data tables, graphs, and more.",
|
||||
"description": "Piwik Platform showcase: how to display data tables, graphs, and the UI framework.",
|
||||
"version": "1.0.1",
|
||||
"keywords": ["example", "framework", "platform", "ui", "visualization"],
|
||||
"homepage": "http://piwik.org",
|
||||
|
|
|
|||
|
|
@ -1,9 +1,16 @@
|
|||
{% extends 'dashboard.twig' %}
|
||||
{% extends 'user.twig' %}
|
||||
|
||||
{% set title %}UI Notification demo{% endset %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Inline notification example:</h2>
|
||||
<h2>Inline notification example</h2>
|
||||
|
||||
<div style="display:inline-block;margin-top:10px;" id="exampleUI_notifications">
|
||||
{{ 'This is an example for an inline notification. Have you noticed the success message disappeared after a few seconds?'|notification({'placeAt': '#exampleUI_notifications', 'title': 'Info: ', 'noclear': true, 'context': 'info'}) }}
|
||||
<div piwik-notification
|
||||
notification-title="Info:"
|
||||
noclear="true"
|
||||
context="info">
|
||||
This is an example for an inline notification. Have you noticed the success message disappeared after a few seconds?
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue