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); }
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'; }
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'; }
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); } }
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')); }
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'; }
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']); }
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; }
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'); }
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); }
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')); }
public function __construct($aOptions, $oTemplate = false) { parent::__construct($aOptions, $oTemplate); $this->_oModule = BxDolModule::getInstance($this->MODULE); $this->_sManageType = 'administration'; $this->_sParamsDivider = '#-#'; }
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(); }
/** * 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); }
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'); }
function __construct($sModule = "", $sPage = "") { parent::__construct($sModule, $sPage); bx_import('BxDolModule'); $this->oModule = BxDolModule::getInstance('bx_antispam'); bx_import('BxDolPermalinks'); $this->aMenuItems = array(array('name' => 'settings', 'icon' => 'cogs', 'title' => '_adm_lmi_cpt_settings'), array('name' => 'ip_table', 'icon' => 'align-justify', 'title' => '_bx_antispam_ip_table', 'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=antispam-ip-table')), array('name' => 'dnsbl_list', 'icon' => 'align-justify', 'title' => '_bx_antispam_dnsbl_list', 'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=antispam-dnsbl-list')), array('name' => 'block_log', 'icon' => 'clock-o', 'title' => '_bx_antispam_block_log', 'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=antispam-block-log'))); }
public function __construct($aObject, $oTemplate = false) { parent::__construct($aObject, $oTemplate); $this->_oModule = BxDolModule::getInstance($this->MODULE); // select module submenu $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu'); $oMenuSubmenu->setObjectSubmenu($this->_oModule->_oConfig->CNF['OBJECT_MENU_SUBMENU']); }
function __construct($aParams) { parent::__construct(isset($aParams['page']) ? $aParams['page'] : ''); $this->aParams = $aParams; $this->sSubpageUrl = $this->aParams['url'] . '&pgt_page='; bx_import('BxDolModule'); $this->oModule = BxDolModule::getInstance('bx_developer'); }
function __construct($aParams) { parent::__construct(isset($aParams['page']) ? $aParams['page'] : ''); $this->aParams = $aParams; $this->sSubpageUrl = $this->aParams['url'] . '&nav_page='; $this->oModule = BxDolModule::getInstance('bx_developer'); $this->aGridObjects = array('menus' => $this->oModule->_oConfig->getObject('grid_nav_menus'), 'sets' => $this->oModule->_oConfig->getObject('grid_nav_sets'), 'items' => $this->oModule->_oConfig->getObject('grid_nav_items')); $this->oModule->_oTemplate->addStudioCss(array('navigation.css')); }
function __construct($aParams) { parent::__construct(isset($aParams['page']) ? $aParams['page'] : ''); $this->aParams = $aParams; $this->sSubpageUrl = $this->aParams['url'] . '&pgt_page='; $this->oModule = BxDolModule::getInstance('bx_developer'); $this->aMenuItems = array(); $this->aGridObjects = array('manage' => $this->oModule->_oConfig->getObject('grid_pgt_manage')); }
function blockInfo(&$aEvent) { if (null == $this->_oMain) { $this->_oMain = BxDolModule::getInstance('BxEventsModule'); } $aAuthor = getProfileInfo($aEvent['ResponsibleID']); $aVars = array('author_unit' => $GLOBALS['oFunctions']->getMemberThumbnail($aAuthor['ID'], 'none', true), 'date' => getLocaleDate($aEvent['Date'], BX_DOL_LOCALE_DATE_SHORT), 'date_ago' => defineTimeInterval($aEvent['Date'], false), 'cats' => $this->parseCategories($aEvent['Categories']), 'tags' => $this->parseTags($aEvent['Tags']), 'location' => $this->_oMain->_formatLocation($aEvent, true, true), 'fields' => $this->blockFields($aEvent), 'author_username' => $aAuthor ? $aAuthor['NickName'] : _t('_bx_events_admin'), 'author_url' => $aAuthor ? getProfileLink($aAuthor['ID']) : 'javascript:void(0)'); return $this->parseHtmlByName('block_info', $aVars); }
function response(&$oAlert) { $sMethod = 'processAlert' . str_replace(' ', '', ucwords(str_replace(array('_', '-'), array(' ', ' '), $oAlert->sUnit . '_' . $oAlert->sAction))); if (!method_exists($this, $sMethod)) { return; } $this->_oModule = BxDolModule::getInstance('BxMbpModule'); $this->{$sMethod}($oAlert); }
function isPostReplyAllowed() { if (!parent::isPostReplyAllowed()) { return false; } $oMain = BxDolModule::getInstance('BxAdsModule'); $aAdPost = $oMain->_oDb->getAdInfo($this->getId()); return $oMain->isAllowedComments($aAdPost); }
function __construct($aParams) { parent::__construct(isset($aParams['page']) ? $aParams['page'] : ''); $this->aParams = $aParams; $this->sSubpageUrl = $this->aParams['url'] . '&nav_page='; bx_import('BxDolModule'); $this->oModule = BxDolModule::getInstance('bx_developer'); $this->oModule->_oTemplate->addStudioCss(array('navigation.css')); }
function __construct($aParams) { parent::__construct(isset($aParams['page']) ? $aParams['page'] : ''); $this->aParams = $aParams; $this->sSubpageUrl = $this->aParams['url'] . '&form_page='; $this->oModule = BxDolModule::getInstance('bx_developer'); $this->aGridObjects = array('forms' => $this->oModule->_oConfig->getObject('grid_forms'), 'displays' => $this->oModule->_oConfig->getObject('grid_forms_displays'), 'fields' => $this->oModule->_oConfig->getObject('grid_forms_fields'), 'pre_lists' => $this->oModule->_oConfig->getObject('grid_forms_pre_lists'), 'pre_values' => $this->oModule->_oConfig->getObject('grid_forms_pre_values')); $this->oModule->_oTemplate->addStudioCss(array('forms.css')); }
/** * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/ * CC-BY License - http://creativecommons.org/licenses/by/3.0/ */ function bx_avatar_import($sClassPostfix, $aModuleOverwright = array()) { global $aModule; $a = $aModuleOverwright ? $aModuleOverwright : $aModule; if (!$a || $a['uri'] != 'avatar') { $oMain = BxDolModule::getInstance('BxAvaModule'); $a = $oMain->_aModule; } bx_import($sClassPostfix, $a); }
/** * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/ * CC-BY License - http://creativecommons.org/licenses/by/3.0/ */ function bx_gsearch_import($sClassPostfix, $aModuleOverwright = array()) { global $aModule; $a = $aModuleOverwright ? $aModuleOverwright : $aModule; if (!$a || $a['uri'] != 'google_search') { $oMain = BxDolModule::getInstance('BxGSearchModule'); $a = $oMain->_aModule; } bx_import($sClassPostfix, $a); }
function getChatBlockMenu($iBlockID, $aMenu) { if (!$aMenu || !($oModule = BxDolModule::getInstance('BxChatPlusModule'))) { return ''; } reset($aMenu); $sTitle = key($aMenu); $a = current($aMenu); return $oModule->_oTemplate->parseHtmlByName('chat_block_menu.html', array('block_id' => $iBlockID, 'href' => $a['href'], 'target' => isset($a['target']) ? $a['target'] : '', 'title' => $sTitle)); }
public function __construct($aObject, $oTemplate = false) { parent::__construct($aObject, $oTemplate); $this->_oModule = BxDolModule::getInstance($this->MODULE); $iContentId = 0; if (bx_get('content_id') !== false) { $iContentId = (int) bx_get('content_id'); } $this->addMarkers(array('js_object' => $this->_oModule->_oConfig->getJsObject('manage_tools'), 'content_id' => $iContentId)); }
protected function setUp() { bx_import('BxDolModule'); $this->_oModule = BxDolModule::getInstance('bx_antispam'); $this->_oMockIP = $this->bxMockGet('BxAntispamIP', $this->_oModule->_aModule); $this->_oMockDNSBlacklists = $this->bxMockGet('BxAntispamDNSBlacklists', $this->_oModule->_aModule, true); $this->_oMockDNSURIBlacklists = $this->bxMockGet('BxAntispamDNSURIBlacklists', $this->_oModule->_aModule, true); $this->_oMockStopForumSpam = $this->bxMockGet('BxAntispamStopForumSpam', $this->_oModule->_aModule); $this->_oMockAkismet = $this->bxMockGet('BxAntispamAkismet', $this->_oModule->_aModule); }