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


PHP func::isAjaxRequest方法代码示例

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


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

示例1: init

 /**
  * @return bffBase object
  */
 function init($isFrontend = true)
 {
     global $oDb, $oSm, $oSecurity;
     self::$isFrontend = $isFrontend;
     self::$isAjax = func::isAjaxRequest();
     self::$isPost = func::isPostMethod();
     if ($isFrontend) {
         define('TPL_PATH', PATH_BASE . 'tpl/main/');
         $oSm->template_dir = TPL_PATH;
     } else {
         define('TPL_PATH', PATH_BASE . 'tpl/main/admin/');
         define('THEME_URL', SITEURL . '/styles/default');
         //default admin theme!
         $oSm->template_dir = TPL_PATH;
     }
     spl_autoload_register(array('bffBase', 'autoload'));
     $oSecurity->checkExpired();
     if (!defined('THEME_URL')) {
         define('THEME_URL', SITEURL . '/styles/' . THEMES_DEFAULTTHEME_KEY);
     }
     $oSm->assign('theme_url', THEME_URL);
     $oSm->assign('class', self::$class = substr(strtolower(func::GETPOST('s')), 0, 30));
     $oSm->assign('event', self::$event = substr(strtolower(func::GETPOST('ev')), 0, 30));
     $oSm->assign_by_ref('tplJSIncludes', self::$includesJS);
     $oSm->assign_by_ref('tplCSSIncludes', self::$includesCSS);
     bff::initApp($isFrontend);
     return $this;
 }
开发者ID:Sywooch,项目名称:dobox,代码行数:31,代码来源:bff.base.php

示例2: user_ajax

 function user_ajax()
 {
     if (!($nRecordID = $this->input->id('rec', 'gp'))) {
         $this->ajaxResponse(Errors::IMPOSSIBLE);
     }
     if (func::isAjaxRequest(null)) {
         switch (Func::GETPOST('action')) {
             case 'avatar-delete':
                 if (!$this->haveAccessTo('users-edit')) {
                     $this->ajaxResponse(Errors::ACCESSDENIED);
                 }
                 $avatar = new CAvatar(TABLE_USERS, USERS_AVATAR_PATH, 'avatar', 'user_id');
                 $avatar->delete($nRecordID, true);
                 $this->ajaxResponse(Errors::SUCCESSFULL);
                 break;
             case 'user-info':
                 $aData = $this->db->one_array('SELECT U.*, C.title as city, R.region_id, R.title as region 
                                                 FROM ' . TABLE_USERS . ' U
                                                 LEFT JOIN ' . TABLE_CITY . ' C   ON U.city_id=C.city_id
                                                 LEFT JOIN ' . TABLE_REGION . ' R ON C.region_id=R.region_id
                                                WHERE U.user_id=' . $nRecordID . ' LIMIT 1');
                 $aData['tuid'] = $this->makeTUID($nRecordID);
                 $aData['sendmsg'] = 0;
                 //($this->security->isAdmin() || $aData['im_noreply'] == 0);
                 $this->tplAssignByRef('aData', $aData);
                 $this->adminCustomCenterArea();
                 $this->tplDisplay('admin.user.info.tpl');
                 exit;
                 break;
             case 'user-block':
                 if (!$this->haveAccessTo('users-edit') || $this->security->isCurrentUser($nRecordID)) {
                     $this->ajaxResponse(Errors::ACCESSDENIED);
                 }
                 $sReason = mb_strcut(Func::POSTGET('blocked_reason', true), 0, 300);
                 $nBlocked = Func::POSTGET('blocked') ? 1 : 0;
                 $this->db->execute('UPDATE ' . TABLE_USERS . ' 
                                SET blocked_reason = ' . $this->db->str2sql($sReason) . ',
                                    blocked = ' . $nBlocked . '
                                WHERE user_id = ' . $nRecordID);
                 $this->ajaxResponse(Errors::SUCCESSFULL);
                 break;
         }
     }
     $this->ajaxResponse(Errors::IMPOSSIBLE);
 }
开发者ID:Sywooch,项目名称:dobox,代码行数:45,代码来源:users.adm.class.php


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