diff options
Diffstat (limited to 'plugins/DevicesDetection')
-rw-r--r-- | plugins/DevicesDetection/Controller.php | 41 | ||||
-rw-r--r-- | plugins/DevicesDetection/Menu.php | 7 | ||||
-rw-r--r-- | plugins/DevicesDetection/Reports/Base.php | 2 | ||||
-rw-r--r-- | plugins/DevicesDetection/Reports/GetBrand.php | 5 | ||||
-rw-r--r-- | plugins/DevicesDetection/Reports/GetBrowserEngines.php | 5 | ||||
-rw-r--r-- | plugins/DevicesDetection/Reports/GetBrowserVersions.php | 8 | ||||
-rw-r--r-- | plugins/DevicesDetection/Reports/GetBrowsers.php | 10 | ||||
-rw-r--r-- | plugins/DevicesDetection/Reports/GetModel.php | 3 | ||||
-rw-r--r-- | plugins/DevicesDetection/Reports/GetOsFamilies.php | 8 | ||||
-rw-r--r-- | plugins/DevicesDetection/Reports/GetOsVersions.php | 8 | ||||
-rw-r--r-- | plugins/DevicesDetection/Reports/GetType.php | 3 | ||||
-rw-r--r-- | plugins/DevicesDetection/templates/devices.twig | 19 | ||||
-rw-r--r-- | plugins/DevicesDetection/templates/software.twig | 23 |
13 files changed, 32 insertions, 110 deletions
diff --git a/plugins/DevicesDetection/Controller.php b/plugins/DevicesDetection/Controller.php index 10c55a8a96..d19d0cf403 100644 --- a/plugins/DevicesDetection/Controller.php +++ b/plugins/DevicesDetection/Controller.php @@ -13,52 +13,11 @@ use Piwik\Common; use Piwik\Db; use Piwik\Piwik; use Piwik\Plugin\ControllerAdmin; -use Piwik\Plugin\Manager AS PluginManager; use Piwik\Plugin\Report; use Piwik\View; class Controller extends \Piwik\Plugin\Controller { - public function index() - { - return $this->devices(); - } - - public function devices() - { - $view = new View('@DevicesDetection/devices'); - $view->deviceTypes = $this->renderReport('getType'); - $view->deviceBrands = $this->renderReport('getBrand'); - $view->deviceModels = $this->renderReport('getModel'); - - $isResolutionEnabled = PluginManager::getInstance()->isPluginActivated('Resolution'); - if ($isResolutionEnabled) { - $view->resolutions = $this->renderReport(Report::factory('Resolution', 'getResolution')); - } - - return $view->render(); - } - - public function software() - { - $view = new View('@DevicesDetection/software'); - $view->osReport = $this->renderReport('getOsVersions'); - $view->browserReport = $this->renderReport('getBrowsers'); - $view->browserEngineReport = $this->renderReport('getBrowserEngines'); - - $isResolutionEnabled = PluginManager::getInstance()->isPluginActivated('Resolution'); - if ($isResolutionEnabled) { - $view->configurations = $this->renderReport(Report::factory('Resolution', 'getConfiguration')); - } - - $isDevicePluginsEnabled = PluginManager::getInstance()->isPluginActivated('DevicePlugins'); - if ($isDevicePluginsEnabled) { - $view->browserPlugins = $this->renderReport(Report::factory('DevicePlugins', 'getPlugin')); - } - - return $view->render(); - } - public function detection() { Piwik::checkUserHasSomeAdminAccess(); diff --git a/plugins/DevicesDetection/Menu.php b/plugins/DevicesDetection/Menu.php index 7ddb1dc668..067f8b9afa 100644 --- a/plugins/DevicesDetection/Menu.php +++ b/plugins/DevicesDetection/Menu.php @@ -9,7 +9,6 @@ namespace Piwik\Plugins\DevicesDetection; use Piwik\Menu\MenuAdmin; -use Piwik\Menu\MenuReporting; use Piwik\Piwik; /** @@ -24,10 +23,4 @@ class Menu extends \Piwik\Plugin\Menu $order = 40); } } - - public function configureReportingMenu(MenuReporting $menu) - { - $menu->addVisitorsItem('DevicesDetection_Devices', $this->urlForAction('devices')); - $menu->addVisitorsItem('DevicesDetection_Software', $this->urlForAction('software')); - } } diff --git a/plugins/DevicesDetection/Reports/Base.php b/plugins/DevicesDetection/Reports/Base.php index 15eac96a4a..cb24a376e4 100644 --- a/plugins/DevicesDetection/Reports/Base.php +++ b/plugins/DevicesDetection/Reports/Base.php @@ -14,6 +14,6 @@ abstract class Base extends \Piwik\Plugin\Report { protected function init() { - $this->category = 'DevicesDetection_DevicesDetection'; + $this->categoryId = 'General_Visitors'; } } diff --git a/plugins/DevicesDetection/Reports/GetBrand.php b/plugins/DevicesDetection/Reports/GetBrand.php index 070b2d8918..41b9fd5366 100644 --- a/plugins/DevicesDetection/Reports/GetBrand.php +++ b/plugins/DevicesDetection/Reports/GetBrand.php @@ -20,8 +20,9 @@ class GetBrand extends Base $this->dimension = new DeviceBrand(); $this->name = Piwik::translate('DevicesDetection_DeviceBrand'); $this->documentation = ''; // TODO - $this->order = 1; - $this->widgetTitle = 'DevicesDetection_DeviceBrand'; + $this->order = 4; + + $this->subcategoryId = 'DevicesDetection_Devices'; } public function configureView(ViewDataTable $view) diff --git a/plugins/DevicesDetection/Reports/GetBrowserEngines.php b/plugins/DevicesDetection/Reports/GetBrowserEngines.php index 7c47ffca63..403955c66c 100644 --- a/plugins/DevicesDetection/Reports/GetBrowserEngines.php +++ b/plugins/DevicesDetection/Reports/GetBrowserEngines.php @@ -21,8 +21,9 @@ class GetBrowserEngines extends Base $this->dimension = new BrowserEngine(); $this->name = Piwik::translate('DevicesDetection_BrowserEngines'); $this->documentation = Piwik::translate('DevicesDetection_BrowserEngineDocumentation', '<br />'); - $this->order = 7; - $this->widgetTitle = 'DevicesDetection_BrowserEngines'; + $this->order = 10; + + $this->subcategoryId = 'DevicesDetection_Software'; } public function getDefaultTypeViewDataTable() diff --git a/plugins/DevicesDetection/Reports/GetBrowserVersions.php b/plugins/DevicesDetection/Reports/GetBrowserVersions.php index 4f5875199a..66c7f91f55 100644 --- a/plugins/DevicesDetection/Reports/GetBrowserVersions.php +++ b/plugins/DevicesDetection/Reports/GetBrowserVersions.php @@ -11,6 +11,7 @@ namespace Piwik\Plugins\DevicesDetection\Reports; use Piwik\Piwik; use Piwik\Plugin\ViewDataTable; use Piwik\Plugins\DevicesDetection\Columns\BrowserVersion; +use Piwik\Plugin\Reports; class GetBrowserVersions extends Base { @@ -20,8 +21,9 @@ class GetBrowserVersions extends Base $this->dimension = new BrowserVersion(); $this->name = Piwik::translate('DevicesDetection_BrowserVersion'); $this->documentation = ''; // TODO - $this->order = 2; - $this->widgetTitle = 'DevicesDetection_BrowserVersion'; + $this->order = 6; + + $this->subcategoryId = 'DevicesDetection_Software'; } public function configureView(ViewDataTable $view) @@ -34,7 +36,7 @@ class GetBrowserVersions extends Base public function getRelatedReports() { return array( - self::factory('DevicesDetection', 'getBrowsers'), + Reports::factory('DevicesDetection', 'getBrowsers'), ); } } diff --git a/plugins/DevicesDetection/Reports/GetBrowsers.php b/plugins/DevicesDetection/Reports/GetBrowsers.php index 7d08a51ce5..5c39a275ee 100644 --- a/plugins/DevicesDetection/Reports/GetBrowsers.php +++ b/plugins/DevicesDetection/Reports/GetBrowsers.php @@ -11,6 +11,7 @@ namespace Piwik\Plugins\DevicesDetection\Reports; use Piwik\Piwik; use Piwik\Plugin\ViewDataTable; use Piwik\Plugins\DevicesDetection\Columns\BrowserName; +use Piwik\Plugin\Reports; class GetBrowsers extends Base { @@ -18,10 +19,11 @@ class GetBrowsers extends Base { parent::init(); $this->dimension = new BrowserName(); - $this->name = Piwik::translate('DevicesDetection_WidgetBrowsers'); + $this->name = Piwik::translate('DevicesDetection_Browsers'); $this->documentation = Piwik::translate('DevicesDetection_WidgetBrowsersDocumentation', '<br />'); - $this->order = 1; - $this->widgetTitle = 'DevicesDetection_WidgetBrowsers'; + $this->order = 5; + + $this->subcategoryId = 'DevicesDetection_Software'; } public function configureView(ViewDataTable $view) @@ -35,7 +37,7 @@ class GetBrowsers extends Base public function getRelatedReports() { return array( - self::factory('DevicesDetection', 'getBrowserVersions'), + Reports::factory('DevicesDetection', 'getBrowserVersions'), ); } } diff --git a/plugins/DevicesDetection/Reports/GetModel.php b/plugins/DevicesDetection/Reports/GetModel.php index e2241e1ad4..154464691c 100644 --- a/plugins/DevicesDetection/Reports/GetModel.php +++ b/plugins/DevicesDetection/Reports/GetModel.php @@ -21,7 +21,8 @@ class GetModel extends Base $this->name = Piwik::translate('DevicesDetection_DeviceModel'); $this->documentation = ''; // TODO $this->order = 2; - $this->widgetTitle = 'DevicesDetection_DeviceModel'; + + $this->subcategoryId = 'DevicesDetection_Devices'; } public function configureView(ViewDataTable $view) diff --git a/plugins/DevicesDetection/Reports/GetOsFamilies.php b/plugins/DevicesDetection/Reports/GetOsFamilies.php index 61b393cb44..a283a83f7b 100644 --- a/plugins/DevicesDetection/Reports/GetOsFamilies.php +++ b/plugins/DevicesDetection/Reports/GetOsFamilies.php @@ -11,6 +11,7 @@ namespace Piwik\Plugins\DevicesDetection\Reports; use Piwik\Piwik; use Piwik\Plugin\ViewDataTable; use Piwik\Plugins\DevicesDetection\Columns\Os; +use Piwik\Plugin\Reports; class GetOsFamilies extends Base { @@ -20,8 +21,9 @@ class GetOsFamilies extends Base $this->dimension = new Os(); $this->name = Piwik::translate('DevicesDetection_OperatingSystemFamilies'); $this->documentation = ''; // TODO - $this->order = 3; - $this->widgetTitle = 'DevicesDetection_OperatingSystemFamilies'; + $this->order = 8; + + $this->subcategoryId = 'DevicesDetection_Software'; } public function configureView(ViewDataTable $view) @@ -35,7 +37,7 @@ class GetOsFamilies extends Base public function getRelatedReports() { return array( - self::factory('DevicesDetection', 'getOsVersions'), + Reports::factory('DevicesDetection', 'getOsVersions'), ); } diff --git a/plugins/DevicesDetection/Reports/GetOsVersions.php b/plugins/DevicesDetection/Reports/GetOsVersions.php index 8676f38776..b330054c6f 100644 --- a/plugins/DevicesDetection/Reports/GetOsVersions.php +++ b/plugins/DevicesDetection/Reports/GetOsVersions.php @@ -11,6 +11,7 @@ namespace Piwik\Plugins\DevicesDetection\Reports; use Piwik\Piwik; use Piwik\Plugin\ViewDataTable; use Piwik\Plugins\DevicesDetection\Columns\OsVersion; +use Piwik\Plugin\Reports; class GetOsVersions extends Base { @@ -20,8 +21,9 @@ class GetOsVersions extends Base $this->dimension = new OsVersion(); $this->name = Piwik::translate('DevicesDetection_OperatingSystemVersions'); $this->documentation = ''; // TODO - $this->order = 4; - $this->widgetTitle = 'DevicesDetection_OperatingSystemVersions'; + $this->order = 2; + + $this->subcategoryId = 'DevicesDetection_Software'; } public function configureView(ViewDataTable $view) @@ -35,7 +37,7 @@ class GetOsVersions extends Base public function getRelatedReports() { return array( - self::factory('DevicesDetection', 'getOsFamilies'), + Reports::factory('DevicesDetection', 'getOsFamilies'), ); } } diff --git a/plugins/DevicesDetection/Reports/GetType.php b/plugins/DevicesDetection/Reports/GetType.php index cbfa69db3d..b12f19f319 100644 --- a/plugins/DevicesDetection/Reports/GetType.php +++ b/plugins/DevicesDetection/Reports/GetType.php @@ -22,7 +22,8 @@ class GetType extends Base $this->name = Piwik::translate('DevicesDetection_DeviceType'); $this->documentation = ''; // TODO $this->order = 0; - $this->widgetTitle = 'DevicesDetection_DeviceType'; + + $this->subcategoryId = 'DevicesDetection_Devices'; } public function configureView(ViewDataTable $view) diff --git a/plugins/DevicesDetection/templates/devices.twig b/plugins/DevicesDetection/templates/devices.twig deleted file mode 100644 index a37079c9fd..0000000000 --- a/plugins/DevicesDetection/templates/devices.twig +++ /dev/null @@ -1,19 +0,0 @@ -<div class="row"> - - <div class="col-md-6"> - <h2 piwik-enriched-headline>{{ "DevicesDetection_DeviceType"|translate }}</h2> - {{ deviceTypes | raw}} - <h2 piwik-enriched-headline>{{ "DevicesDetection_DeviceBrand"|translate }}</h2> - {{ deviceBrands | raw }} - </div> - - <div class="col-md-6"> - <h2 piwik-enriched-headline>{{ "DevicesDetection_DeviceModel"|translate }}</h2> - {{ deviceModels | raw }} - {% if resolutions|default is not empty %} - <h2 piwik-enriched-headline>{{ 'Resolution_Resolutions'|translate }}</h2> - {{ resolutions|raw }} - {% endif %} - </div> - -</div> diff --git a/plugins/DevicesDetection/templates/software.twig b/plugins/DevicesDetection/templates/software.twig deleted file mode 100644 index 8b0dab0631..0000000000 --- a/plugins/DevicesDetection/templates/software.twig +++ /dev/null @@ -1,23 +0,0 @@ -<div class="row"> - - <div class="col-md-6"> - <h2 piwik-enriched-headline>{{ "DevicesDetection_OperatingSystems"|translate }}</h2> - {{ osReport | raw}} - {% if configurations|default is not empty %} - <h2 piwik-enriched-headline>{{ 'Resolution_Configurations'|translate }}</h2> - {{ configurations|raw }} - {% endif %} - </div> - - <div class="col-md-6"> - <h2 piwik-enriched-headline>{{ "DevicesDetection_Browsers"|translate }}</h2> - {{ browserReport | raw }} - <h2 piwik-enriched-headline>{{ "DevicesDetection_BrowserEngines"|translate }}</h2> - {{ browserEngineReport | raw }} - {% if browserPlugins|default is not empty %} - <h2 piwik-enriched-headline>{{ 'General_Plugins'|translate }}</h2> - {{ browserPlugins|raw }} - {% endif %} - </div> - -</div> |