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:
authorMatthieu Napoli <matthieu@mnapoli.fr>2015-03-16 01:41:46 +0300
committerMatthieu Napoli <matthieu@mnapoli.fr>2015-03-16 01:41:46 +0300
commitd715546ed1e9d53ee13ca94792b0fe2104d32d04 (patch)
tree3722809a87d0cd2847709f5645f8fb612228a124 /plugins/DevicesDetection/functions.php
parentd23efdee2b77d6f464a66af8a12f40e1aeffd243 (diff)
#6933 Improve the "Device model" report by prefixing the model with the brand name
E.g. 'iPad' would become 'Apple - iPad'
Diffstat (limited to 'plugins/DevicesDetection/functions.php')
-rw-r--r--plugins/DevicesDetection/functions.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/plugins/DevicesDetection/functions.php b/plugins/DevicesDetection/functions.php
index 9d875b32ab..f47ba4c175 100644
--- a/plugins/DevicesDetection/functions.php
+++ b/plugins/DevicesDetection/functions.php
@@ -179,10 +179,19 @@ function getDeviceTypeLogo($label)
function getModelName($label)
{
- if (!$label) {
- return Piwik::translate('General_Unknown');
+ if (strpos($label, ';') !== false) {
+ list($brand, $model) = explode(';', $label, 2);
+ } else {
+ $brand = null;
+ $model = $label;
+ }
+ if (!$model) {
+ $model = Piwik::translate('General_Unknown');
+ }
+ if (!$brand) {
+ return $model;
}
- return $label;
+ return getDeviceBrandLabel($brand) . ' - ' . $model;
}
function getOSFamilyFullName($label)