From ac9d6ab9ee5cf80ad2a769d40004c20410dc1053 Mon Sep 17 00:00:00 2001 From: Lukas Winkler Date: Tue, 18 Apr 2017 19:50:49 +0200 Subject: 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 --- plugins/DevicesDetection/functions.php | 23 +++++---------------- .../test___DevicesDetection.getType_day.xml | 24 +++++++++++----------- 2 files changed, 17 insertions(+), 30 deletions(-) (limited to 'plugins/DevicesDetection') 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 @@ 2 52.26 deviceType==tablet - plugins/DevicesDetection/images/screens/tablet.png + plugins/Morpheus/icons/dist/devices/tablet.png @@ -40,7 +40,7 @@ 2 52.26 deviceType==smartphone - plugins/DevicesDetection/images/screens/smartphone.png + plugins/Morpheus/icons/dist/devices/smartphone.png @@ -60,7 +60,7 @@ 2 52.26 - plugins/DevicesDetection/images/screens/unknown.png + plugins/Morpheus/icons/dist/devices/unknown.png @@ -81,7 +81,7 @@ 1 10 deviceType==desktop - plugins/DevicesDetection/images/screens/normal.png + plugins/Morpheus/icons/dist/devices/desktop.png @@ -94,48 +94,48 @@ 1 0 deviceType==tv - plugins/DevicesDetection/images/screens/tv.png + plugins/Morpheus/icons/dist/devices/tv.png 0 deviceType==camera - plugins/DevicesDetection/images/screens/camera.png + plugins/Morpheus/icons/dist/devices/camera.png 0 deviceType==car+browser - plugins/DevicesDetection/images/screens/carbrowser.png + plugins/Morpheus/icons/dist/devices/car_browser.png 0 deviceType==console - plugins/DevicesDetection/images/screens/console.png + plugins/Morpheus/icons/dist/devices/console.png 0 deviceType==feature+phone - plugins/DevicesDetection/images/screens/mobile.png + plugins/Morpheus/icons/dist/devices/feature_phone.png 0 deviceType==phablet - plugins/DevicesDetection/images/screens/unknown.png + plugins/Morpheus/icons/dist/devices/phablet.png 0 deviceType==portable+media+player - plugins/DevicesDetection/images/screens/unknown.png + plugins/Morpheus/icons/dist/devices/portable_media_player.png 0 deviceType==smart+display - plugins/DevicesDetection/images/screens/unknown.png + plugins/Morpheus/icons/dist/devices/smart_display.png \ No newline at end of file -- cgit v1.2.3