diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2014-06-10 06:39:02 +0400 |
---|---|---|
committer | Thomas Steur <tsteur@users.noreply.github.com> | 2014-06-10 06:39:02 +0400 |
commit | b8aa95f7fe7b251abe81bd6664c2a15cf5129197 (patch) | |
tree | 073d50b6a46c09e491181df01150115f091bc28e /plugins/Provider | |
parent | 3a28d26de32257045850ea5a602b970a9b5be3f7 (diff) | |
parent | 0dc6a6cb8d12d95f172b754405929e5db439d551 (diff) |
Merge pull request #308 from piwik/plugin_widget_refactoring
refs #5326 Provide simpler Widgets API
Diffstat (limited to 'plugins/Provider')
-rw-r--r-- | plugins/Provider/Provider.php | 7 | ||||
-rw-r--r-- | plugins/Provider/Widgets.php | 20 |
2 files changed, 20 insertions, 7 deletions
diff --git a/plugins/Provider/Provider.php b/plugins/Provider/Provider.php index 2c587e1f95..710e2a4930 100644 --- a/plugins/Provider/Provider.php +++ b/plugins/Provider/Provider.php @@ -17,7 +17,6 @@ use Piwik\IP; use Piwik\Piwik; use Piwik\Plugin\ViewDataTable; use Piwik\Plugins\PrivacyManager\Config as PrivacyManagerConfig; -use Piwik\WidgetsList; /** * @@ -31,7 +30,6 @@ class Provider extends \Piwik\Plugin { $hooks = array( 'Tracker.newVisitorInformation' => 'enrichVisitWithProviderInfo', - 'WidgetsList.addWidgets' => 'addWidget', 'API.getReportMetadata' => 'getReportMetadata', 'API.getSegmentDimensionMetadata' => 'getSegmentsMetadata', 'ViewDataTable.configure' => 'configureViewDataTable', @@ -86,11 +84,6 @@ class Provider extends \Piwik\Plugin Db::exec($query); } - public function addWidget() - { - WidgetsList::add('General_Visitors', 'Provider_WidgetProviders', 'Provider', 'getProvider'); - } - public function postLoad() { Piwik::addAction('Template.footerUserCountry', array('Piwik\Plugins\Provider\Provider', 'footerUserCountry')); diff --git a/plugins/Provider/Widgets.php b/plugins/Provider/Widgets.php new file mode 100644 index 0000000000..911ab10411 --- /dev/null +++ b/plugins/Provider/Widgets.php @@ -0,0 +1,20 @@ +<?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\Provider; + +use Piwik\WidgetsList; + +class Widgets extends \Piwik\Plugin\Widgets +{ + public function configure(WidgetsList $widgetsList) + { + $widgetsList->add('General_Visitors', 'Provider_WidgetProviders', 'Provider', 'getProvider'); + } + +} |