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:
authorLukas Winkler <Findus23@users.noreply.github.com>2017-04-18 20:50:49 +0300
committerStefan Giehl <stefan@piwik.org>2017-04-18 20:50:49 +0300
commitac9d6ab9ee5cf80ad2a769d40004c20410dc1053 (patch)
tree074359df33d3737d5f1f922d850b8ec654c2e730 /plugins/DevicesDetection
parent3bb0a9767a9e8a081fd5a02ec498ccf6d61746e9 (diff)
New device icons (#11601)
* use new device icons former plugins/DevicesDetection/images/screens * replace normal.png with desktop.png in tests * fix most tests * submodule updates * update screenshots * update exptected test files
Diffstat (limited to 'plugins/DevicesDetection')
-rw-r--r--plugins/DevicesDetection/functions.php23
-rw-r--r--plugins/DevicesDetection/tests/System/expected/test___DevicesDetection.getType_day.xml24
2 files changed, 17 insertions, 30 deletions
diff --git a/plugins/DevicesDetection/functions.php b/plugins/DevicesDetection/functions.php
index af821c43c7..8aa6f312d3 100644
--- a/plugins/DevicesDetection/functions.php
+++ b/plugins/DevicesDetection/functions.php
@@ -155,26 +155,13 @@ function getDeviceTypeLogo($label)
{
if (is_numeric($label) && in_array($label, DeviceParser::getAvailableDeviceTypes())) {
$label = array_search($label, DeviceParser::getAvailableDeviceTypes());
- }
-
- $label = strtolower($label);
-
- $deviceTypeLogos = Array(
- "desktop" => "normal.png",
- "smartphone" => "smartphone.png",
- "tablet" => "tablet.png",
- "tv" => "tv.png",
- "feature phone" => "mobile.png",
- "console" => "console.png",
- "car browser" => "carbrowser.png",
- "camera" => "camera.png");
-
- if (!array_key_exists($label, $deviceTypeLogos)) {
- $label = 'unknown.png';
+ $label = strtolower($label);
+ $label = str_replace(' ', '_', $label);
} else {
- $label = $deviceTypeLogos[$label];
+ $label = "unknown";
}
- $path = 'plugins/DevicesDetection/images/screens/' . $label;
+
+ $path = 'plugins/Morpheus/icons/dist/devices/' . $label . ".png";
return $path;
}
diff --git a/plugins/DevicesDetection/tests/System/expected/test___DevicesDetection.getType_day.xml b/plugins/DevicesDetection/tests/System/expected/test___DevicesDetection.getType_day.xml
index 7db59b5306..bab8a9f0cf 100644
--- a/plugins/DevicesDetection/tests/System/expected/test___DevicesDetection.getType_day.xml
+++ b/plugins/DevicesDetection/tests/System/expected/test___DevicesDetection.getType_day.xml
@@ -19,7 +19,7 @@
<nb_conversions>2</nb_conversions>
<revenue>52.26</revenue>
<segment>deviceType==tablet</segment>
- <logo>plugins/DevicesDetection/images/screens/tablet.png</logo>
+ <logo>plugins/Morpheus/icons/dist/devices/tablet.png</logo>
</row>
<row>
<label>Smartphone</label>
@@ -40,7 +40,7 @@
<nb_conversions>2</nb_conversions>
<revenue>52.26</revenue>
<segment>deviceType==smartphone</segment>
- <logo>plugins/DevicesDetection/images/screens/smartphone.png</logo>
+ <logo>plugins/Morpheus/icons/dist/devices/smartphone.png</logo>
</row>
<row>
<label>Unknown</label>
@@ -60,7 +60,7 @@
</goals>
<nb_conversions>2</nb_conversions>
<revenue>52.26</revenue>
- <logo>plugins/DevicesDetection/images/screens/unknown.png</logo>
+ <logo>plugins/Morpheus/icons/dist/devices/unknown.png</logo>
</row>
<row>
<label>Desktop</label>
@@ -81,7 +81,7 @@
<nb_conversions>1</nb_conversions>
<revenue>10</revenue>
<segment>deviceType==desktop</segment>
- <logo>plugins/DevicesDetection/images/screens/normal.png</logo>
+ <logo>plugins/Morpheus/icons/dist/devices/desktop.png</logo>
</row>
<row>
<label>Tv</label>
@@ -94,48 +94,48 @@
<bounce_count>1</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
<segment>deviceType==tv</segment>
- <logo>plugins/DevicesDetection/images/screens/tv.png</logo>
+ <logo>plugins/Morpheus/icons/dist/devices/tv.png</logo>
</row>
<row>
<label>Camera</label>
<nb_visits>0</nb_visits>
<segment>deviceType==camera</segment>
- <logo>plugins/DevicesDetection/images/screens/camera.png</logo>
+ <logo>plugins/Morpheus/icons/dist/devices/camera.png</logo>
</row>
<row>
<label>Car browser</label>
<nb_visits>0</nb_visits>
<segment>deviceType==car+browser</segment>
- <logo>plugins/DevicesDetection/images/screens/carbrowser.png</logo>
+ <logo>plugins/Morpheus/icons/dist/devices/car_browser.png</logo>
</row>
<row>
<label>Console</label>
<nb_visits>0</nb_visits>
<segment>deviceType==console</segment>
- <logo>plugins/DevicesDetection/images/screens/console.png</logo>
+ <logo>plugins/Morpheus/icons/dist/devices/console.png</logo>
</row>
<row>
<label>Feature phone</label>
<nb_visits>0</nb_visits>
<segment>deviceType==feature+phone</segment>
- <logo>plugins/DevicesDetection/images/screens/mobile.png</logo>
+ <logo>plugins/Morpheus/icons/dist/devices/feature_phone.png</logo>
</row>
<row>
<label>Phablet</label>
<nb_visits>0</nb_visits>
<segment>deviceType==phablet</segment>
- <logo>plugins/DevicesDetection/images/screens/unknown.png</logo>
+ <logo>plugins/Morpheus/icons/dist/devices/phablet.png</logo>
</row>
<row>
<label>Portable media player</label>
<nb_visits>0</nb_visits>
<segment>deviceType==portable+media+player</segment>
- <logo>plugins/DevicesDetection/images/screens/unknown.png</logo>
+ <logo>plugins/Morpheus/icons/dist/devices/portable_media_player.png</logo>
</row>
<row>
<label>Smart display</label>
<nb_visits>0</nb_visits>
<segment>deviceType==smart+display</segment>
- <logo>plugins/DevicesDetection/images/screens/unknown.png</logo>
+ <logo>plugins/Morpheus/icons/dist/devices/smart_display.png</logo>
</row>
</result> \ No newline at end of file