Skip to content

Commit

Permalink
removed screen type report and widget
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl committed Nov 28, 2014
1 parent b00a625 commit 8a25a5f
Show file tree
Hide file tree
Showing 104 changed files with 53 additions and 1,176 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This is a changelog for Piwik platform developers. All changes for our HTTP API'
* The API method `UserSettings.getOS` is deprecated and will be removed from May 1st 2015. Use `DevicesDetection.getOsVersions` instead
* The API method `UserSettings.getMobileVsDesktop` is deprecated and will be removed from May 1st 2015. Use `DevicesDetection.getType` instead
* The API method `UserSettings.getBrowserType` is deprecated and will be removed from May 1st 2015. Use `DevicesDetection.getBrowserEngines` instead
* The API method `UserSettings.getWideScreen` is deprecated and will be removed from May 1st 2015. Use `UserSettings.getScreenType` instead
* The API method `UserSettings.getWideScreen` has been removed

## Piwik 2.9.1

Expand Down
8 changes: 4 additions & 4 deletions core/API/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
*
* **Basic Usage**
*
* $request = new Request('method=UserSettings.getWideScreen&idSite=1&date=yesterday&period=week'
* $request = new Request('method=UserSettings.getLanguage&idSite=1&date=yesterday&period=week'
* . '&format=xml&filter_limit=5&filter_offset=0')
* $result = $request->process();
* echo $result;
*
* **Getting a unrendered DataTable**
*
* // use the convenience method 'processRequest'
* $dataTable = Request::processRequest('UserSettings.getWideScreen', array(
* $dataTable = Request::processRequest('UserSettings.getLanguage', array(
* 'idSite' => 1,
* 'date' => 'yesterday',
* 'period' => 'week',
Expand All @@ -78,7 +78,7 @@ class Request
* forwarded to request array before it is returned.
*
* @param string|array $request The base request string or array, eg,
* `'module=UserSettings&action=getWidescreen'`.
* `'module=UserSettings&action=getLanguage'`.
* @param array $defaultRequest Default query parameters. If a query parameter is absent in `$request`, it will be loaded
* from this. Defaults to `$_GET + $_POST`.
* @return array
Expand Down Expand Up @@ -125,7 +125,7 @@ public static function getRequestArrayFromString($request, $defaultRequest = nul
* Constructor.
*
* @param string|array $request Query string that defines the API call (must at least contain a **method** parameter),
* eg, `'method=UserSettings.getWideScreen&idSite=1&date=yesterday&period=week&format=xml'`
* eg, `'method=UserSettings.getLanguage&idSite=1&date=yesterday&period=week&format=xml'`
* If a request is not provided, then we use the values in the `$_GET` and `$_POST`
* superglobals.
* @param array $defaultRequest Default query parameters. If a query parameter is absent in `$request`, it will be loaded
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@
<location>France</location>
<latitude />
<longitude />
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
<plugins>flash, java</plugins>
<pluginsIcons>
<row>
Expand Down Expand Up @@ -177,9 +175,7 @@
<location>France</location>
<latitude />
<longitude />
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
<plugins>director</plugins>
<pluginsIcons>
<row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@
<location>France</location>
<latitude />
<longitude />
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
<plugins>flash, java</plugins>
<pluginsIcons>
<row>
Expand Down Expand Up @@ -177,9 +175,7 @@
<location>France</location>
<latitude />
<longitude />
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
<plugins>director</plugins>
<pluginsIcons>
<row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@
<location>France</location>
<latitude />
<longitude />
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
<plugins>flash, java</plugins>
<pluginsIcons>
<row>
Expand Down Expand Up @@ -177,9 +175,7 @@
<location>France</location>
<latitude />
<longitude />
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
<plugins>director</plugins>
<pluginsIcons>
<row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@
<location>France</location>
<latitude />
<longitude />
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
<plugins>flash, java</plugins>
<pluginsIcons>
<row>
Expand Down Expand Up @@ -177,9 +175,7 @@
<location>France</location>
<latitude />
<longitude />
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
<plugins>director</plugins>
<pluginsIcons>
<row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@
<location>France</location>
<latitude />
<longitude />
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
<plugins>flash, java</plugins>
<pluginsIcons>
<row>
Expand Down Expand Up @@ -177,9 +175,7 @@
<location>France</location>
<latitude />
<longitude />
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
<plugins>director</plugins>
<pluginsIcons>
<row>
Expand Down
2 changes: 1 addition & 1 deletion plugins/CoreHome/javascripts/dataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ DataTable.registerFooterIconHandler = function (id, handler) {
/**
* Returns the first datatable div displaying a specific report.
*
* @param {string} report The report, eg, UserSettings.getWideScreen
* @param {string} report The report, eg, UserSettings.getLanguage
* @return {Element} The datatable div displaying the report, or undefined if
* it cannot be found.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@
<location>France</location>
<latitude />
<longitude />
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
<plugins>flash, java</plugins>
<pluginsIcons>
<row>
Expand Down
2 changes: 1 addition & 1 deletion plugins/Live/templates/_dataTableViz_visitorLog.twig
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{% endif %}
{% if visitor.getColumn('operatingSystemIcon') %}&nbsp;
<img src="{{ visitor.getColumn('operatingSystemIcon') }}"
title="{{ visitor.getColumn('operatingSystem') }}, {{ visitor.getColumn('resolution') }} ({{ visitor.getColumn('screenType') }})"/>{% endif %}
title="{{ visitor.getColumn('operatingSystem') }}, {{ visitor.getColumn('resolution') }}"/>{% endif %}
{% if visitor.getColumn('visitorTypeIcon') %}
{% if visitor.getColumn('visitorTypeIcon') %}&nbsp;-
<img src="{{ visitor.getColumn('visitorTypeIcon') }}"
Expand Down
16 changes: 0 additions & 16 deletions plugins/UserSettings/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,22 +106,6 @@ public function getBrowserType($idSite, $period, $date, $segment = false)
return $this->getDevicesDetectorApi()->getBrowserEngines($idSite, $period, $date, $segment);
}

/**
* @deprecated since 2.10.0 Use {@link getScreenType} instead.
*/
public function getWideScreen($idSite, $period, $date, $segment = false)
{
return $this->getScreenType($idSite, $period, $date, $segment);
}

public function getScreenType($idSite, $period, $date, $segment = false)
{
$dataTable = $this->getDataTable(Archiver::SCREEN_TYPE_RECORD_NAME, $idSite, $period, $date, $segment);
$dataTable->queueFilter('ColumnCallbackAddMetadata', array('label', 'logo', __NAMESPACE__ . '\getScreensLogo'));
$dataTable->queueFilter('ColumnCallbackReplace', array('label', 'ucfirst'));
return $dataTable;
}

public function getPlugin($idSite, $period, $date, $segment = false)
{
// fetch all archive data required
Expand Down
16 changes: 1 addition & 15 deletions plugins/UserSettings/Archiver.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class Archiver extends \Piwik\Plugin\Archiver
{
const LANGUAGE_RECORD_NAME = 'UserSettings_language';
const PLUGIN_RECORD_NAME = 'UserSettings_plugin';
const SCREEN_TYPE_RECORD_NAME = 'UserSettings_wideScreen';
const RESOLUTION_RECORD_NAME = 'UserSettings_resolution';
const CONFIGURATION_RECORD_NAME = 'UserSettings_configuration';

Expand All @@ -41,7 +40,7 @@ class Archiver extends \Piwik\Plugin\Archiver
public function aggregateDayReport()
{
$this->aggregateByConfiguration();
$this->aggregateByResolutionAndScreenType();
$this->aggregateByResolution();
$this->aggregateByPlugin();
$this->aggregateByLanguage();
}
Expand All @@ -54,7 +53,6 @@ public function aggregateMultipleReports()
$dataTableRecords = array(
self::CONFIGURATION_RECORD_NAME,
self::RESOLUTION_RECORD_NAME,
self::SCREEN_TYPE_RECORD_NAME,
self::PLUGIN_RECORD_NAME,
self::LANGUAGE_RECORD_NAME,
);
Expand All @@ -67,12 +65,6 @@ protected function aggregateByConfiguration()
$this->insertTable(self::CONFIGURATION_RECORD_NAME, $metrics);
}

protected function aggregateByResolutionAndScreenType()
{
$resolutions = $this->aggregateByResolution();
$this->aggregateByScreenType($resolutions);
}

protected function aggregateByResolution()
{
$table = $this->getLogAggregator()->getMetricsFromVisitByDimension(self::RESOLUTION_DIMENSION)->asDataTable();
Expand All @@ -83,12 +75,6 @@ protected function aggregateByResolution()
return $table;
}

protected function aggregateByScreenType(DataTable $resolutions)
{
$resolutions->filter('GroupBy', array('label', __NAMESPACE__ . '\getScreenTypeFromResolution'));
$this->insertTable(self::SCREEN_TYPE_RECORD_NAME, $resolutions);
}

protected function aggregateByPlugin()
{
$selects = array(
Expand Down
20 changes: 0 additions & 20 deletions plugins/UserSettings/Columns/TypeOfScreen.php

This file was deleted.

2 changes: 0 additions & 2 deletions plugins/UserSettings/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use Piwik\Plugins\UserSettings\Reports\GetLanguage;
use Piwik\Plugins\UserSettings\Reports\GetPlugin;
use Piwik\Plugins\UserSettings\Reports\GetResolution;
use Piwik\Plugins\UserSettings\Reports\GetScreenType;
use Piwik\View;

/**
Expand All @@ -27,7 +26,6 @@ public function index()
$view->dataTablePlugin = $this->renderReport(new GetPlugin());
$view->dataTableResolution = $this->renderReport(new GetResolution());
$view->dataTableConfiguration = $this->renderReport(new GetConfiguration());
$view->dataTableScreenType = $this->renderReport(new GetScreenType());
$view->dataTableBrowserLanguage = $this->renderReport(new GetLanguage());

return $view->render();
Expand Down
37 changes: 0 additions & 37 deletions plugins/UserSettings/Reports/GetScreenType.php

This file was deleted.

6 changes: 0 additions & 6 deletions plugins/UserSettings/UserSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,13 @@ public function mapDeprecatedActions(&$module, &$action, &$parameters)
$module = 'DevicesDetection';
$action = $movedMethods[$action];
}

if ($module == 'UserSettings' && $action == 'getWideScreen') {
$action = 'getScreenType';
}
}

public function extendVisitorDetails(&$visitor, $details)
{
$instance = new Visitor($details);

$visitor['screenType'] = $instance->getScreenType();
$visitor['resolution'] = $instance->getResolution();
$visitor['screenTypeIcon'] = $instance->getScreenTypeIcon();
$visitor['plugins'] = $instance->getPlugins();
$visitor['pluginsIcons'] = $instance->getPluginIcons();
}
Expand Down
21 changes: 0 additions & 21 deletions plugins/UserSettings/Visitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,6 @@ function getPluginIcons()
return null;
}

function getScreenType()
{
if (!array_key_exists('config_resolution', $this->details)) {
return null;
}

return getScreenTypeFromResolution($this->details['config_resolution']);
}

function getResolution()
{
if (!array_key_exists('config_resolution', $this->details)) {
Expand All @@ -80,16 +71,4 @@ function getResolution()

return $this->details['config_resolution'];
}

function getScreenTypeIcon()
{
$type = $this->getScreenType();

if (empty($type)) {
return null;
}

return getScreensLogo($type);
}

}
Loading

0 comments on commit 8a25a5f

Please sign in to comment.