コード例 #1
0
 function getPageCode($bHidden = false)
 {
     bx_import('BxTemplPage');
     $oPage = BxTemplPage::getObjectInstance($this->sPage);
     $oTemplate = BxDolStudioTemplate::getInstance();
     $sJsObject = $this->getPageJsObject();
     $sTxtEmpty = _t('_sys_txt_empty');
     $sContent = "";
     if (($bPage = $this->sPage != '') === true) {
         $aTmplVars = array();
         for ($i = 1; $i <= $this->aPageRebuild['layout_cells_number']; $i++) {
             $aBlocks = array();
             $this->oDb->getBlocks(array('type' => 'by_object_cell', 'object' => $this->aPageRebuild['object'], 'cell' => $i), $aBlocks, false);
             $aTmplVarsCell = array('id' => $i, 'bx_repeat:blocks' => array());
             foreach ($aBlocks as $aBlock) {
                 $sTitle = $oPage->getBlockTitle($aBlock);
                 list($sIcon, $sIconUrl) = $this->getBlockIcon($aBlock);
                 $aTmplVarsCell['bx_repeat:blocks'][] = array('html_id' => $this->aHtmlIds['block_id'] . $aBlock['id'], 'bx_if:is_inactive' => array('condition' => (int) $aBlock['active'] == 0, 'content' => array()), 'bx_if:show_link' => array('condition' => true, 'content' => array('onclick' => $sJsObject . ".performAction('block_edit', {id: " . $aBlock['id'] . "})", 'title' => !empty($sTitle) ? $sTitle : $sTxtEmpty)), 'bx_if:show_text' => array('condition' => false, 'content' => array()), 'bx_if:image' => array('condition' => (bool) $sIconUrl, 'content' => array('icon_url' => $sIconUrl)), 'bx_if:icon' => array('condition' => (bool) $sIcon, 'content' => array('icon' => $sIcon)), 'module' => $this->getModuleTitle($aBlock['module']), 'visible_for' => _t('_adm_bp_txt_visible_for', BxDolStudioUtils::getVisibilityTitle($aBlock['visible_for_levels'])), 'bx_if:show_checkbox' => array('condition' => false, 'content' => array()), 'bx_if:show_drag_handle' => array('condition' => true, 'content' => array()));
             }
             $aTmplVars['cell_' . $i] = $oTemplate->parseHtmlByName('bp_cell.html', $aTmplVarsCell);
         }
         $sContent = $oTemplate->parseHtmlByName($this->aPageRebuild['layout_template'], $aTmplVars);
     }
     bx_import('BxDolStudioLanguagesUtils');
     $aLanguages = BxDolStudioLanguagesUtils::getInstance()->getLanguages();
     $aTmplVars = array('js_object' => $sJsObject, 'action_url' => $this->sBaseUrl, 'page_url' => sprintf($this->sPageUrl, '{0}', '{1}'), 'type' => $this->sType, 'page' => $this->sPage, 'html_ids' => json_encode($this->aHtmlIds), 'languahes' => json_encode($aLanguages), 'bx_repeat:blocks' => array(array('caption' => '', 'panel_top' => $this->getBlockPanelTop(), 'items' => $sContent, 'panel_bottom' => '')));
     $oTemplate->addJsTranslation(array('_adm_bp_wrn_page_delete', '_adm_bp_wrn_page_block_delete'));
     return $oTemplate->parseHtmlByName('builder_page.html', $aTmplVars);
 }
コード例 #2
0
 public function __construct($aObject, $oTemplate = false)
 {
     parent::__construct($aObject, $oTemplate);
     // get profile info
     $iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
     if ($iProfileId) {
         $this->_oProfile = BxDolProfile::getInstance($iProfileId);
         $this->_aProfileInfo = $this->_oProfile ? $this->_oProfile->getInfo() : false;
     }
     if (!$this->_aProfileInfo || !$this->_oProfile) {
         return;
     }
     // select view profile submenu
     $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu');
     if ($oMenuSubmenu) {
         $oMenuSubmenu->setObjectSubmenu('bx_persons_view_submenu', array('title' => $this->_oProfile->getDisplayName(), 'link' => $this->_oProfile->getUrl(), 'icon' => $this->_oProfile->getIcon()));
     }
     // add replaceable markers
     $this->addMarkers($this->_aProfileInfo);
     // every profile field can be used as marker
     $this->addMarkers(array('profile_id' => $this->_oProfile->id()));
     // profile id field is also suported
     $this->addMarkers(array('display_name' => $this->_oProfile->getDisplayName()));
     // profile display name is also suported
 }
コード例 #3
0
ファイル: BxNtfsPageView.php プロジェクト: blas-dmx/trident
 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');
 }
コード例 #4
0
 public function getCode()
 {
     // check if content exists
     if (!$this->_aContentInfo) {
         // if entry is not found - display standard "404 page not found" page
         $this->_oTemplate->displayPageNotFound();
         exit;
     }
     // permissions check
     if (CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = $this->_oModule->checkAllowedView($this->_aContentInfo))) {
         $this->_oTemplate->displayAccessDenied($sMsg);
         exit;
     }
     $this->_oModule->checkAllowedView($this->_aContentInfo, true);
     // count views
     $CNF =& $this->_oModule->_oConfig->CNF;
     if (!empty($CNF['OBJECT_VIEWS'])) {
         BxDolView::getObjectInstance($CNF['OBJECT_VIEWS'], $this->_aContentInfo[$CNF['FIELD_ID']])->doView();
     }
     // add content metatags
     if (!empty($CNF['OBJECT_METATAGS'])) {
         $o = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS']);
         if ($o) {
             $o->metaAdd($this->_aContentInfo[$CNF['FIELD_ID']], $this->_getThumbForMetaObject());
         }
     }
     $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu');
     // add actions menu to submenu
     if (isset($CNF['OBJECT_MENU_ACTIONS_VIEW_ENTRY_POPUP'])) {
         $oMenuSubmenu->setObjectActionsMenu($CNF['OBJECT_MENU_ACTIONS_VIEW_ENTRY_POPUP']);
     }
     // add social sharing menu to submenu
     $oMenuSubmenu->setServiceSocialSharing(array('module' => $this->MODULE, 'method' => 'entity_social_sharing'));
     return parent::getCode();
 }
コード例 #5
0
 public function getCode()
 {
     // check if content exists
     if (!$this->_aContentInfo) {
         // if entry is not found - display standard "404 page not found" page
         $this->_oTemplate->displayPageNotFound();
         exit;
     }
     // permissions check
     if (CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = $this->_oModule->checkAllowedView($this->_aContentInfo))) {
         $this->_oTemplate->displayAccessDenied($sMsg);
         exit;
     }
     $this->_oModule->checkAllowedView($this->_aContentInfo, true);
     // count views
     $CNF =& $this->_oModule->_oConfig->CNF;
     if (!empty($CNF['OBJECT_VIEWS'])) {
         bx_import('BxDolView');
         BxDolView::getObjectInstance($CNF['OBJECT_VIEWS'], $this->_aContentInfo[$CNF['FIELD_ID']])->doView();
     }
     // add content metatags
     if (!empty($CNF['OBJECT_METATAGS'])) {
         bx_import('BxDolMetatags');
         $o = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS']);
         if ($o) {
             $aThumb = false;
             if (!empty($CNF['FIELD_THUMB']) && !empty($this->_aContentInfo[$CNF['FIELD_THUMB']]) && !empty($CNF['OBJECT_STORAGE'])) {
                 $aThumb = array('id' => $this->_aContentInfo[$CNF['FIELD_THUMB']], 'object' => $CNF['OBJECT_STORAGE']);
             }
             $o->metaAdd($this->_aContentInfo[$CNF['FIELD_ID']], $aThumb);
         }
     }
     return parent::getCode();
 }
コード例 #6
0
ファイル: BxBasePageHome.php プロジェクト: blas-dmx/trident
 protected function _addJsCss()
 {
     parent::_addJsCss();
     if (isAdmin()) {
         $this->_oTemplate->addJs('shepherd/shepherd.min.js');
         $this->_oTemplate->addCss(array('homepage.css', BX_DIRECTORY_PATH_PLUGINS_PUBLIC . 'shepherd/css/|shepherd-theme-' . $this->_sTourTheme . '.css'));
     }
 }
コード例 #7
0
 protected function _getBlockCode($aBlock)
 {
     $sAdd = '';
     if ('service' == $aBlock['type'] && $aBlock['content']) {
         $sAdd = '<a id="top" class="bx-anchor-invisible">&nbsp;</a>';
     }
     return $sAdd . parent::_getBlockCode($aBlock);
 }
コード例 #8
0
 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']);
 }
コード例 #9
0
 public function __construct($aObject, $oTemplate)
 {
     parent::__construct($aObject, $oTemplate);
     // set dashboard submenu
     bx_import('BxDolMenu');
     bx_import('BxDolPermalinks');
     $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu');
     if ($oMenuSubmenu) {
         $oMenuSubmenu->setObjectSubmenu('sys_account_dashboard_submenu', array('title' => _t('_sys_menu_item_title_account_dashboard'), 'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=dashboard'), 'icon' => ''));
     }
 }
コード例 #10
0
 public function getCode()
 {
     if (!$this->_aContentInfo) {
         // if entry is not found - display standard "404 page not found" page
         $this->_oTemplate->displayPageNotFound();
         exit;
     }
     if (CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = $this->_oModule->checkAllowedView($this->_aContentInfo))) {
         $this->_oTemplate->displayAccessDenied($sMsg);
         exit;
     }
     $this->_oModule->checkAllowedView($this->_aContentInfo, true);
     if (!empty($CNF['OBJECT_VIEWS'])) {
         bx_import('BxDolView');
         BxDolView::getObjectInstance($CNF['OBJECT_VIEWS'], $this->_aContentInfo[$CNF['FIELD_ID']])->doView();
     }
     return parent::getCode();
 }
コード例 #11
0
 public function __construct($aObject, $oTemplate)
 {
     parent::__construct($aObject, $oTemplate);
     bx_import('BxDolProfile');
     $oProfile = BxDolProfile::getInstance();
     $aProfileInfo = $oProfile ? $oProfile->getInfo() : false;
     $this->addMarkers(array('account_id' => $aProfileInfo ? $aProfileInfo['account_id'] : 0, 'profile_id' => $aProfileInfo ? $aProfileInfo['id'] : 0, 'profile_type' => $aProfileInfo ? $aProfileInfo['type'] : 0, 'profile_content_id' => $aProfileInfo ? $aProfileInfo['content_id'] : 0));
     // set settings submenu
     bx_import('BxDolMenu');
     $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu');
     if ($oMenuSubmenu) {
         $oMenuSubmenu->setObjectSubmenu('sys_account_settings_submenu', array('title' => _t('_sys_menu_item_title_account_settings'), 'link' => BX_DOL_URL_ROOT . 'member.php', 'icon' => ''));
     }
     // display message if profile isn't active
     if ($oProfile) {
         $sStatus = $oProfile->getStatus();
         if (isset($this->_aMapStatus2LangKey[$sStatus])) {
             bx_import('BxDolInformer');
             $oInformer = BxDolInformer::getInstance($this->_oTemplate);
             if ($oInformer) {
                 $oInformer->add('sys-account-status-not-active', _t($this->_aMapStatus2LangKey[$sStatus]), BX_INFORMER_ALERT);
             }
         }
     }
     // switch profile context
     if ($iSwitchToProfileId = (int) bx_get('switch_to_profile')) {
         bx_import('BxDolInformer');
         $oInformer = BxDolInformer::getInstance($this->_oTemplate);
         $oProfile = BxDolProfile::getInstance($iSwitchToProfileId);
         $sInformerMsg = '';
         if ($oProfile && $oProfile->getAccountId() == getLoggedId()) {
             bx_import('BxDolProfile');
             $oAccount = BxDolAccount::getInstance();
             if ($oAccount->updateProfileContext($iSwitchToProfileId)) {
                 $sInformerMsg = _t('_sys_txt_account_profile_context_changed_success', $oProfile->getDisplayName());
             }
         }
         if ($oInformer) {
             $oInformer->add('sys-account-profile-context-change-result', $sInformerMsg ? $sInformerMsg : _t('_error occured'), $sInformerMsg ? BX_INFORMER_INFO : BX_INFORMER_ERROR);
         }
     }
 }
コード例 #12
0
 public function __construct($aObject, $oTemplate)
 {
     parent::__construct($aObject, $oTemplate);
 }
コード例 #13
0
 public function __construct($aObject, $oTemplate)
 {
     parent::__construct($aObject, $oTemplate);
     $this->addMarkers(array('site_title' => getParam('site_title')));
 }
コード例 #14
0
 protected function _addJsCss()
 {
     parent::_addJsCss();
     $this->_oModule->_oTemplate->addCss(array(BX_DIRECTORY_PATH_PLUGINS_PUBLIC . 'photo-swipe/|photoswipe.css', BX_DIRECTORY_PATH_PLUGINS_PUBLIC . 'photo-swipe/default-skin/|default-skin.css'));
     $this->_oModule->_oTemplate->addJs(array('media_view.js', 'history.js', 'photo-swipe/photoswipe.min.js', 'photo-swipe/photoswipe-ui-default.min.js'));
 }