private static function loadDeviceType() { $device_type = (string) cmsUser::getCookie('device_type'); if (!$device_type || !in_array($device_type, self::$device_types, true)) { cmsCore::loadLib('mobile_detect.class'); $detect = new Mobile_Detect(); $device_type = $detect->isMobile() ? $detect->isTablet() ? 'tablet' : 'mobile' : 'desktop'; cmsUser::setCookie('device_type', $device_type, 31536000); // на 1 год } self::$device_type = $device_type; }