original_string: protected function guess_device_type() {
          global $CFG;
          if (empty($CFG->enabledevicedetection)) {
              $this->devicetype = self::DEVICETYPE_DEFAULT;
              return $this->devicetype;
          }
          foreach ($this->devicetypecustoms as $value => $regex) {
              if (preg_match($regex, $this->useragent)) {
                  $this->devicetype = $value;
                  return $this->devicetype;
              }
          }
          if ($this->is_useragent_mobile()) {
              $this->devicetype = self::DEVICETYPE_MOBILE;
          } else if ($this->is_useragent_tablet()) {
              $this->devicetype = self::DEVICETYPE_TABLET;
          } else if (self::check_ie_version('0') && !self::check_ie_version('7.0')) {
              // IE 6 and before are considered legacy.
              $this->devicetype = self::DEVICETYPE_LEGACY;
          } else {
              $this->devicetype = self::DEVICETYPE_DEFAULT;
          }
          return $this->devicetype;
      }
code: protected function guess_device_type() {
          global $CFG;
          if (empty($CFG->enabledevicedetection)) {
              $this->devicetype = self::DEVICETYPE_DEFAULT;
              return $this->devicetype;
          }
          foreach ($this->devicetypecustoms as $value => $regex) {
              if (preg_match($regex, $this->useragent)) {
                  $this->devicetype = $value;
                  return $this->devicetype;
              }
          }
          if ($this->is_useragent_mobile()) {
              $this->devicetype = self::DEVICETYPE_MOBILE;
          } else if ($this->is_useragent_tablet()) {
              $this->devicetype = self::DEVICETYPE_TABLET;
          } else if (self::check_ie_version('0') && !self::check_ie_version('7.0')) {
              // IE 6 and before are considered legacy.
              $this->devicetype = self::DEVICETYPE_LEGACY;
          } else {
              $this->devicetype = self::DEVICETYPE_DEFAULT;
          }
          return $this->devicetype;
      }
code_tokens: protected function guess_device_type ( ) { global $ CFG ; if ( empty ( $ CFG -> enabledevicedetection ) ) { $ this -> devicetype = self :: DEVICETYPE_DEFAULT ; return $ this -> devicetype ; } foreach ( $ this -> devicetypecustoms as $ value => $ regex ) { if ( preg_match ( $ regex , $ this -> useragent ) ) { $ this -> devicetype = $ value ; return $ this -> devicetype ; } } if ( $ this -> is_useragent_mobile ( ) ) { $ this -> devicetype = self :: DEVICETYPE_MOBILE ; } else if ( $ this -> is_useragent_tablet ( ) ) { $ this -> devicetype = self :: DEVICETYPE_TABLET ; } else if ( self :: check_ie_version ( '0' ) && ! self :: check_ie_version ( '7.0' ) ) { // IE 6 and before are considered legacy. $ this -> devicetype = self :: DEVICETYPE_LEGACY ; } else { $ this -> devicetype = self :: DEVICETYPE_DEFAULT ; } return $ this -> devicetype ; }
docstring: Guesses the device type the user agent is running on.
  
  @return string
docstring_tokens: Guesses the device type the user agent is running on .