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


PHP BxDolRequest类代码示例

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


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

示例1: getBlockCode_ActionList

 function getBlockCode_ActionList()
 {
     $sCode = null;
     $sMainPrefix = $this->oConfig->getMainPrefix();
     bx_import('BxDolSubscription');
     $oSubscription = BxDolSubscription::getInstance();
     $aButton = $oSubscription->getButton($this->iProfileId, $sMainPrefix, '', (int) $this->aFileInfo['medID']);
     $sCode .= $oSubscription->getData();
     $aReplacement = array('favorited' => $this->aFileInfo['favorited'] == false ? '' : 'favorited', 'featured' => (int) $this->aFileInfo['Featured'], 'featuredCpt' => '', 'approvedCpt' => '', 'approvedAct' => '', 'moduleUrl' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri(), 'fileUri' => $this->aFileInfo['medUri'], 'iViewer' => $this->iProfileId, 'ID' => (int) $this->aFileInfo['medID'], 'Owner' => (int) $this->aFileInfo['medProfId'], 'OwnerName' => $this->aFileInfo['NickName'], 'AlbumUri' => $this->aFileInfo['albumUri'], 'sbs_' . $sMainPrefix . '_title' => $aButton['title'], 'sbs_' . $sMainPrefix . '_script' => $aButton['script'], 'shareCpt' => $this->oModule->isAllowedShare($this->aFileInfo) ? _t('_Share') : '', 'downloadCpt' => $this->oModule->isAllowedDownload($this->aFileInfo) ? _t('_Download') : '');
     if (isAdmin($this->iProfileId)) {
         $sMsg = $aReplacement['featured'] > 0 ? 'un' : '';
         $aReplacement['featuredCpt'] = _t('_' . $sMainPrefix . '_action_' . $sMsg . 'feature');
     }
     if ($this->oModule->isAllowedApprove($this->aFileInfo)) {
         $sMsg = '';
         $iAppr = 1;
         if ($this->aFileInfo['Approved'] == 'approved') {
             $sMsg = 'de';
             $iAppr = 0;
         }
         $aReplacement['approvedCpt'] = _t('_' . $sMainPrefix . '_admin_' . $sMsg . 'activate');
         $aReplacement['approvedAct'] = $iAppr;
     }
     $aReplacement['repostCpt'] = $aReplacement['repostScript'] = '';
     if (BxDolRequest::serviceExists('wall', 'get_repost_js_click')) {
         $sCode .= BxDolService::call('wall', 'get_repost_js_script');
         $aReplacement['repostCpt'] = _t('_Repost');
         $aReplacement['repostScript'] = BxDolService::call('wall', 'get_repost_js_click', array($this->iProfileId, $sMainPrefix, 'add', (int) $this->aFileInfo['medID']));
     }
     $sActionsList = $GLOBALS['oFunctions']->genObjectsActions($aReplacement, $sMainPrefix);
     if (is_null($sActionsList)) {
         return '';
     }
     return $sCode . $sActionsList;
 }
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:35,代码来源:BxSoundsPageView.php

示例2: uninstall

 function uninstall($aParams)
 {
     if (BxDolRequest::serviceExists('wall', 'update_handlers')) {
         BxDolService::call('wall', 'update_handlers', array($this->_aConfig['home_uri'], false));
     }
     return parent::uninstall($aParams);
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:7,代码来源:installer.php

示例3: service

 function service($aToken)
 {
     if (!isAdmin($aToken['user_id'])) {
         $this->errorOutput(403, 'access_denied', 'Only admin can access service endpoint');
         return false;
     }
     bx_login($aToken['user_id'], false, false);
     $sUri = bx_get('uri');
     $sMethod = bx_get('method');
     if (!($aParams = bx_get('params'))) {
         $aParams = array();
     } elseif (is_string($aParams) && preg_match('/^a:[\\d+]:\\{/', $aParams)) {
         $aParams = @unserialize($aParams);
     }
     if (!is_array($aParams)) {
         $aParams = array($aParams);
     }
     if (!($sClass = bx_get('class'))) {
         $sClass = 'Module';
     }
     if (!BxDolRequest::serviceExists($sUri, $sMethod, $sClass)) {
         $this->errorOutput(404, 'not_found', 'Service was not found');
         return false;
     }
     $mixedRet = BxDolService::call($sUri, $sMethod, $aParams, $sClass);
     $this->output(array('uri' => $sUri, 'method' => $sMethod, 'data' => $mixedRet));
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:27,代码来源:BxOAuthAPI.php

示例4: response

 /**
  * Overwtire the method of parent class.
  *
  * @param BxDolAlerts $oAlert an instance of alert.
  */
 function response($oAlert)
 {
     $sKey = $oAlert->sUnit . '_' . $oAlert->sAction;
     $iCommentId = 0;
     switch ($oAlert->sAction) {
         case 'delete':
         case 'delete_poll':
         case 'delete_post':
             $this->_oModule->_oDb->deleteActivityByObject($oAlert->sUnit, $oAlert->iObject);
             return;
         case 'commentPost':
             if (!isset($oAlert->aExtras['comment_id']) || (int) $oAlert->aExtras['comment_id'] == 0) {
                 return;
             }
             $iCommentId = (int) $oAlert->aExtras['comment_id'];
             break;
         case 'commentRemoved':
             if (!isset($oAlert->aExtras['comment_id']) || (int) $oAlert->aExtras['comment_id'] == 0) {
                 return;
             }
             $this->_oModule->_oDb->deleteActivityByObject($oAlert->sUnit, $oAlert->iObject, (int) $oAlert->aExtras['comment_id']);
             return;
     }
     // call defined method;
     if (!is_array($this->aInternalHandlers) || !array_key_exists($sKey, $this->aInternalHandlers)) {
         return;
     }
     if (!BxDolRequest::serviceExists($this->aInternalHandlers[$sKey]['module_uri'], $this->aInternalHandlers[$sKey]['module_method'])) {
         return;
     }
     // define functions parameters;
     $aParams = array('action' => $oAlert->sAction, 'object_id' => $oAlert->iObject, 'sender_id' => $oAlert->iSender, 'extra_params' => $oAlert->aExtras);
     $aResult = BxDolService::call($this->aInternalHandlers[$sKey]['module_uri'], $this->aInternalHandlers[$sKey]['module_method'], $aParams);
     if (empty($aResult)) {
         return;
     }
     // create new event;
     // define recipent id;
     $iRecipientId = isset($aResult['recipient_id']) ? $aResult['recipient_id'] : $oAlert->iObject;
     if (isset($aResult['spy_type']) && $aResult['spy_type'] == 'content_activity' && $iRecipientId == $oAlert->iSender) {
         $iRecipientId = 0;
     }
     $iEventId = 0;
     if ($oAlert->iSender || !$oAlert->iSender && $this->_oModule->_oConfig->bTrackGuestsActivites) {
         $iEventId = $this->_oModule->_oDb->createActivity($oAlert->sUnit, $oAlert->sAction, $oAlert->iObject, $iCommentId, $oAlert->iSender, $iRecipientId, $aResult);
     }
     if (!$iEventId) {
         return;
     }
     // try to define all profile's friends;
     $aFriends = getMyFriendsEx($oAlert->iSender);
     if (empty($aFriends) || !is_array($aFriends)) {
         return;
     }
     // attach event to friends;
     foreach ($aFriends as $iFriendId => $aItems) {
         $this->_oModule->_oDb->attachFriendEvent($iEventId, $oAlert->iSender, $iFriendId);
     }
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:64,代码来源:BxSpyResponseContent.php

示例5: processAsAction

 public static function processAsAction($aModule, &$aRequest, $sClass = "Module")
 {
     $sClassRequire = $aModule['class_prefix'] . $sClass;
     $oModule = BxDolRequest::_require($aModule, $sClassRequire);
     $aVars = array('BaseUri' => $oModule->_oConfig->getBaseUri());
     $GLOBALS['oTopMenu']->setCustomSubActions($aVars, 'bx_store_title', false);
     return BxDolRequest::processAsAction($aModule, $aRequest, $sClass);
 }
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:8,代码来源:request.php

示例6: uninstall

 function uninstall($aParams)
 {
     if (BxDolRequest::serviceExists('spy', 'update_handlers')) {
         BxDolService::call('spy', 'update_handlers', array($this->_aConfig['home_uri'], false));
     }
     $this->updateEmailTemplatesExceptions();
     return parent::uninstall($aParams);
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:8,代码来源:installer.php

示例7: uninstall

 function uninstall($aParams)
 {
     if (BxDolRequest::serviceExists('payment', 'update_dependent_modules')) {
         BxDolService::call('payment', 'update_dependent_modules', array($this->_aConfig['home_uri'], false));
     }
     if (BxDolRequest::serviceExists('payflow', 'update_dependent_modules')) {
         BxDolService::call('payflow', 'update_dependent_modules', array($this->_aConfig['home_uri'], false));
     }
     return parent::uninstall($aParams);
 }
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:10,代码来源:installer.php

示例8: call

 public static function call($mixed, $sMethod, $aParams = array(), $sClass = 'Module')
 {
     $oDb = new BxDolModuleDb();
     if (is_string($mixed)) {
         $aModule = $oDb->getModuleByUri($mixed);
     } else {
         $aModule = $oDb->getModuleById($mixed);
     }
     return empty($aModule) ? '' : BxDolRequest::processAsService($aModule, $sMethod, $aParams, $sClass);
 }
开发者ID:Prashank25,项目名称:dolphin.pro,代码行数:10,代码来源:BxDolService.php

示例9: call

 /**
  * Perform serice call
  * @param $mixed module name or module id
  * @param $sMethod service method name in format 'method_name', corresponding class metod is serviceMethodName
  * @param $aParams params to pass to service method
  * @param $sClass class to search for service method, by default it is main module class
  * @return service call result
  */
 public static function call($mixed, $sMethod, $aParams = array(), $sClass = 'Module')
 {
     bx_import('BxDolModuleQuery');
     $oDb = BxDolModuleQuery::getInstance();
     $aModule = array();
     if (is_string($mixed)) {
         $aModule = $oDb->getModuleByName($mixed);
     } else {
         $aModule = $oDb->getModuleById($mixed);
     }
     return empty($aModule) ? '' : BxDolRequest::processAsService($aModule, $sMethod, $aParams, $sClass);
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:20,代码来源:BxDolService.php

示例10: uninstall

 function uninstall($aParams)
 {
     if (BxDolRequest::serviceExists('wall', 'update_handlers')) {
         BxDolService::call('wall', 'update_handlers', array($this->_aConfig['home_uri'], false));
     }
     if (BxDolRequest::serviceExists('spy', 'update_handlers')) {
         BxDolService::call('spy', 'update_handlers', array($this->_aConfig['home_uri'], false));
     }
     $aResult = parent::uninstall($aParams);
     if ($aResult['result'] && BxDolModule::getInstance('BxWmapModule')) {
         BxDolService::call('wmap', 'part_uninstall', array('ads'));
     }
     return $aResult;
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:14,代码来源:installer.php

示例11: getBlockCode_ViewActions

    function getBlockCode_ViewActions()
    {
        global $oFunctions;
        if ($this->_oSites->iOwnerId || $this->_oSites->isAdmin()) {
            $sCode = '';
            $aInfo = array('iViewer' => $this->_oSites->iOwnerId, 'ownerID' => (int) $this->_aSite['ownerid'], 'ID' => (int) $this->_aSite['id'], 'TitleEdit' => $this->_oSites->isAllowedEdit($this->_aSite) ? _t('_bx_sites_action_title_edit') : '', 'TitleDelete' => $this->_oSites->isAllowedDelete($this->_aSite) ? _t('_bx_sites_action_title_delete') : '', 'TitleShare' => $this->_oSites->isAllowedShare($this->_aSite) ? _t('_Share') : '', 'AddToFeatured' => $this->_oSites->isAllowedMarkAsFeatured($this->_aSite) && (int) $this->_aSite['allowView'] == BX_DOL_PG_ALL ? (int) $this->_aSite['featured'] == 1 ? _t('_bx_sites_action_remove_from_featured') : _t('_bx_sites_action_add_to_featured') : '');
            $oSubscription = BxDolSubscription::getInstance();
            $aButton = $oSubscription->getButton($this->_oSites->iOwnerId, 'bx_sites', '', $this->_aSite['id']);
            $sCode .= $oSubscription->getData();
            $aInfo['sbs_sites_title'] = $aButton['title'];
            $aInfo['sbs_sites_script'] = $aButton['script'];
            if (!$aInfo['TitleEdit'] && !$aInfo['TitleDelete'] && !$aInfo['TitleShare'] && !$aInfo['AddToFeatured'] && !$aInfo['sbs_sites_title']) {
                return '';
            }
            if ($aInfo['TitleShare']) {
                $sUrlSharePopup = BX_DOL_URL_ROOT . $this->_oSites->_oConfig->getBaseUri() . "share_popup/" . $this->_aSite['id'];
                $sCode .= <<<EOF
                    <script type="text/javascript">
                    function bx_site_show_share_popup ()
                    {
                        if (!\$('#bx_sites_share_popup').length) {
                            \$('<div id="bx_sites_share_popup" style="display: none;"></div>').prependTo('body');
                        }

                        \$('#bx_sites_share_popup').load(
                            '{$sUrlSharePopup}',
                            function() {
                                \$(this).dolPopup();
                            }
                        );
                    }
                    </script>
EOF;
            }
            $aInfo['repostCpt'] = $aInfo['repostScript'] = '';
            if (BxDolRequest::serviceExists('wall', 'get_repost_js_click')) {
                $sCode .= BxDolService::call('wall', 'get_repost_js_script');
                $aInfo['repostCpt'] = _t('_Repost');
                $aInfo['repostScript'] = BxDolService::call('wall', 'get_repost_js_click', array($this->_oSites->iOwnerId, 'bx_sites', 'add', (int) $this->_aSite['id']));
            }
            $aCodeActions = $oFunctions->genObjectsActions($aInfo, 'bx_sites');
            if (empty($aCodeActions)) {
                return '';
            }
            return $sCode . $aCodeActions;
        }
        return '';
    }
开发者ID:boonex,项目名称:dolphin.pro,代码行数:48,代码来源:BxSitesPageView.php

示例12: getSearchResultsNearMe

 function getSearchResultsNearMe($sUser, $sPwd, $sLang, $sLat, $sLng, $isOnlineOnly, $isWithPhotosOnly, $iStart, $iPP)
 {
     if (!($iId = BxDolXMLRPCUtil::checkLogin($sUser, $sPwd))) {
         return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1, "int")), "struct"));
     }
     BxDolXMLRPCUtil::setLanguage($sLang);
     $sLat = (double) $sLat;
     $sLng = (double) $sLng;
     if ((!$sLat || !$sLng) && BxDolRequest::serviceExists('wmap', 'get_location')) {
         $aLocation = BxDolService::call('wmap', 'get_location', array('profiles', $iId, $iId));
         if ($aLocation && !empty($aLocation['lat']) && !empty($aLocation['lng'])) {
             $sLat = $aLocation['lat'];
             $sLng = $aLocation['lng'];
         }
     }
     if (!$sLat || !$sLng) {
         return new xmlrpcval(array(), "array");
     }
     $sWhere = '';
     $sJoin = '';
     $sLocation = '';
     $sDistance = ", (POW({$sLat}-`loc`.`lat`, 2)+POW({$sLng}-`loc`.`lng`, 2)) AS `distance`";
     $sJoin .= " INNER JOIN `bx_wmap_locations` AS `loc` ON  (`loc`.`part` = 'profiles' AND `loc`.`id` = `Profiles`.`ID` AND `loc`.`failed` = 0) ";
     if ($isWithPhotosOnly) {
         $sWhere .= " AND `Avatar` ";
     }
     if ($isOnlineOnly) {
         $iOnlineTime = (int) getParam('member_online_time');
         $sWhere .= " AND `DateLastNav` >= DATE_SUB(NOW(), INTERVAL {$iOnlineTime} MINUTE)";
     }
     $iStart = (int) $iStart;
     if (!$iStart || $iStart < 0) {
         $iStart = 0;
     }
     $iPP = (int) $iPP;
     if (!$iPP || $iPP < 1) {
         $iPP = 1;
     }
     $r = db_res("\n            SELECT * " . $sDistance . " FROM `Profiles`\n            {$sJoin}\n            WHERE `Status` = 'Active' AND (`Profiles`.`Couple` = 0 OR `Profiles`.`Couple` > `Profiles`.`ID`) {$sWhere}\n            ORDER BY `distance` ASC\n            LIMIT {$iStart}, {$iPP}");
     while ($aRow = mysql_fetch_array($r)) {
         $aProfiles[] = new xmlrpcval(BxDolXMLRPCUtil::fillProfileArray($aRow, 'thumb'), 'struct');
     }
     return new xmlrpcval($aProfiles, "array");
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:44,代码来源:BxDolXMLRPCSearch.php

示例13: load

 function load()
 {
     $oCache = $GLOBALS['MySQL']->getDbCacheObject();
     $this->aTopMenu = $oCache->getData($GLOBALS['MySQL']->genDbCacheKey('sys_menu_top'));
     if (null === $this->aTopMenu) {
         if (!$this->compile()) {
             return false;
         }
         $this->aTopMenu = $oCache->getData($GLOBALS['MySQL']->genDbCacheKey('sys_menu_top'));
     }
     if (!$this->aTopMenu or !is_array($this->aTopMenu)) {
         echo '<b>Warning!</b> Cannot evaluate Menu Cache.';
         return false;
     }
     if (BxDolRequest::serviceExists('pageac', 'menu_items_filter')) {
         BxDolService::call('pageac', 'menu_items_filter', array('top', &$this->aTopMenu));
     }
     return true;
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:19,代码来源:BxDolMenu.php

示例14: saveChanges

 function saveChanges(&$oForm)
 {
     $aCategories = explode(',', $oForm->getCleanValue('categories'));
     foreach ($aCategories as $sCategory) {
         $aOptions = array();
         $iOptions = $this->oDb->getOptions(array('type' => 'by_category_name_full', 'value' => $sCategory), $aOptions);
         $aData = array();
         foreach ($aOptions as $aOption) {
             $aData[$aOption['name']] = $oForm->getCleanValue($aOption['name']);
             if (!empty($aOption['check'])) {
                 $sCheckerHelper = '';
                 if (!empty($aOption['type_name']) && BxDolRequest::serviceExists($aOption['type_name'], 'get_settings_checker_helper')) {
                     $sCheckerHelper = BxDolService::call($aOption['type_name'], 'get_settings_checker_helper');
                 }
                 if ($sCheckerHelper == '') {
                     bx_import('BxDolStudioForm');
                     $sCheckerHelper = 'BxDolStudioFormCheckerHelper';
                 }
                 $oChecker = new $sCheckerHelper();
                 $aCheckFunction = array($oChecker, 'check' . bx_gen_method_name($aOption['check']));
                 $aCheckFunctionParams = array($aData[$aOption['name']]);
                 if (!empty($aOption['check_params'])) {
                     $aCheckFunctionParams = array_merge($aCheckFunctionParams, unserialize($aOption['check_params']));
                 }
                 if (is_callable($aCheckFunction) && !call_user_func_array($aCheckFunction, $aCheckFunctionParams)) {
                     $this->sCategory = $sCategory;
                     return $this->getJsResult(_t('_adm_stg_err_save_error_message', _t($aOption['caption']), _t($aOption['check_error'])), false);
                 }
             }
             if (isset($aData[$aOption['name']])) {
                 $aData[$aOption['name']] = $this->getProcessedValue($aOption, $aData[$aOption['name']]);
             } else {
                 $aData[$aOption['name']] = $this->getEmptyValue($aOption);
             }
             if ($this->oDb->setParam($aOption['name'], $aData[$aOption['name']])) {
                 $aCategoryInfo = array();
                 $this->oDb->getCategories(array('type' => 'by_name', 'value' => $sCategory), $aCategoryInfo, false);
                 bx_alert('system', 'save_setting', 0, 0, array('category' => $aCategoryInfo, 'option' => $aOption['name'], 'value' => $aData[$aOption['name']]));
             }
         }
     }
     return $this->getJsResult('_adm_stg_scs_save');
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:43,代码来源:BxDolStudioSettings.php

示例15: uninstall

 function uninstall($aParams)
 {
     if (BxDolRequest::serviceExists('wall', 'update_handlers')) {
         BxDolService::call('wall', 'update_handlers', array($this->_aConfig['home_uri'], false));
     }
     $aResult = parent::uninstall($aParams);
     if ($aResult['result']) {
         foreach ($this->_aConfig['install_permissions']['writable'] as $sDir) {
             $sPath = BX_DIRECTORY_PATH_MODULES . $this->_aConfig['home_dir'] . $sDir;
             if (is_dir($sPath)) {
                 bx_clear_folder($sPath);
             }
         }
         bx_import('BxDolCacheUtilities');
         $oCacheUtilities = new BxDolCacheUtilities();
         $oCacheUtilities->clear('users');
     }
     return $aResult;
 }
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:19,代码来源:installer.php


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