Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsgiehl <stefan@piwik.org>2014-09-28 15:19:20 +0400
committersgiehl <stefan@piwik.org>2014-09-28 15:19:20 +0400
commitcfc04d63c6c00435a1c4eb6866f43af8b47ab47d (patch)
treeb787938965ba259bba53dd0bb13ae4364338a3ab /plugins/DevicesDetection
parent1dcc5fa38b27e498bbc61384cdb1c72c24516348 (diff)
moved last stuff from browser type (UserSettings) to browser engine (DevicesDetection)
Diffstat (limited to 'plugins/DevicesDetection')
-rw-r--r--plugins/DevicesDetection/DevicesDetection.php6
-rw-r--r--plugins/DevicesDetection/Visitor.php33
2 files changed, 38 insertions, 1 deletions
diff --git a/plugins/DevicesDetection/DevicesDetection.php b/plugins/DevicesDetection/DevicesDetection.php
index 6e018d7712..f144a449bf 100644
--- a/plugins/DevicesDetection/DevicesDetection.php
+++ b/plugins/DevicesDetection/DevicesDetection.php
@@ -14,7 +14,7 @@ use Piwik\Db;
use Piwik\Piwik;
use Piwik\Plugin\Manager as PluginManager;
use Piwik\Plugins\UserSettings\UserSettings;
-use Piwik\Plugins\UserSettings\Visitor;
+use Piwik\Plugins\DevicesDetection\Visitor;
require_once PIWIK_INCLUDE_PATH . '/plugins/DevicesDetection/functions.php';
@@ -46,7 +46,11 @@ class DevicesDetection extends \Piwik\Plugin
public function extendVisitorDetails(&$visitor, $details)
{
+ $instance = new Visitor($details);
+
$visitor['deviceType'] = getDeviceTypeLabel($details['config_device_type']);
+ $visitor['browserFamily'] = $instance->getBrowserFamily();
+ $visitor['browserFamilyDescription'] = $instance->getBrowserFamilyDescription();
if (!PluginManager::getInstance()->isPluginActivated('UserSettings')) {
$instance = new UserSettings();
diff --git a/plugins/DevicesDetection/Visitor.php b/plugins/DevicesDetection/Visitor.php
new file mode 100644
index 0000000000..ad37cfe2ae
--- /dev/null
+++ b/plugins/DevicesDetection/Visitor.php
@@ -0,0 +1,33 @@
+<?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\DevicesDetection;
+
+require_once PIWIK_INCLUDE_PATH . '/plugins/DevicesDetection/functions.php';
+
+class Visitor
+{
+ const DELIMITER_PLUGIN_NAME = ", ";
+
+ private $details = array();
+
+ public function __construct($details)
+ {
+ $this->details = $details;
+ }
+
+ function getBrowserFamilyDescription()
+ {
+ return getBrowserEngineName($this->getBrowserFamily());
+ }
+
+ function getBrowserFamily()
+ {
+ return $this->details['config_browser_engine'];
+ }
+} \ No newline at end of file