本文整理汇总了PHP中bx_import函数的典型用法代码示例。如果您正苦于以下问题:PHP bx_import函数的具体用法?PHP bx_import怎么用?PHP bx_import使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bx_import函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: performActionEdit
public function performActionEdit()
{
$sAction = 'edit';
$aIds = bx_get('ids');
if (!$aIds || !is_array($aIds)) {
$sId = bx_get('set_name');
if (!$sId) {
$this->_echoResultJson(array());
exit;
}
$aIds = array($sId);
}
$sId = bx_process_input($aIds[0]);
$aSet = array();
$iSet = $this->oDb->getSets(array('type' => 'by_name', 'value' => $sId), $aSet);
if ($iSet != 1 || empty($aSet)) {
$this->_echoResultJson(array());
exit;
}
bx_import('BxTemplStudioFormView');
$aForm = array('form_attrs' => array('id' => 'adm-nav-set-edit', 'action' => BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction, 'method' => BX_DOL_STUDIO_METHOD_DEFAULT), 'params' => array('db' => array('table' => 'sys_menu_sets', 'key' => 'set_name', 'uri' => '', 'uri_title' => '', 'submit_name' => 'do_submit')), 'inputs' => array('set_name' => array('type' => 'hidden', 'name' => 'set_name', 'value' => $sId, 'db' => array('pass' => 'Xss')), 'title' => array('type' => 'text_translatable', 'name' => 'title', 'caption' => _t('_adm_nav_txt_sets_title'), 'info' => _t('_adm_nav_dsc_sets_title'), 'value' => $aSet['title'], 'required' => '1', 'db' => array('pass' => 'Xss'), 'checker' => array('func' => 'LengthTranslatable', 'params' => array(3, 100, 'title'), 'error' => _t('_adm_nav_err_sets_title'))), 'controls' => array('name' => 'controls', 'type' => 'input_set', array('type' => 'submit', 'name' => 'do_submit', 'value' => _t('_adm_nav_btn_menus_save')), array('type' => 'reset', 'name' => 'close', 'value' => _t('_adm_nav_btn_menus_cancel'), 'attrs' => array('onclick' => "\$('.bx-popup-applied:visible').dolPopupHide()", 'class' => 'bx-def-margin-sec-left')))));
$oForm = new BxTemplStudioFormView($aForm);
$oForm->initChecker();
if ($oForm->isSubmittedAndValid()) {
if ($oForm->update($sId) !== false) {
$aRes = array('grid' => $this->getCode(false), 'blink' => $sId);
} else {
$aRes = array('msg' => _t('_adm_nav_err_sets_edit'));
}
$this->_echoResultJson($aRes, true);
} else {
$sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-nav-set-edit-popup', _t('_adm_nav_txt_sets_edit_popup', _t($aSet['title'])), $this->_oTemplate->parseHtmlByName('nav_add_set.html', array('form_id' => $aForm['form_attrs']['id'], 'form' => $oForm->getCode(true), 'object' => $this->_sObject, 'action' => $sAction)));
$this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
}
}
示例2: response
function response(&$o)
{
if ($o->sUnit == 'system') {
switch ($o->sAction) {
case 'join_after_payment':
$this->oModule->processJoinAfterPayment($o);
break;
}
}
if ($o->sUnit == 'profile') {
switch ($o->sAction) {
case 'logout':
//delete facebook's session cookie
$this->oModule->oFacebook->destroySession();
break;
case 'join':
bx_import('BxDolSession');
$oSession = BxDolSession::getInstance();
$iFacebookProfileUid = $oSession->getValue($this->oModule->_oConfig->sFacebookSessionUid);
if ($iFacebookProfileUid) {
$oSession->unsetValue($this->oModule->_oConfig->sFacebookSessionUid);
//save Fb's uid
$this->oModule->_oDb->saveFbUid($o->iObject, $iFacebookProfileUid);
//Auto-friend members if they are already friends on Facebook
$this->oModule->_makeFriends($o->iObject);
}
break;
case 'delete':
//remove Fb account
$this->oModule->_oDb->deleteFbUid($o->iObject);
break;
default:
}
}
}
示例3: __construct
function __construct($sModule = "", $sPage = "")
{
parent::__construct($sModule, $sPage);
bx_import('BxDolModule');
$this->oModule = BxDolModule::getInstance('bx_smtp');
$this->aMenuItems = array(array('name' => 'general', 'icon' => 'cogs', 'title' => '_adm_lmi_cpt_settings'), array('name' => 'tester', 'icon' => 'envelope', 'title' => '_bx_smtp_tester'));
}
示例4: post
function post($sSystem, $iId, $iCmtAuthorId, $iCmtParentId, $iMood, $sFileId)
{
global $sIncPath;
global $sModule;
global $sHomeUrl;
$iId = (int) $iId;
$iCmtParentId = (int) $iCmtParentId;
$iMood = (int) $iMood;
bx_import('BxDolCmts');
$oCmts = BxDolCmts::getObjectInstance($sSystem, $iId);
if (!$oCmts) {
return 0;
}
$sText = '<iframe width="100%" height="240" src="[ray_url]modules/video_comments/embed.php?id=' . $sFileId . '" frameborder="0" allowfullscreen></iframe>';
$mixedOverrideResult = null;
$oAlert = new BxDolAlerts('bx_video_comments', 'post', $sFileId, getLoggedId(), array('override' => &$mixedOverrideResult, 'text' => &$sText, 'file_id' => &$sFileId, 'object_id' => &$iId, 'author' => &$iCmtAuthorId, 'parent_id' => &$iCmtParentId, 'mood' => &$iMood));
$oAlert->alert();
if (null !== $mixedOverrideResult) {
return $mixedOverrideResult;
}
$iCmtNewId = $oCmts->_oQuery->addComment($iId, $iCmtParentId, $iCmtAuthorId, $sText, $iMood);
if (false === $iCmtNewId) {
return 0;
}
bx_import('BxDolAlerts');
$oZ = new BxDolAlerts($sSystem, 'commentPost', $oCmts->getId(), $oCmts->_getAuthorId(), array('comment_id' => $iCmtNewId, 'comment_author_id' => $iCmtAuthorId));
$oZ->alert();
$oCmts->_triggerComment();
return $iCmtNewId;
}
示例5: activate
function activate($sTemplate)
{
$aTemplate = BxDolModuleQuery::getInstance()->getModuleByName($sTemplate);
if (empty($aTemplate) || !is_array($aTemplate)) {
return array('code' => 1, 'message' => _t('_adm_err_operation_failed'));
}
$aTemplates = array();
$iTemplates = $this->oDb->getTemplatesBy(array('type' => 'active'), $aTemplates);
if ($iTemplates == 1 && $aTemplates[0]['name'] == $sTemplate) {
return array('code' => 1, 'message' => _t('_adm_dsg_err_last_active'));
}
$sTemplateDefault = getParam('template');
if ($aTemplate['uri'] == $sTemplateDefault) {
return array('code' => 2, 'message' => _t('_adm_dsg_err_deactivate_default'));
}
bx_import('BxDolStudioInstallerUtils');
$oInstallerUtils = BxDolStudioInstallerUtils::getInstance();
$aResult = (int) $aTemplate['enabled'] == 0 ? $oInstallerUtils->perform($aTemplate['path'], 'enable') : $oInstallerUtils->perform($aTemplate['path'], 'disable');
if ($aResult['code'] != 0) {
return $aResult;
}
bx_import('BxDolStudioTemplate');
$oTemplate = BxDolStudioTemplate::getInstance();
$aResult = array('code' => 0, 'message' => _t('_adm_scs_operation_done'));
if ((int) $aTemplate['enabled'] == 0) {
$aResult['content'] = $oTemplate->parseHtmlByName('page_content_2_col.html', array('page_menu_code' => $this->getPageMenu(), 'page_main_code' => $this->getPageCode()));
} else {
$aResult['content'] = "";
}
return $aResult;
}
示例6: getCode
function getCode()
{
bx_import('BxTemplStudioMenu');
$aTmplVars = array();
foreach ($this->aItems as $sPosition => $mixedItems) {
if (!$this->aVisible[$sPosition]) {
continue;
}
$sContent = "";
if (is_array($mixedItems)) {
$oMenu = new BxTemplStudioMenu(array('template' => 'menu_top_toolbar.html', 'menu_items' => $mixedItems));
$sContent = $oMenu->getCode();
} else {
if (is_string($mixedItems) && !empty($mixedItems)) {
$sContent = $mixedItems;
}
}
$aTmplVars[] = array('name' => $sPosition, 'content' => $sContent);
}
if (empty($aTmplVars)) {
return '';
}
$oTemplate = BxDolStudioTemplate::getInstance();
$oTemplate->addJs($this->getJs());
$oTemplate->addCss($this->getCss());
return $oTemplate->parseHtmlByName('menu_top.html', array('bx_repeat:menus' => $aTmplVars));
}
示例7: processActions
function processActions()
{
if (($sAction = bx_get($this->sParamPrefix . '_action')) !== false) {
$sAction = bx_process_input($sAction);
$aResult = array('code' => 1, 'message' => _t('_adm_' . $this->sLangPrefix . '_err_cannot_process_action'));
switch ($sAction) {
case 'uninstall':
$sPageName = bx_process_input(bx_get($this->sParamPrefix . '_page_name'));
if (empty($sPageName)) {
break;
}
bx_import('BxDolModuleQuery');
$aModule = BxDolModuleQuery::getInstance()->getModuleByName($sPageName);
if (empty($aModule) || !is_array($aModule)) {
break;
}
if (($iWidgetId = (int) bx_get($this->sParamPrefix . '_widget_id')) != 0 && (int) bx_get($this->sParamPrefix . '_confirmed') != 1) {
$aResult['message'] = $this->getPopupConfirm($iWidgetId, $aModule);
break;
}
bx_import('BxDolStudioInstallerUtils');
$aResult = BxDolStudioInstallerUtils::getInstance()->perform($aModule['path'], 'uninstall');
if (!empty($aResult['message'])) {
$aResult['message'] = $this->getPopupResult($aResult['message']);
}
break;
}
if (!empty($aResult['message'])) {
bx_import('BxTemplStudioFunctions');
$aResult['message'] = BxTemplStudioFunctions::getInstance()->transBox('', $aResult['message']);
}
echo json_encode($aResult);
exit;
}
}
示例8: actionAdministration
function actionAdministration()
{
if (!$this->isAdmin()) {
$this->_oTemplate->displayAccessDenied();
return;
}
$iId = $this->_oDb->getSettingsCategory('Google Search');
if (empty($iId)) {
$this->_oTemplate->displayPageNotFound();
return;
}
$this->_oTemplate->pageStart();
bx_import('BxDolAdminSettings');
$mixedResult = '';
if (isset($_POST['save']) && isset($_POST['cat'])) {
$oSettings = new BxDolAdminSettings($iId);
$mixedResult = $oSettings->saveChanges($_POST);
}
$oSettings = new BxDolAdminSettings($iId);
$sResult = $oSettings->getForm();
if ($mixedResult !== true && !empty($mixedResult)) {
$sResult = $mixedResult . $sResult;
}
echo $this->_oTemplate->adminBlock($sResult, _t('_bx_gsearch_administration'), false, false, 11);
$this->_oTemplate->addCssAdmin('main.css');
$this->_oTemplate->addCssAdmin('forms_adv.css');
$this->_oTemplate->pageCodeAdmin(_t('_bx_gsearch_administration'));
}
示例9: performActionEdit
public function performActionEdit()
{
$sAction = 'edit';
$sFormObject = $this->oModule->_oConfig->getObject('form_forms_prevalue');
$sFormDisplay = $this->oModule->_oConfig->getObject('form_display_forms_prevalue_edit');
$aValue = $this->_getItem('getValues');
if ($aValue === false) {
$this->_echoResultJson(array());
exit;
}
bx_import('BxDolForm');
$oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
$oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction . '&list=' . $this->sList;
$this->onLoad($oForm->aInputs);
$oForm->initChecker($aValue);
if ($oForm->isSubmittedAndValid()) {
if ($oForm->update($aValue['id']) !== false) {
$this->onSave($oForm);
$aRes = array('grid' => $this->getCode(false), 'blink' => $aValue['id']);
} else {
$aRes = array('msg' => _t('_bx_dev_frm_err_prevalues_edit'));
}
$this->_echoResultJson($aRes, true);
} else {
bx_import('BxTemplStudioFunctions');
$sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-prevalue-edit-popup', _t('_bx_dev_frm_txt_prevalues_edit_popup', _t($aValue['lkey'])), $this->oModule->_oTemplate->parseHtmlByName('form_add_value.html', array('form_id' => $oForm->aFormAttrs['id'], 'form' => $oForm->getCode(true), 'object' => $this->_sObject, 'action' => $sAction)));
$this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
}
}
示例10: __construct
public function __construct($aObject, $oTemplate = false)
{
parent::__construct($aObject, $oTemplate);
$CNF = $this->_oModule->_oConfig->CNF;
$iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
$iContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
if ($iProfileId) {
$this->_oProfile = BxDolProfile::getInstance($iProfileId);
}
if (!$this->_oProfile && $iContentId) {
$this->_oProfile = BxDolProfile::getInstanceByContentAndType($iContentId, $this->MODULE);
}
if ($this->_oProfile) {
$this->_aProfileInfo = $this->_oProfile->getInfo();
$this->_aContentInfo = $this->_oModule->_oDb->getContentInfoById($this->_aProfileInfo['content_id']);
$this->addMarkers($this->_aProfileInfo);
$this->addMarkers(array('profile_id' => $this->_oProfile->id()));
if (isLogged()) {
bx_import('BxDolConnection');
$oConn = BxDolConnection::getObjectInstance('sys_profiles_friends');
if ($oConn->isConnectedNotMutual(bx_get_logged_profile_id(), $this->_oProfile->id())) {
$this->addMarkers(array('title_add_friend' => _t($CNF['T']['menu_item_title_befriend_sent']), 'title_remove_friend' => _t($CNF['T']['menu_item_title_unfriend_cancel_request'])));
} elseif ($oConn->isConnectedNotMutual($this->_oProfile->id(), bx_get_logged_profile_id())) {
$this->addMarkers(array('title_add_friend' => _t($CNF['T']['menu_item_title_befriend_confirm']), 'title_remove_friend' => _t($CNF['T']['menu_item_title_unfriend_reject_request'])));
} else {
$this->addMarkers(array('title_add_friend' => _t($CNF['T']['menu_item_title_befriend']), 'title_remove_friend' => _t($CNF['T']['menu_item_title_unfriend'])));
}
}
}
}
示例11: displaySelectLevelBlock
function displaySelectLevelBlock($aLevels)
{
$iModuleId = $this->_oConfig->getId();
$iLevelsHalf = (int) ceil(count($aLevels) / 2);
$sCurrencyCode = strtoupper($this->_oConfig->getCurrencyCode());
$sCurrencySign = $this->_oConfig->getCurrencySign();
bx_import('BxDolPayments');
$oPayment = BxDolPayments::getInstance();
$aProviders = $oPayment->getProviders(0);
if (empty($aProviders)) {
return MsgBox(_t('_membership_err_no_payment_options'));
}
$aTmplVarsLevels = array();
foreach ($aLevels as $aLevel) {
$aTmplVarsLevels[] = array('id' => $aLevel['mem_id'], 'descriptor' => $oPayment->getCartItemDescriptor(0, $iModuleId, $aLevel['price_id'], 1), 'checked' => empty($aTmplVarsLevels) ? 'checked="checked"' : '', 'title' => $aLevel['mem_name'], 'icon' => $this->_oConfig->getIconsUrl() . $aLevel['mem_icon'], 'bx_if:show_description' => array('condition' => strlen($aLevel['mem_description']) > 0, 'content' => array('description' => str_replace("\$", "$", $aLevel['mem_description']))), 'days' => $aLevel['price_days'] > 0 ? $aLevel['price_days'] . ' ' . _t('_membership_txt_days') : _t('_membership_txt_expires_never'), 'price' => $aLevel['price_amount'], 'currency_code' => $sCurrencyCode);
}
$aTmplVarsProviders = array();
if (!empty($aProviders)) {
foreach ($aProviders as $aProvider) {
if ((int) $aProvider['for_visitor'] != 1) {
continue;
}
$aTmplVarsProviders[] = array('name' => $aProvider['name'], 'caption' => $aProvider['caption_cart'], 'checked' => empty($aTmplVarsProviders) ? 'checked="checked"' : '');
}
}
$bSelectedProvider = count($aTmplVarsProviders) == 1;
$sSelectedProvider = $bSelectedProvider ? $aTmplVarsProviders[0]['name'] : '';
$aTmplParams = array('js_object' => $this->_oConfig->getJsObject('join'), 'js_code' => $this->getJsCode('join', true), 'submit_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'join_submit', 'bx_repeat:levels_left' => array_slice($aTmplVarsLevels, 0, $iLevelsHalf), 'bx_repeat:levels_right' => array_slice($aTmplVarsLevels, $iLevelsHalf), 'bx_if:show_providers_selector' => array('condition' => !$bSelectedProvider, 'content' => array('bx_repeat:providers' => $aTmplVarsProviders)), 'bx_if:show_selected_provider' => array('condition' => $bSelectedProvider, 'content' => array('name' => $sSelectedProvider)));
$this->addCss('levels.css');
$this->addJs('join.js');
$this->addJsTranslation(array('_membership_err_need_select_level', '_membership_err_need_select_provider'));
return array($this->parseHtmlByName('select_level_block.html', $aTmplParams), array(), array(), false);
}
示例12: genSiteServiceMenu
function genSiteServiceMenu()
{
$bLogged = isLogged();
$aMenuItem = array();
$sMenuPopupId = '';
$sMenuPopupContent = '';
if ($bLogged) {
bx_import('BxTemplMenuService');
$oMenu = new BxTemplMenuService();
if ($oMenu->aMenuInfo['memberID'] != 0) {
$aProfile = getProfileInfo($oMenu->aMenuInfo['memberID']);
}
$sThumbSetting = getParam('sys_member_info_thumb_icon');
bx_import('BxDolMemberInfo');
$o = BxDolMemberInfo::getObjectInstance($sThumbSetting);
$sThumbUrl = $o ? $o->get($aProfile) : '';
$o = BxDolMemberInfo::getObjectInstance($sThumbSetting . '_2x');
$sThumbTwiceUrl = $o ? $o->get($aProfile) : '';
if (!$sThumbTwiceUrl) {
$sThumbTwiceUrl = $sThumbUrl;
}
$bThumb = !empty($sThumbUrl);
$aMenuItem = array('bx_if:show_fu_thumb_image' => array('condition' => $bThumb, 'content' => array('image' => $sThumbUrl, 'image_2x' => $sThumbTwiceUrl)), 'bx_if:show_fu_thumb_icon' => array('condition' => !$bThumb, 'content' => array()), 'thumbnail' => get_member_icon($oMenu->aMenuInfo['memberID']), 'title' => getNickName($oMenu->aMenuInfo['memberID']));
$sMenuPopupId = 'sys-service-menu-' . time();
$sMenuPopupContent = $this->transBox($oMenu->getCode());
}
return $GLOBALS['oSysTemplate']->parseHtmlByName('extra_service_menu_wrapper.html', array('bx_if:show_for_visitor' => array('condition' => !$bLogged, 'content' => array()), 'bx_if:show_for_user' => array('condition' => $bLogged, 'content' => $aMenuItem), 'menu_popup_id' => $sMenuPopupId, 'menu_popup_content' => $sMenuPopupContent));
}
示例13: getCode
public function getCode($sUrl, $sTitle, $aCustomVars = false)
{
// define markers for replacments
$aMarkers = array('url' => $sUrl, 'url_encoded' => rawurlencode($sUrl), 'lang' => $GLOBALS['sCurrentLanguage'], 'locale' => $this->_getLocaleFacebook($GLOBALS['sCurrentLanguage']), 'twit' => _t('_sys_social_sharing_twit'), 'title' => $sTitle, 'title_encoded' => rawurlencode($sTitle));
if (!empty($aCustomVars) && is_array($aCustomVars)) {
$aMarkers = array_merge($aMarkers, $aCustomVars);
}
// alert
$sOverrideOutput = null;
bx_import('BxDolAlerts');
$oAlert = new BxDolAlerts('system', 'social_sharing_display', '', '', array('buttons' => &$this->_aSocialButtons, 'markers' => &$aMarkers, 'override_output' => &$sOverrideOutput));
$oAlert->alert();
// return custom code if there is one
if ($sOverrideOutput) {
return $sOverrideOutput;
}
// return empty string of there is no buttons
if (empty($this->_aSocialButtons)) {
return '';
}
// prepare buttons
$aButtons = array();
foreach ($this->_aSocialButtons as $aButton) {
$sButton = $this->_replaceMarkers($aButton['content'], $aMarkers);
if (preg_match('/{[A-Za-z0-9_]+}/', $sButton)) {
// if not all markers are replaced skip it
continue;
}
$aButtons[] = array('button' => $sButton);
}
// output
$aTemplateVars = array('bx_repeat:buttons' => $aButtons);
return $GLOBALS['oSysTemplate']->parseHtmlByName('social_sharing.html', $aTemplateVars);
}
示例14: PageCompMainCode
/**
* page code function
*/
function PageCompMainCode()
{
ob_start();
bx_import('BxDolAccount');
$oAccount = BxDolAccount::getInstance();
$aAccountInfo = $oAccount ? $oAccount->getInfo() : false;
if (!$aAccountInfo) {
return DesignBoxContent("Send Email example", 'Please login first', BX_DB_PADDING_DEF);
}
echo "<h2>Account info</h2>";
echo "Email: " . $aAccountInfo['email'] . '<br />';
echo "Email Confirmed: " . ($aAccountInfo['email_confirmed'] ? 'yes' : 'no') . '<br />';
echo "Receive site updates: " . ($aAccountInfo['receive_updates'] ? 'yes' : 'no') . '<br />';
echo "Receive site newsletters: " . ($aAccountInfo['receive_news'] ? 'yes' : 'no') . '<br />';
echo "Site emails are sent from: " . getParam('site_email_notify') . '<br />';
$a = array('sys' => array('title' => "Send me system email", 'type' => BX_EMAIL_SYSTEM, 'subj' => 'System Email', 'body' => 'This is system email <br /> {unsubscribe}'), 'notif' => array('title' => "Send me notification", 'type' => BX_EMAIL_NOTIFY, 'subj' => 'Notification Email', 'body' => 'This is notification email<br /> {unsubscribe}'), 'mass' => array('title' => "Send me bulk email", 'type' => BX_EMAIL_MASS, 'subj' => 'Bulk Email', 'body' => 'This is bulk email<br /> {unsubscribe}'));
$sSendMail = bx_get('send');
if ($sSendMail && isset($a[$sSendMail])) {
echo "<h2>Send Email Result</h2>";
$r = $a[$sSendMail];
if (sendMail($aAccountInfo['email'], $r['subj'], $r['body'], 0, array(), $r['type'])) {
echo MsgBox($r['subj'] . ' - successfully sent');
} else {
echo MsgBox($r['subj'] . ' - sent failed');
}
}
echo "<h2>Send email</h2>";
foreach ($a as $k => $r) {
echo '<a href="samples/email.php?send=' . $k . '">' . $r['title'] . '</a><br />';
}
return DesignBoxContent("Send Email Example", ob_get_clean(), BX_DB_PADDING_DEF);
}
示例15: __construct
function __construct()
{
$this->aPseud = $this->_getPseud();
parent::__construct();
bx_import('BxTemplVotingView');
$this->aConstants['linksTempl'] = $this->isPermalinkEnabled() ? $this->aPermalinks['enabled'] : $this->aPermalinks['disabled'];
}