示例#1
0
/**
 * Returns the theme selected for a particular device or false if none selected.
 *
 * @param string $devicetype
 * @return string|false The name of the theme to use for the device or the false if not set
 */
function get_selected_theme_for_device_type($devicetype = null) {
    global $CFG;

    if (empty($devicetype)) {
        $devicetype = get_user_device_type();
    }

    $themevarname = get_device_cfg_var_name($devicetype);
    if (empty($CFG->$themevarname)) {
        return false;
    }

    return $CFG->$themevarname;
}
示例#2
0
 /**
  * Please do not call this method directly, use the ->devicetypeinuse syntax. {@link __get()}.
  *
  * @return string The device type being used.
  */
 protected function magic_get_devicetypeinuse() {
     if (empty($this->_devicetypeinuse)) {
         $this->_devicetypeinuse = get_user_device_type();
     }
     return $this->_devicetypeinuse;
 }
 public function register_environment_values()
 {
     global $USER;
     $adaptor = Intuitel::getAdaptorInstance();
     // User agent.
     // The function get_user_device_type() was deprecated in Moodle 2.6.
     $device = class_exists('core_useragent') ? core_useragent::get_user_device_type() : get_user_device_type();
     $adaptor->registerEnvironment('dType', $device, $USER, time());
 }