本文整理汇总了PHP中BxDolModule::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP BxDolModule::getInstance方法的具体用法?PHP BxDolModule::getInstance怎么用?PHP BxDolModule::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BxDolModule
的用法示例。
在下文中一共展示了BxDolModule::getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unit
function unit($aData, $sTemplateName, &$oVotingView)
{
if (null == $this->_oMain) {
$this->_oMain = BxDolModule::getInstance('BxStoreModule');
}
if (!$this->_oMain->isAllowedView($aData)) {
$aVars = array('extra_css_class' => 'bx_store_unit');
return $this->parseHtmlByName('browse_unit_private', $aVars);
}
$sImage = '';
if ($aData['thumb']) {
$a = array('ID' => $aData['author_id'], 'Avatar' => $aData['thumb']);
$aImage = BxDolService::call('photos', 'get_image', array($a, 'browse'), 'Search');
$sImage = $aImage['no_image'] ? '' : $aImage['file'];
}
$sPrice = '';
if ('Free' == $aData['price_range']) {
$sPrice = _t('_bx_store_free_product');
} else {
$sPrice = str_replace('.00', '', sprintf($aData['price_range'], getParam('pmt_default_currency_sign'), getParam('pmt_default_currency_sign')));
}
$aVars = array('id' => $aData['id'], 'thumb_url' => $sImage ? $sImage : $this->getIconUrl('no-photo.png'), 'product_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aData['uri'], 'product_title' => $aData['title'], 'created' => defineTimeInterval($aData['created']), 'author' => $aData['author_id'] ? $aData['NickName'] : _t('_bx_store_admin'), 'author_url' => $aData['author_id'] ? getProfileLink($aData['author_id']) : 'javascript:void(0);', 'price_range' => $sPrice);
$aVars['rate'] = $oVotingView ? $oVotingView->getJustVotingElement(0, $aData['id'], $aData['rate']) : ' ';
return $this->parseHtmlByName($sTemplateName, $aVars);
}
示例2: __construct
function __construct($sModule = "", $sPage = "")
{
parent::__construct($sModule, $sPage);
bx_import('BxDolModule');
$this->oModule = BxDolModule::getInstance($this->sModule);
$this->sUrl = BX_DOL_URL_STUDIO . 'module.php?name=%s&page=%s';
}
示例3: __construct
function __construct($sModuleClass = '')
{
/* main settings for shared modules
ownFields - fields which will be got from main table ($this->aCurrent['table'])
searchFields - fields which using for full text key search
join - array of join tables
join array (
'type' - type of join
'table' - join table
'mainField' - field from main table for 'on' condition
'onField' - field from joining table for 'on' condition
'joinFields' - array of fields from joining table
)
*/
$this->aCurrent = array('ownFields' => array('ID', 'Title', 'Uri', 'Date', 'Time', 'Rate', 'RateCount'), 'searchFields' => array('Title', 'Tags', 'Description', 'Categories'), 'join' => array('profile' => array('type' => 'left', 'table' => 'Profiles', 'mainField' => 'Owner', 'onField' => 'ID', 'joinFields' => array('NickName')), 'albumsObjects' => array('type' => 'left', 'table' => 'sys_albums_objects', 'mainField' => 'ID', 'onField' => 'id_object', 'joinFields' => ''), 'albums' => array('type' => 'left', 'table' => 'sys_albums', 'mainField' => 'id_album', 'onField' => 'ID', 'joinFields' => array('AllowAlbumView'), 'mainTable' => 'sys_albums_objects')), 'restriction' => array('activeStatus' => array('value' => 'approved', 'field' => 'Status', 'operator' => '=', 'paramName' => 'status'), 'owner' => array('value' => '', 'field' => 'Owner', 'operator' => '=', 'paramName' => 'userID'), 'ownerStatus' => array('value' => array('Rejected', 'Suspended'), 'operator' => 'not in', 'paramName' => 'ownerStatus', 'table' => 'Profiles', 'field' => 'Status'), 'tag' => array('value' => '', 'field' => 'Tags', 'operator' => 'against', 'paramName' => 'tag'), 'category' => array('value' => '', 'field' => 'Categories', 'operator' => 'against', 'paramName' => 'categoryUri'), 'id' => array('value' => '', 'field' => 'ID', 'operator' => 'in'), 'allow_view' => array('value' => '', 'field' => 'AllowAlbumView', 'operator' => 'in', 'table' => 'sys_albums'), 'not_allow_view' => array('value' => '', 'field' => 'AllowAlbumView', 'operator' => 'not in', 'table' => 'sys_albums'), 'album_status' => array('value' => 'active', 'field' => 'Status', 'operator' => '=', 'table' => 'sys_albums'), 'albumType' => array('value' => '', 'field' => 'Type', 'operator' => '=', 'paramName' => 'albumType', 'table' => 'sys_albums')), 'paginate' => array('perPage' => 10, 'page' => 1, 'totalNum' => 10, 'totalPages' => 1), 'sorting' => 'last', 'view' => 'full', 'rss' => array('title' => '', 'link' => '', 'image' => '', 'profile' => 0, 'fields' => array('Link' => '', 'Title' => 'title', 'DateTimeUTS' => 'date', 'Desc' => 'desc', 'Photo' => '')));
// favorite config, basic for all media modules
$this->aAddPartsConfig['favorite'] = array('type' => 'inner', 'table' => '', 'mainField' => 'ID', 'onField' => 'ID', 'userField' => 'Profile', 'joinFields' => '');
$this->aPseud = $this->_getPseud();
parent::__construct();
$this->sModuleClass = $sModuleClass;
$this->oModule = BxDolModule::getInstance($this->sModuleClass);
$this->oTemplate = $GLOBALS['oSysTemplate'];
$sClassName = $this->oModule->_oConfig->getClassPrefix() . 'Privacy';
bx_import('Privacy', $this->oModule->_aModule);
$this->oPrivacy = new $sClassName('sys_albums', 'ID', 'Owner');
$this->sTemplUnit = 'browse_unit';
$this->bDynamic = isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest';
}
示例4: _performAction
protected function _performAction($sAction, $sDisplay, $iId = 0)
{
bx_import('BxDolForm');
$oForm = BxDolForm::getObjectInstance('bx_antispam_ip_table_form', $sDisplay);
// get form instance for specified form object and display
if (!$oForm) {
$this->_echoResultJson(array('msg' => _t('_sys_txt_error_occured')), true);
exit;
}
$oForm->addMarkers(array('grid_object' => $this->_sObject, 'grid_action' => $sAction));
$aIpTableDirective = array();
if ($iId) {
bx_import('BxDolModule');
$oModule = BxDolModule::getInstance('bx_antispam');
$oAntispamIp = bx_instance('BxAntispamIP', array(), $oModule->_aModule);
$aIpTableDirective = $oAntispamIp->getIpTableDirective($iId);
$aIpTableDirective['From'] = long2ip($aIpTableDirective['From']);
$aIpTableDirective['To'] = long2ip($aIpTableDirective['To']);
}
$oForm->initChecker($aIpTableDirective);
if ($oForm->isSubmittedAndValid()) {
// if form is submitted and all fields are valid
$aCustomValues = array('From' => sprintf("%u", ip2long($oForm->getCleanValue('From'))), 'To' => sprintf("%u", ip2long($oForm->getCleanValue('To'))));
if ($iId) {
if ($oForm->update($iId, $aCustomValues)) {
// update record
$iRecentId = $iId;
}
} else {
$iRecentId = $oForm->insert($aCustomValues, true);
// insert new record
}
if ($iRecentId) {
$aRes = array('grid' => $this->getCode(false), 'blink' => $iRecentId);
} else {
$aRes = array('msg' => _t('_sys_txt_error_occured'));
}
// if record adding failed, display error message
$this->_echoResultJson($aRes, true);
} else {
// if form is not submitted or some fields are invalid, display popup with form
bx_import('BxTemplFunctions');
$s = BxTemplFunctions::getInstance()->popupBox($oForm->getId() . '_form', _t('_bx_antispam_form_ip_table_add'), $oForm->getCode() . '
<script>
$(document).ready(function () {
$("#' . $oForm->getId() . '").ajaxForm({
dataType: "json",
beforeSubmit: function (formData, jqForm, options) {
bx_loading($("#' . $oForm->getId() . '"), true);
},
success: function (data) {
$(".bx-popup-applied:visible").dolPopupHide();
glGrids.' . $this->_sObject . '.processJson(data, "' . $sAction . '");
}
});
});
</script>');
$this->_echoResultJson(array('popup' => array('html' => $s, 'options' => array('closeOnOuterClick' => false))), true);
}
}
示例5: __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'));
}
示例6: __construct
function __construct($aOptions, $oTemplate = false)
{
parent::__construct($aOptions, $oTemplate);
$this->_aOptions['actions_single']['export']['attr']['title'] = _t('_bx_dev_nav_btn_menus_gl_export');
$this->oModule = BxDolModule::getInstance('bx_developer');
$this->sUrlViewItems = BX_DOL_URL_STUDIO . 'module.php?name=' . $this->oModule->_oConfig->getName() . '&page=navigation&nav_page=items&nav_module=%s&nav_set=%s';
}
示例7: __construct
function __construct($oModule = null)
{
$oModule = !empty($oModule) ? $oModule : BxDolModule::getInstance('BxFdbModule');
parent::__construct($oModule);
$this->aCurrent['searchFields'] = array('caption', 'content', 'tags');
unset($this->aCurrent['restriction']['category']);
}
示例8: __construct
public function __construct($aObject, $sStorageObject, $sUniqId)
{
parent::__construct($aObject, $sStorageObject, $sUniqId);
$oModule = BxDolModule::getInstance('bx_timeline');
$oModule->getAttachmentsMenuObject()->addMarkers(array('js_object_uploader_video' => $this->getNameJsInstanceUploader()));
$this->_oTemplate = $oModule->_oTemplate;
}
示例9: __construct
function __construct($aOptions, $oTemplate = false)
{
parent::__construct($aOptions, $oTemplate);
$this->oModule = BxDolModule::getInstance('bx_developer');
$this->sUrlViewDisplays = BX_DOL_URL_STUDIO . 'module.php?name=' . $this->oModule->_oConfig->getName() . '&page=forms&form_page=displays&form_module=%s&form_object=%s';
$this->_aOptions['actions_single']['export']['attr']['title'] = _t('_bx_dev_frm_btn_forms_gl_export');
}
示例10: setUp
protected function setUp()
{
bx_import('BxDolModule');
$oModule = BxDolModule::getInstance('bx_antispam');
$this->_oDNSBlacklists = bx_instance('BxAntispamDNSBlacklists', array(), $oModule->_aModule);
$this->_oDNSURIBlacklists = bx_instance('BxAntispamDNSURIBlacklists', array(), $oModule->_aModule);
}
示例11: _addJsCss
protected function _addJsCss()
{
parent::_addJsCss();
$oModule = BxDolModule::getInstance($this->MODULE);
$oModule->_oTemplate->addJs('main.js');
$oModule->_oTemplate->addCss(array('main-media-tablet.css', 'main-media-desktop.css'));
}
示例12: __construct
public function __construct($aOptions, $oTemplate = false)
{
parent::__construct($aOptions, $oTemplate);
$this->_oModule = BxDolModule::getInstance($this->MODULE);
$this->_sManageType = 'administration';
$this->_sParamsDivider = '#-#';
}
示例13: __construct
public function __construct($aOptions, $oTemplate = false)
{
parent::__construct($aOptions, $oTemplate);
$this->_oModule = BxDolModule::getInstance('bx_sites');
$this->_oPermalinks = BxDolPermalinks::getInstance();
$this->_iProfileId = bx_get_logged_profile_id();
}
示例14: cover
/**
* Get profile cover
*/
function cover($aData, $sTemplateName = 'cover.html')
{
$CNF =& $this->_oConfig->CNF;
bx_import('BxDolPermalinks');
$oModule = BxDolModule::getInstance($this->MODULE);
$sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aData[$CNF['FIELD_ID']]);
$sUrlPicture = $this->urlPicture($aData);
$sUrlAvatar = $this->urlAvatar($aData);
$sUrlPictureChange = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_EDIT_ENTRY'] . '&id=' . $aData[$CNF['FIELD_ID']]);
$sUrlCover = $this->urlCover($aData);
$sUrlCoverChange = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_EDIT_COVER'] . '&id=' . $aData[$CNF['FIELD_ID']]);
$sCoverPopup = '';
$sCoverPopupId = $this->MODULE . '-popup-cover';
if ($aData[$CNF['FIELD_COVER']]) {
bx_import('BxTemplFunctions');
$sCoverPopup = BxTemplFunctions::getInstance()->transBox($sCoverPopupId, $this->parseHtmlByName('image_popup.html', array('image_url' => $sUrlCover, 'bx_if:owner' => array('condition' => CHECK_ACTION_RESULT_ALLOWED === $oModule->checkAllowedChangeCover($aData), 'content' => array('change_image_url' => $sUrlCoverChange)))), true, true);
}
$sPicturePopup = '';
$sPicturePopupId = $this->MODULE . '-popup-picture';
if ($aData[$CNF['FIELD_PICTURE']]) {
bx_import('BxTemplFunctions');
$sPicturePopup = BxTemplFunctions::getInstance()->transBox($sPicturePopupId, $this->parseHtmlByName('image_popup.html', array('image_url' => $sUrlPicture, 'bx_if:owner' => array('condition' => CHECK_ACTION_RESULT_ALLOWED === $oModule->checkAllowedEdit($aData), 'content' => array('change_image_url' => $sUrlPictureChange)))), true, true);
}
// generate html
$aVars = array('id' => $aData[$CNF['FIELD_ID']], 'content_url' => $sUrl, 'title' => $aData[$CNF['FIELD_NAME']], 'picture_avatar_url' => $sUrlAvatar, 'picture_popup' => $sPicturePopup, 'picture_popup_id' => $sPicturePopupId, 'picture_url' => $sUrlPicture, 'picture_href' => !$aData[$CNF['FIELD_PICTURE']] && CHECK_ACTION_RESULT_ALLOWED === $oModule->checkAllowedEdit($aData) ? $sUrlPictureChange : 'javascript:void(0);', 'cover_popup' => $sCoverPopup, 'cover_popup_id' => $sCoverPopupId, 'cover_url' => $sUrlCover, 'cover_href' => !$aData[$CNF['FIELD_COVER']] && CHECK_ACTION_RESULT_ALLOWED === $oModule->checkAllowedChangeCover($aData) ? $sUrlCoverChange : 'javascript:void(0);');
return $this->parseHtmlByName($sTemplateName, $aVars);
}
示例15: __construct
public function __construct($aObject, $oTemplate = false)
{
parent::__construct($aObject, $oTemplate);
$this->_sModule = 'bx_notifications';
$this->_oModule = BxDolModule::getInstance($this->_sModule);
$this->_oModule->setSubmenu('notifications-all');
}