You are here

static function ThemekeyBrowserDetection::getOsSimplified in ThemeKey 7.3

Same name and namespace in other branches
  1. 7 modules/themekey_browser_detection.php \ThemekeyBrowserDetection::getOsSimplified()
  2. 7.2 modules/themekey_browser_detection.php \ThemekeyBrowserDetection::getOsSimplified()

Get operating system simplified

@static @access public

Parameters

string os:

Return value

string os name or 'unknown' in unrecognized os

1 call to ThemekeyBrowserDetection::getOsSimplified()
themekey_user_os2user_os_simplified in modules/themekey.system.inc
ThemeKey mapping function to set a ThemeKey property's value (destination) with the aid of another ThemeKey property (source).

File

modules/themekey_browser_detection.php, line 245
Derived from Browser Detection Class by Dragan Dinic <dragan@dinke.net> and modified to fit the needs of ThemeKey Properties.

Class

ThemekeyBrowserDetection
Browser Detection class contains common static method for getting browser version and OS

Code

static function getOsSimplified($os) {
  if (strpos($os, 'Windows Phone') !== FALSE) {
    return 'Windows Phone';
  }
  elseif (strpos($os, 'Windows') !== FALSE) {
    return 'Windows';
  }
  else {
    return $os;
  }
}