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 03:37:26 +0400
committersgiehl <stefan@piwik.org>2014-09-28 03:37:26 +0400
commit008ed65f0a7180285fe2dd3567c57902a0767941 (patch)
tree1a411844beb38038387d5fb274debf6ccd5d25b2 /plugins/DevicesDetection/functions.php
parent4f7cfc628813efbe968705bf8a0173582583ce32 (diff)
refs #3962 - implemented new detection of browser engines. Merged old reports from UserSettings plugin to DevicesDetection plugin. Added segment option for browser engines. Added update script to move old archives and to update old visits with engine data
Diffstat (limited to 'plugins/DevicesDetection/functions.php')
-rw-r--r--plugins/DevicesDetection/functions.php43
1 files changed, 42 insertions, 1 deletions
diff --git a/plugins/DevicesDetection/functions.php b/plugins/DevicesDetection/functions.php
index af76162f01..1112be3050 100644
--- a/plugins/DevicesDetection/functions.php
+++ b/plugins/DevicesDetection/functions.php
@@ -119,7 +119,7 @@ function getDeviceTypeLabel($label)
'feature phone' => 'DevicesDetection_FeaturePhone',
'console' => 'DevicesDetection_Console',
'tv' => 'DevicesDetection_TV',
- 'car browser' => 'DevicesDetection_CarBbrowser',
+ 'car browser' => 'DevicesDetection_CarBrowser',
'smart display' => 'DevicesDetection_SmartDisplay',
'camera' => 'DevicesDetection_Camera'
);
@@ -252,3 +252,44 @@ function getOsLogoExtended($short)
}
return sprintf($path, 'UNK');
}
+
+/**
+ * Returns the display name for a browser engine
+ *
+ * @param $engineName
+ *
+ * @return string
+ */
+function getBrowserEngineName($engineName) {
+ /*
+ * Map leagcy types to engines
+ */
+ $oldTypeMapping = array(
+ 'ie' => 'Trident',
+ 'gecko' => 'Gecko',
+ 'khtml' => 'KHTML',
+ 'webkit' => 'WebKit',
+ 'opera' => 'Presto',
+ 'unknown' => ''
+ );
+ if (array_key_exists($engineName, $oldTypeMapping)) {
+ $engineName = $oldTypeMapping[$engineName];
+ }
+
+ $displayNames = array(
+ 'Trident' => 'Trident (IE)',
+ 'Gecko' => 'Gecko (Firefox)',
+ 'KHTML' => 'KHTML (Konquerer)',
+ 'Presto' => 'Presto (Opera)',
+ 'WebKit' => 'WebKit (Safari, Chrome)',
+ 'Blink' => 'Blink (Chrome, Opera)'
+ );
+
+ if (!empty($engineName)) {
+ if (!empty($displayNames[$engineName])) {
+ return $displayNames[$engineName];
+ }
+ return $engineName;
+ }
+ return Piwik::translate('General_Unknown');
+} \ No newline at end of file