本文整理汇总了PHP中bx_append_url_params函数的典型用法代码示例。如果您正苦于以下问题:PHP bx_append_url_params函数的具体用法?PHP bx_append_url_params怎么用?PHP bx_append_url_params使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bx_append_url_params函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initializeCheckout
function initializeCheckout($iPendingId, $aCartInfo, $bRecurring = false, $iRecurringDays = 0)
{
$this->aBpOptions['redirectURL'] .= $aCartInfo['vendor_id'];
$this->aBpOptions['notificationURL'] .= $aCartInfo['vendor_id'];
$this->aBpOptions['notificationURL'] = bx_append_url_params($this->aBpOptions['notificationURL'], array('bxssl' => 1));
switch ($aCartInfo['vendor_currency_code']) {
case 'USD':
case 'EUR':
case 'CAD':
case 'AUD':
case 'GBP':
case 'MXN':
case 'NZD':
case 'ZAR':
case 'BTC':
$this->aBpOptions['currency'] = $aCartInfo['vendor_currency_code'];
}
$aPosData = array('vnd' => (string) $aCartInfo['vendor_id'], 'clt' => (string) $aCartInfo['client_id'], 'pnd' => (string) $iPendingId);
$aOptions = array('itemDesc' => 'Payment to ' . $aCartInfo['vendor_profile_name']);
$aResponse = $this->createInvoice($iPendingId, (double) $aCartInfo['items_price'], $aPosData, $aOptions);
if (!empty($aResponse['error'])) {
return _t(is_array($aResponse['error']) ? $aResponse['error']['message'] : $aResponse['error']);
}
header('Location: ' . $aResponse['url']);
exit;
}
示例2: genRowImageUploader
function genRowImageUploader(&$aInput)
{
$aTmplVarsPreview = array('bx_if:show_empty' => array('condition' => true, 'content' => array()), 'bx_if:show_image' => array('condition' => false, 'content' => array()));
if (($iId = (int) $aInput['value']) != 0) {
$sFileUrl = false;
if (!empty($aInput['transcoder_object'])) {
$oTranscoder = BxDolTranscoderImage::getObjectInstance($aInput['transcoder_object']);
$sFileUrl = $oTranscoder->getFileUrlNotReady($iId);
if (isset($aInput['transcoder_image_width']) && $aInput['transcoder_image_width'] > 0) {
$sFileUrl = bx_append_url_params($sFileUrl, array('x' => $aInput['transcoder_image_width']));
}
if (isset($aInput['transcoder_image_height']) && $aInput['transcoder_image_height'] > 0) {
$sFileUrl = bx_append_url_params($sFileUrl, array('y' => $aInput['transcoder_image_height']));
}
} else {
$sStorage = isset($aInput['storage_object']) && $aInput['storage_object'] != '' ? $aInput['storage_object'] : BX_DOL_STORAGE_OBJ_IMAGES;
$oStorage = BxDolStorage::getObjectInstance($sStorage);
$sFileUrl = $oStorage->getFileUrlById($iId);
}
if ($sFileUrl !== false) {
$aTmplVarsPreview['bx_if:show_empty']['condition'] = false;
$aTmplVarsPreview['bx_if:show_image'] = array('condition' => true, 'content' => array('url' => $sFileUrl, 'bx_if:show_action_delete' => array('condition' => isset($aInput['ajax_action_delete']) && $aInput['ajax_action_delete'] != "", 'content' => array('action' => $aInput['ajax_action_delete']))));
}
}
$sRow = '';
$aInputPreview = array('type' => 'custom', 'name' => 'preview', 'caption' => isset($aInput['caption_preview']) ? $aInput['caption_preview'] : _t('_adm_txt_form_view_iu_preview'), 'content' => $this->oTemplate->parseHtmlByName('form_view_iu_preview.html', $aTmplVarsPreview));
$sRow .= $this->genRow($aInputPreview);
$aInput['type'] = 'file';
$sRow .= $this->genRow($aInput);
return $sRow;
}
示例3: getMonthUrl
function getMonthUrl($isNextMoths, $isMiniMode = false)
{
if ($isMiniMode && $this->iBlockID && $this->sDynamicUrl) {
return "javascript:loadDynamicBlock('" . $this->iBlockID . "', '" . bx_append_url_params($this->sDynamicUrl, 'date=' . ($isNextMoths ? "{$this->iNextYear}/{$this->iNextMonth}" : "{$this->iPrevYear}/{$this->iPrevMonth}")) . "');";
} else {
return parent::getMonthUrl($isNextMoths, $isMiniMode);
}
}
示例4: getFileUrlById
/**
* Get file url.
* @param $iFileId file
* @return file url or false if file was not found
*/
public function getFileUrlById($iFileId)
{
$aFile = $this->_oDb->getFileById($iFileId);
if (!$aFile) {
return false;
}
$sUrl = $this->getObjectBaseUrl($aFile['private']) . $aFile['remote_id'] . '.' . $aFile['ext'];
if ($aFile['private']) {
$sToken = $this->_oDb->genToken($iFileId);
$sUrl = bx_append_url_params($sUrl, array('t' => $sToken));
}
return $sUrl;
}
示例5: initializeCheckout
function initializeCheckout($iPendingId, $aCartInfo)
{
$this->_setExpressCheckout($iPendingId, $aCartInfo);
$aResponse = $this->_executeCall();
if ($aResponse === false) {
return false;
}
$this->_logInfo(__METHOD__, $aResponse);
$sToken = process_db_input($aResponse['TOKEN'], BX_TAGS_STRIP);
$sRedirectUrl = $this->_oConfig->getPpEndpoint(BX_PFW_ENDPOINT_TYPE_HOSTED);
$sRedirectUrl = bx_append_url_params($sRedirectUrl, array('cmd' => '_express-checkout', 'token' => $sToken));
header("Location: " . $sRedirectUrl);
exit;
}
示例6: actionStart
/**
* Redirect to remote Dolphin site login form
*
* @return n/a/ - redirect or HTML page in case of error
*/
function actionStart()
{
if (isLogged()) {
$this->_redirect($this->_oConfig->sDefaultRedirectUrl);
}
if (!$this->_oConfig->sApiID || !$this->_oConfig->sApiSecret || !$this->_oConfig->sApiUrl) {
$sCode = MsgBox(_t('_bx_dolphcon_profile_error_api_keys'));
$this->_oTemplate->getPage(_t('_bx_dolphcon'), $sCode);
} else {
// define redirect URL to the remote Dolphin site
$sUrl = bx_append_url_params($this->_oConfig->sApiUrl . 'auth', array('response_type' => 'code', 'client_id' => $this->_oConfig->sApiID, 'redirect_uri' => $this->_oConfig->sPageHandle, 'scope' => $this->_oConfig->sScope, 'state' => $this->_genCsrfToken()));
$this->_redirect($sUrl);
}
}
示例7: loadData
protected function loadData()
{
$this->setSelected('', $this->_oTemplate->getCode());
$aPage = explode('?', $_SERVER['HTTP_REFERER']);
$aPageParams = array();
if (!empty($aPage[1])) {
parse_str($aPage[1], $aPageParams);
}
$aTemplates = get_templates_array(true, true);
$aItems = array();
foreach ($aTemplates as $sName => $sTemplate) {
$aPageParams['skin'] = $sName;
$aItems[] = array('id' => $sName, 'name' => $sName, 'class' => '', 'title' => $sTemplate, 'target' => '_self', 'icon' => '', 'link' => bx_html_attribute(bx_append_url_params($aPage[0], $aPageParams)), 'onclick' => '');
}
$this->_aObject['menu_items'] = $aItems;
}
示例8: getAccessToken
protected function getAccessToken($sToken, $mixedSecret, $sVerifier, $iUser, $oConsumer)
{
$oConsumer->setToken($sToken, $mixedSecret);
$aAccessToken = $oConsumer->getAccessToken(bx_append_url_params(BX_DOL_OAUTH_URL_ACCESS_TOKEN, array('oauth_verifier' => $sVerifier)));
if (empty($aAccessToken)) {
return _t('_adm_err_oauth_cannot_get_token');
}
if ($this->isServerError($aAccessToken)) {
throw new OAuthException();
}
$this->oSession->setValue('sys_oauth_token', $aAccessToken['oauth_token']);
$this->oSession->setValue('sys_oauth_secret', $aAccessToken['oauth_token_secret']);
$this->oSession->setValue('sys_oauth_authorized', 1);
$this->oSession->setValue('sys_oauth_authorized_user', $iUser);
return true;
}
示例9: actionStart
/**
* Redirect to remote Trident site login form
*
* @return n/a/ - redirect or HTML page in case of error
*/
function actionStart()
{
if (isLogged()) {
$this->_redirect($this->_oConfig->sDefaultRedirectUrl);
}
if (!$this->_oConfig->sApiID || !$this->_oConfig->sApiSecret || !$this->_oConfig->sApiUrl) {
require_once BX_DIRECTORY_PATH_INC . 'design.inc.php';
bx_import('BxDolLanguages');
$sCode = MsgBox(_t('_bx_tricon_profile_error_api_keys'));
$this->_oTemplate->getPage(_t('_bx_tricon'), $sCode);
} else {
// define redirect URL to the remote Trident site
$sUrl = bx_append_url_params($this->_oConfig->sApiUrl . 'auth', array('response_type' => 'code', 'client_id' => $this->_oConfig->sApiID, 'redirect_uri' => $this->_oConfig->sPageHandle, 'scope' => $this->_oConfig->sScope, 'state' => $this->_genCsrfToken()));
$this->_redirect($sUrl);
}
}
示例10: authorize
protected function authorize($sKey, $sSecret)
{
if ($this->isAuthorized()) {
return true;
}
try {
$oConsumer = new OAuth($sKey, $sSecret);
$oConsumer->setAuthType(OAUTH_AUTH_TYPE_URI);
$oConsumer->enableDebug();
$bToken = bx_get('oauth_token') !== false;
$mixedSecret = $this->oSession->getValue('sys_oauth_secret');
if (!$bToken && $mixedSecret !== false) {
$this->oSession->unsetValue('sys_oauth_secret');
$mixedSecret = false;
}
//--- Get request token and redirect to authorize.
if (!$bToken && $mixedSecret === false) {
$aRequestToken = $oConsumer->getRequestToken(BX_DOL_OAUTH_URL_REQUEST_TOKEN);
if (empty($aRequestToken)) {
return _t('_adm_err_oauth_cannot_get_token');
}
if ($this->isServerError($aRequestToken)) {
return $this->processServerError($aRequestToken);
}
$this->oSession->setValue('sys_oauth_secret', $aRequestToken['oauth_token_secret']);
return _t('_adm_msg_oauth_need_authorize', bx_append_url_params(BX_DOL_OAUTH_URL_AUTHORIZE, array('oauth_token' => $aRequestToken['oauth_token'], 'sid' => bx_site_hash())));
}
//--- Get access token.
if ($bToken && $mixedSecret !== false) {
$oConsumer->setToken(bx_get('oauth_token'), $mixedSecret);
$aAccessToken = $oConsumer->getAccessToken(bx_append_url_params(BX_DOL_OAUTH_URL_ACCESS_TOKEN, array('oauth_verifier' => bx_get('oauth_verifier'))));
if (empty($aAccessToken)) {
return _t('_adm_err_oauth_cannot_get_token');
}
if ($this->isServerError($aAccessToken)) {
return $this->processServerError($aAccessToken);
}
$this->oSession->setValue('sys_oauth_token', $aAccessToken['oauth_token']);
$this->oSession->setValue('sys_oauth_secret', $aAccessToken['oauth_token_secret']);
$this->oSession->setValue('sys_oauth_authorized', 1);
$this->oSession->setValue('sys_oauth_authorized_user', (int) bx_get('oauth_user'));
return true;
}
} catch (OAuthException $e) {
return _t('_adm_err_oauth_cannot_get_token');
}
}
示例11: loadData
protected function loadData()
{
$sLanguage = BxDolLanguages::getInstance()->getCurrentLangName();
$this->setSelected('', $sLanguage);
$aPage = explode('?', $_SERVER['HTTP_REFERER']);
$aPageParams = array();
if (!empty($aPage[1])) {
parse_str($aPage[1], $aPageParams);
}
$aLanguages = BxDolLanguagesQuery::getInstance()->getLanguages(false, true);
$aItems = array();
foreach ($aLanguages as $sName => $sLang) {
$aPageParams['lang'] = $sName;
$aItems[] = array('id' => $sName, 'name' => $sName, 'class' => '', 'title' => genFlag($sName) . ' ' . $sLang, 'target' => '_self', 'icon' => '', 'link' => bx_html_attribute(bx_append_url_params($aPage[0], $aPageParams)), 'onclick' => '');
}
$this->_aObject['menu_items'] = $aItems;
}
示例12: __construct
public function __construct($aObject, $oTemplate = false)
{
$this->MODULE = 'bx_convos';
parent::__construct($aObject, $oTemplate);
$CNF =& $this->_oModule->_oConfig->CNF;
$this->_oModule->_oDb->updateReadComments(bx_get_logged_profile_id(), $this->_aContentInfo[$CNF['FIELD_ID']], $this->_aContentInfo[$CNF['FIELD_COMMENTS']]);
$iFolder = $this->_oModule->_oDb->getConversationFolder($this->_aContentInfo[$CNF['FIELD_ID']], bx_get_logged_profile_id());
if (BX_CNV_FOLDER_DRAFTS == $iFolder) {
// if draft is opened - redirect to compose page
$sUrl = BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_ADD_ENTRY']);
$sUrl = bx_append_url_params($sUrl, array('draft_id' => $this->_aContentInfo[$CNF['FIELD_ID']]));
header('Location: ' . BX_DOL_URL_ROOT . $sUrl);
exit;
}
//$this->_oModule->setModuleSubmenu ($iFolder);
$this->_oModule->_oTemplate->addJs('main.js');
$this->_oModule->_oTemplate->addCss(array('main-media-tablet.css', 'main-media-desktop.css'));
}
示例13: authorize
protected function authorize($sKey, $sSecret)
{
if ($this->isAuthorized()) {
return true;
}
try {
$oService = $this->getServiceObject();
$bToken = bx_get('oauth_token') !== false;
$mixedSecret = $this->oSession->getValue('sys_oauth_secret');
if (!$bToken && $mixedSecret !== false) {
$this->oSession->unsetValue('sys_oauth_secret');
$mixedSecret = false;
}
//--- Get request token and redirect to authorize.
if (!$bToken && $mixedSecret === false) {
$oToken = $oService->requestRequestToken();
if (empty($oToken)) {
return _t('_adm_err_oauth_cannot_get_token');
}
$this->oSession->setValue('sys_oauth_secret', $oToken->getRequestTokenSecret());
$oUrl = $oService->getAuthorizationUri(array('oauth_token' => $oToken->getRequestToken()));
return _t('_adm_msg_oauth_need_authorize', bx_append_url_params($oUrl, array('sid' => bx_site_hash())));
}
//--- Get access token.
if ($bToken && $mixedSecret !== false) {
$oToken = $this->oStorage->retrieveAccessToken($this->sService);
$oAccessToken = $oService->requestAccessToken(bx_get('oauth_token'), bx_get('oauth_verifier'), $oToken->getRequestTokenSecret());
if (empty($oAccessToken)) {
return _t('_adm_err_oauth_cannot_get_token');
}
$this->oSession->setValue('sys_oauth_token', $oAccessToken->getAccessToken());
$this->oSession->setValue('sys_oauth_secret', $oAccessToken->getAccessTokenSecret());
$this->oSession->setValue('sys_oauth_authorized', 1);
$this->oSession->setValue('sys_oauth_authorized_user', (int) bx_get('oauth_user'));
return true;
}
} catch (TokenResponseException $e) {
return _t('_adm_err_oauth_cannot_get_token');
} catch (TokenNotFoundException $e) {
return _t('_adm_err_oauth_cannot_get_token');
}
}
示例14: display
/**
* Display captcha.
*/
public function display($bDynamicMode = false)
{
$sCode = '';
$aApiParams = array();
if ($bDynamicMode) {
$sPostfix = $this->_sObject;
$sId = 'sys-captcha-' . $sPostfix;
$sOnLoadFunction = 'onLoadCallback' . $sPostfix;
$sOnLoadCode = "\n\t \tvar " . $sOnLoadFunction . " = function() {\n\t\t\t\t\tgrecaptcha.render('" . $sId . "', {\n\t\t\t\t\t\t'sitekey': '" . $this->_sKeyPublic . "',\n\t\t\t\t\t\t'theme': '" . $this->_sSkin . "'\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t ";
$aApiParams = array('onload' => $sOnLoadFunction, 'render' => 'explicit');
$sCode .= $this->_oTemplate->_wrapInTagJsCode($sOnLoadCode);
$sCode .= '<div id="' . $sId . '">';
} else {
$aApiParams = array('render' => 'onload');
$sCode .= '<div class="g-recaptcha" data-sitekey="' . $this->_sKeyPublic . '" data-theme="' . $this->_sSkin . '"></div>';
}
$aApiParams['hl'] = BxDolLanguages::getInstance()->getCurrentLanguage();
$sCodeJs = $this->_oTemplate->addJs(bx_append_url_params($this->sApiUrl, $aApiParams), $bDynamicMode);
return ($bDynamicMode ? $sCodeJs : '') . $sCode;
}
示例15: GenIPBlackListTable
function GenIPBlackListTable()
{
$sSQL = "SELECT *, FROM_UNIXTIME(`LastDT`) AS `LastDT_U` FROM `sys_ip_list` ORDER BY `From` ASC";
$rIPList = db_res($sSQL);
$aTmplVarsItems = array();
while ($aIPList = mysql_fetch_assoc($rIPList)) {
$iID = (int) $aIPList['ID'];
$sFrom = long2ip($aIPList['From']);
$sTo = $aIPList['To'] == 0 ? '' : long2ip($aIPList['To']);
$sType = process_html_output($aIPList['Type']);
$sLastDT_Formatted = getLocaleDate($aIPList['LastDT'], BX_DOL_LOCALE_DATE);
$sLastDT = preg_replace('/([\\d]{2}):([\\d]{2}):([\\d]{2})/', '$1:$2', $aIPList['LastDT_U']);
$sDesc = process_html_output($aIPList['Desc']);
$sDescAttr = bx_html_attribute(bx_js_string($aIPList['Desc'], BX_ESCAPE_STR_APOS));
$aTmplVarsItems[] = array('id' => $iID, 'from' => $sFrom, 'to' => $sTo, 'type' => $sType, 'date' => $sLastDT, 'date_uf' => $sLastDT_Formatted, 'description' => $sDesc, 'description_attr' => $sDescAttr, 'delete_action_url' => bx_append_url_params($this->_sActionUrl, array('action' => 'apply_delete', 'id' => $iID)));
}
if (empty($aTmplVarsItems)) {
return MsgBox(_t('_Empty'));
}
return $GLOBALS['oAdmTemplate']->parseHtmlByName('ip_blacklist_list_filters.html', array('bx_repeat:items' => $aTmplVarsItems));
}