Ejemplo n.º 1
0
/**
 * Returns the device the user is currently using, or if the user has chosen to switch devices
 * for the current device type the type they have switched to.
 *
 * @deprecated since 2.6
 * @return string The device the user is currently using or wishes to use
 */
function get_user_device_type()
{
    debugging('get_user_device_type has been deprecated, please update your code to use core_useragent instead.', DEBUG_DEVELOPER);
    return core_useragent::get_user_device_type();
}
Ejemplo n.º 2
0
 /**
  * Please do not call this method directly, use the ->devicetypeinuse syntax. {@link moodle_page::__get()}.
  * @return string The device type being used.
  */
 protected function magic_get_devicetypeinuse()
 {
     if (empty($this->_devicetypeinuse)) {
         $this->_devicetypeinuse = core_useragent::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());
 }