function Users_device_post() { $user = Users::loggedInUser(true); $token = isset($_REQUEST['token']) ? $_REQUEST['token'] : null; $platform = Q_Request::platform(); $version = Q_Request::OSVersion(); $formFactor = Q_Request::isMobile() ? 'mobile' : (Q_Request::isTablet() ? 'tablet' : null); $device = new Users_Device(); $device->userId = $user->id; $device->deviceId = $token; $device->platform = $platform; $device->version = $version; $device->formFactor = $formFactor; $device->sessionId = Q_Session::id(); $_SESSION['Users']['deviceId'] = $token; Q_Response::setSlot('data', !!$device->save(true)); Q_Utils::sendToNode(array("Q/method" => "Users/device", "userId" => $user->id, "deviceId" => $token)); }
echo Q_Html::themedUrl('img/icon/152.png'); ?> " /> <link rel="apple-touch-icon-precomposed" sizes="180x180" href="<?php echo Q_Html::themedUrl('img/icon/180.png'); ?> " /> <?php } ?> <link rel="shortcut icon" sizes="196x196" href="<?php echo Q_Html::themedUrl('img/icon/196.png'); ?> " /> <?php if (Q_Request::platform() === 'android') { ?> <?php foreach (array(36, 48, 72, 96, 144, 192) as $size) { ?> <link rel="icon" sizes="<?php echo $size . 'x' . $size; ?> " href="<?php echo Q_Html::themedUrl("img/icon/android-icon-{$size}x{$size}.png"); ?> " /> <?php } ?> <?php
static function htmlAttributes() { $touchscreen = Q_Request::isTouchscreen() ? 'Q_touchscreen' : 'Q_notTouchscreen'; $mobile = Q_Request::isMobile() ? 'Q_mobile' : 'Q_notMobile'; $cordova = Q_Request::isCordova() ? 'Q_cordova' : 'Q_notCordova'; $platform = 'Q_' . Q_Request::platform(); $ie = Q_Request::isIE() ? 'Q_ie' : 'Q_notIE'; $ie8 = Q_Request::isIE(0, 8) ? 'Q_ie8OrBelow' : 'Q_notIE8OrBelow'; $uri = Q_Dispatcher::uri(); $classes = "{$uri->module} {$uri->module}_{$uri->action}"; $result = 'lang="en" prefix="og: http://ogp.me/ns# object: http://ogp.me/ns/object#" ' . "class='{$touchscreen} {$mobile} {$cordova} {$platform} {$ie} {$ie8} {$classes}'"; return $result; }
/** * Returns the string containing all the html attributes * @method htmlAttributes * @static * @return {string} */ static function htmlAttributes() { $touchscreen = Q_Request::isTouchscreen() ? 'Q_touchscreen' : 'Q_notTouchscreen'; $mobile = Q_Request::isMobile() ? 'Q_mobile' : 'Q_notMobile'; $cordova = Q_Request::isCordova() ? 'Q_cordova' : 'Q_notCordova'; $platform = 'Q_' . Q_Request::platform(); $ie = Q_Request::isIE() ? 'Q_ie' : 'Q_notIE'; $ie8 = Q_Request::isIE(0, 8) ? 'Q_ie8OrBelow' : 'Q_notIE8OrBelow'; $uri = Q_Dispatcher::uri(); $classes = "{$uri->module} {$uri->module}_{$uri->action}"; foreach (self::$htmlCssClasses as $k => $v) { $classes .= Q_Html::text(" {$k}"); } $language = self::language(); return 'lang="' . $language . '" ' . 'prefix="og: http://ogp.me/ns# object: http://ogp.me/ns/object#" ' . "class='{$touchscreen} {$mobile} {$cordova} {$platform} {$ie} {$ie8} {$classes}'"; }
/** * Some standard info to be stored in sessions, devices, etc. * @return {array} */ static function userAgentInfo() { $info = array('formFactor' => Q_Request::formFactor(), 'platform' => Q_Request::platform(), 'version' => Q_Request::OSVersion()); $fields = Q_Config::get('Q', 'session', 'userAgentInfo', array()); return Q::take($info, $fields); }