当前位置: 首页>>代码示例>>PHP>>正文


PHP waRequest::isMobile方法代码示例

本文整理汇总了PHP中waRequest::isMobile方法的典型用法代码示例。如果您正苦于以下问题:PHP waRequest::isMobile方法的具体用法?PHP waRequest::isMobile怎么用?PHP waRequest::isMobile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在waRequest的用法示例。


在下文中一共展示了waRequest::isMobile方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 public function execute()
 {
     $this->view->assign('title', $this->getTitle());
     $this->view->assign('title_style', $this->getTitleStyle());
     $this->view->setOptions(array('left_delimiter' => '{', 'right_delimiter' => '}'));
     if ($this->template === null) {
         if (waRequest::isMobile()) {
             $this->setLayout(null);
             $this->template = 'LoginMobile.html';
         } else {
             $this->template = 'Login.html';
         }
         $template_file = wa()->getDataPath('templates/' . $this->template, false, 'webasyst');
         if (file_exists($template_file)) {
             $this->template = 'file:' . $template_file;
         } else {
             $this->template = wa()->getAppPath('templates/actions/login/', 'webasyst') . $this->template;
         }
     }
     $this->view->assign('login', waRequest::post('login', $this->getStorage()->read('auth_login')));
     parent::execute();
     if ($this->layout) {
         $this->layout->assign('error', $this->view->getVars('error'));
     }
     $ref = waRequest::server('HTTP_REFERER');
     if (waRequest::get('back_to') && $ref) {
         $this->getStorage()->write('login_back_on_cancel', $ref);
     } else {
         if (!$ref) {
             $this->getStorage()->remove('login_back_on_cancel');
         }
     }
     $this->view->assign('back_on_cancel', wa()->getStorage()->read('login_back_on_cancel'));
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:34,代码来源:webasystLogin.action.php

示例2: frontendHead

 public function frontendHead($param)
 {
     $domain_settings = shopOnestep::getDomainSettings();
     if (!(waRequest::isMobile() && !empty($domain_settings['desktop_only'])) && $this->getSettings('status') && $domain_settings['status'] && wa()->getRouting()->getCurrentUrl() != 'checkout/success/' && wa()->getRouting()->getCurrentUrl() != 'checkout/error/' && (wa()->getRouting()->getCurrentUrl() == 'cart/' || preg_match('@^checkout/@i', wa()->getRouting()->getCurrentUrl()))) {
         $onestep_url = wa()->getRouteUrl('shop/frontend/onestep');
         wa()->getResponse()->redirect($onestep_url);
     }
 }
开发者ID:pmyagkov,项目名称:allmyart,代码行数:8,代码来源:shopOnestep.plugin.php

示例3: _getTemplate

 public function _getTemplate()
 {
     $template = parent::getTemplate();
     if (($id = waRequest::isMobile()) || true) {
         $this->view->assign('mobile_id', $id);
         $template = str_replace('templates/actions/', 'templates/actions-mobile/', $template);
     }
     return $template;
 }
开发者ID:navi8602,项目名称:wa-shop-ppg,代码行数:9,代码来源:installerBackend.action.php

示例4: getTemplate

 protected function getTemplate()
 {
     if (!$this->template) {
         $this->template = 'ApiAuth';
     }
     if (waRequest::isMobile()) {
         $this->template .= 'Mobile';
     }
     return parent::getTemplate();
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:10,代码来源:webasystApiAuth.action.php

示例5: afterAuth

 protected function afterAuth()
 {
     $this->getStorage()->remove('auth_login');
     $redirect = $this->getConfig()->getCurrentUrl();
     $backend_url = $this->getConfig()->getBackendUrl(true);
     if (waRequest::isMobile()) {
         $this->redirect(array('url' => $backend_url));
     }
     if (!$redirect || $redirect === $backend_url) {
         $redirect = $this->getUser()->getLastPage();
     }
     if (!$redirect || substr($redirect, 0, strlen($backend_url) + 1) == $backend_url . '?') {
         $redirect = $backend_url;
     }
     $this->redirect(array('url' => $redirect));
 }
开发者ID:navi8602,项目名称:wa-shop-ppg,代码行数:16,代码来源:webasystLogin.action.php

示例6: execute

 public function execute()
 {
     if (waRequest::isMobile()) {
         $this->executeAction(new shopOrdersMobileAction());
     } else {
         if (wa()->getUser()->getRights('shop', 'orders')) {
             $this->executeAction(new shopBackendOrdersAction());
         } elseif ($this->getUser()->isAdmin('shop') || wa()->getUser()->getRights('shop', 'type.%')) {
             $this->executeAction(new shopBackendProductsAction());
         } elseif ($this->getRights('pages') || $this->getRights('design')) {
             $this->executeAction(new shopBackendStorefrontsAction());
         } elseif ($this->getRights('reports')) {
             $this->executeAction(new shopBackendReportsAction());
         } elseif (wa()->getUser()->getRights('shop', 'settings')) {
             $this->executeAction(new shopBackendSettingsAction());
         } else {
             $this->setLayout(new shopBackendLayout());
         }
     }
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:20,代码来源:shopBackend.controller.php

示例7: userAgent

 public function userAgent($type = null)
 {
     $user_agent = waRequest::server('HTTP_USER_AGENT');
     if (!$type) {
         return $user_agent;
     } elseif ($type == 'isMobile') {
         return waRequest::isMobile(false);
     } elseif ($type == 'platform' || $type == 'os') {
         $patterns = array('android' => 'android', 'blackberry' => 'blackberry', 'linux' => 'Linux', 'ios' => '(ipad|iphone|ipod)', 'mac' => '(Macintosh|Mac\\sOS)', 'windows' => 'Windows');
     } elseif ($type == 'device') {
         $patterns = array('ipad' => 'ipad', 'ipod' => 'ipod', 'iphone' => 'iphone', 'android' => 'android');
     }
     foreach ($patterns as $id => $pattern) {
         if (preg_match('/' . $pattern . '/i', $user_agent)) {
             return $id;
         }
     }
     return '';
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:19,代码来源:waViewHelper.class.php


注:本文中的waRequest::isMobile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。