Example #1
0
 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;
 }
Example #2
0
 /**
  * Detects whether the request is coming from a mobile browser
  * @method isMobile
  * @static
  * @return {boolean}
  */
 static function isMobile()
 {
     static $result;
     if (isset($result)) {
         return $result;
     }
     /**
      * @event Q/request/isMobile {before}
      * @return {boolean}
      */
     $result = Q::event('Q/request/isMobile', array(), 'before');
     if (isset($result)) {
         return $result;
     }
     return Q_Request::isTouchscreen() and !Q_Request::isTablet();
 }
Example #3
0
 /**
  * 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}'";
 }
Example #4
0
 static function htmlAttributes()
 {
     $touchscreen = Q_Request::isTouchscreen() ? 'Q_touchscreen' : 'Q_notTouchscreen';
     $mobile = Q_Request::isMobile() ? 'Q_mobile' : 'Q_notMobile';
     $ie = Q_Request::isIE() ? 'Q_ie' : 'Q_notIE';
     $ie8 = Q_Request::isIE(0, 8) ? 'Q_ie8OrBelow' : 'Q_notIE8OrBelow';
     $result = 'lang="en" prefix="og: http://ogp.me/ns# object: http://ogp.me/ns/object#" ' . "class='{$touchscreen} {$mobile} {$ie} {$ie8}'";
     return $result;
 }