function unit($aData, $isCheckPrivateContent = true, $sTemplateName = 'unit.html')
 {
     $oModule = BxDolModule::getInstance($this->MODULE);
     $CNF =& $oModule->_oConfig->CNF;
     if ($isCheckPrivateContent && CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = $oModule->checkAllowedView($aData))) {
         $aVars = array('summary' => $sMsg);
         return $this->parseHtmlByName('unit_private.html', $aVars);
     }
     // get thumb url
     $sPhotoThumb = '';
     if ($aData[$CNF['FIELD_THUMB']]) {
         bx_import('BxDolImageTranscoder');
         $oImagesTranscoder = BxDolImageTranscoder::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW']);
         if ($oImagesTranscoder) {
             $sPhotoThumb = $oImagesTranscoder->getImageUrl($aData[$CNF['FIELD_THUMB']]);
         }
     }
     // get entry url
     bx_import('BxDolPermalinks');
     $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aData[$CNF['FIELD_ID']]);
     bx_import('BxDolProfile');
     $oProfile = BxDolProfile::getInstance($aData[$CNF['FIELD_AUTHOR']]);
     if (!$oProfile) {
         bx_import('BxDolProfileUndefined');
         $oProfile = BxDolProfileUndefined::getInstance();
     }
     // get summary
     $sLinkMore = ' <a title="' . bx_html_attribute(_t('_sys_read_more', $aData[$CNF['FIELD_TITLE']])) . '" href="' . $sUrl . '"><i class="sys-icon ellipsis-h"></i></a>';
     $sSummary = strmaxtextlen($aData[$CNF['FIELD_TEXT']], (int) getParam($CNF['PARAM_CHARS_SUMMARY']), $sLinkMore);
     $sSummaryPlain = BxTemplFunctions::getInstance()->getStringWithLimitedLength(strip_tags($sSummary), (int) getParam($CNF['PARAM_CHARS_SUMMARY_PLAIN']));
     // generate html
     $aVars = array('id' => $aData[$CNF['FIELD_ID']], 'content_url' => $sUrl, 'title' => bx_process_output($aData[$CNF['FIELD_TITLE']]), 'summary' => $sSummary, 'author' => $oProfile->getDisplayName(), 'author_url' => $oProfile->getUrl(), 'entry_posting_date' => bx_time_js($aData[$CNF['FIELD_ADDED']], BX_FORMAT_DATE), 'module_name' => _t($CNF['T']['txt_sample_single']), 'ts' => $aData[$CNF['FIELD_ADDED']], 'bx_if:thumb' => array('condition' => $sPhotoThumb, 'content' => array('title' => bx_process_output($aData[$CNF['FIELD_TITLE']]), 'summary_attr' => bx_html_attribute($sSummaryPlain), 'content_url' => $sUrl, 'thumb_url' => $sPhotoThumb ? $sPhotoThumb : '')), 'bx_if:no_thumb' => array('condition' => !$sPhotoThumb, 'content' => array('content_url' => $sUrl, 'summary_plain' => $sSummaryPlain)));
     return $this->parseHtmlByName($sTemplateName, $aVars);
 }
 /**
  * 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 createAccountForm()
 {
     // check access
     if (CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = BxDolAccount::isAllowedCreate(0))) {
         return MsgBox($sMsg);
     }
     // check and display form
     $oForm = $this->getObjectFormAdd();
     if (!$oForm) {
         return MsgBox(_t('_sys_txt_error_occured'));
     }
     $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-account');
     $oForm->initChecker(self::$PROFILE_FIELDS);
     if (!$oForm->isSubmittedAndValid()) {
         $sCode = $oForm->getCode();
         bx_alert('account', 'add_form', 0, 0, array('form_object' => &$oForm, 'form_code' => &$sCode));
         return $sCode;
     }
     // insert data into database
     $aValsToAdd = array('email_confirmed' => 0);
     $iAccountId = $oForm->insert($aValsToAdd);
     if (!$iAccountId) {
         if (!$oForm->isValid()) {
             return $oForm->getCode();
         } else {
             return MsgBox(_t('_sys_txt_error_account_creation'));
         }
     }
     $iProfileId = $this->onAccountCreated($iAccountId, $oForm->isSetPendingApproval());
     // perform action
     BxDolAccount::isAllowedCreate($iProfileId, true);
     $this->_iProfileId = bx_get_logged_profile_id();
     // redirect
     $this->_redirectAndExit(getParam('sys_redirect_after_account_added'), true, array('account_id' => $iAccountId, 'profile_id' => $iProfileId));
 }
Beispiel #4
0
 protected function genCustomInputSubmitText($aInput)
 {
     return '<div class="bx-form-right-line-aligned">
                 <a href="' . BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password') . '">' . _t("_sys_txt_forgot_pasword") . '</a>
             </div>
             <div class="clear_both"></div>';
 }
Beispiel #5
0
 /**
  * Get menu code.
  * @return string
  */
 public function getCode()
 {
     $aMenuItemSelected = $this->_getSelectedMenuItem();
     if (isset($aMenuItemSelected['set_name']) && 'sys_site' == $aMenuItemSelected['set_name'] && 'home' == $aMenuItemSelected['name']) {
         return '';
     }
     $this->_addJsCss();
     $oMenuSubmenu = BxDolMenu::getObjectInstance($this->_sObjectSubmenu);
     $aVars = array('object' => $this->_sObject, 'id' => 'bx-menu-submenu-menu', 'title' => $aMenuItemSelected['title'], 'link' => BxDolPermalinks::getInstance()->permalink($aMenuItemSelected['link']), 'popup' => $oMenuSubmenu ? BxTemplFunctions::getInstance()->transBox('bx-menu-submenu-menu', '<div class="bx-def-padding">' . $oMenuSubmenu->getCode() . '</div>', true) : '', 'bx_if:menu' => array('condition' => $oMenuSubmenu, 'content' => array()), 'bx_if:image' => array('condition' => false !== strpos($aMenuItemSelected['icon'], '.'), 'content' => array('icon_url' => $aMenuItemSelected['icon'])), 'bx_if:icon' => array('condition' => false === strpos($aMenuItemSelected['icon'], '.'), 'content' => array('icon' => $aMenuItemSelected['icon'])), 'bx_repeat:menus' => array());
     $aMenus = $this->getSubmenuParams($aMenuItemSelected);
     foreach ($aMenus as $aMenu) {
         $sPopupContent = '';
         if (isset($aMenu['object']) && ($oMenu = BxDolMenu::getObjectInstance($aMenu['object']))) {
             $sPopupContent = $oMenu->getCode();
         } elseif (isset($aMenu['service']) && is_array($aMenu['service'])) {
             $sPopupContent = BxDolService::call($aMenu['service']['module'], $aMenu['service']['method'], isset($aMenu['service']['params']) ? $aMenu['service']['params'] : array(), isset($aMenu['service']['class']) ? $aMenu['service']['class'] : 'Module');
         }
         if (!$sPopupContent) {
             continue;
         }
         $aVars['bx_repeat:menus'][] = array('id' => $aMenu['id'], 'icon' => $aMenu['icon'], 'popup' => BxTemplFunctions::getInstance()->transBox($aMenu['id'], '<div class="bx-def-padding">' . $sPopupContent . '</div>', true));
     }
     if (!$aVars['bx_repeat:menus'] && (!$oMenuSubmenu || !$aMenuItemSelected)) {
         return '';
     }
     $sMenu = $this->_oTemplate->parseHtmlByName($this->_aObject['template'], $aVars);
     return $this->_oTemplate->parseHtmlByName('menu_main_submenu_wrapper.html', array('menu' => $sMenu));
 }
Beispiel #6
0
 public function getBlockRequest()
 {
     bx_import('BxDolPermalinks');
     $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($this->_oConfig->CNF['URL_REQUEST']);
     $this->addCss(array('main.css'));
     return $this->parseHtmlByName('block_request.html', array('style_prefix' => $this->_oConfig->getPrefix('style'), 'text' => _t('_bx_invites_txt_request_block_text'), 'bx_if:show_button_request' => array('condition' => $this->_oConfig->isRequestInvite(), 'content' => array('url' => $sUrl))));
 }
Beispiel #7
0
 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();
 }
 public function serviceManageTools($sType = 'common')
 {
     $oGrid = BxDolGrid::getObjectInstance($this->_oConfig->getGridObject($sType));
     if (!$oGrid) {
         return '';
     }
     $CNF =& $this->_oConfig->CNF;
     $sMenu = '';
     if (BxDolAcl::getInstance()->isMemberLevelInSet(192)) {
         $oPermalink = BxDolPermalinks::getInstance();
         $aMenuItems = array();
         if (!empty($CNF['OBJECT_GRID_COMMON']) && !empty($CNF['T']['menu_item_manage_my'])) {
             $aMenuItems[] = array('id' => 'manage-common', 'name' => 'manage-common', 'class' => '', 'link' => $oPermalink->permalink($CNF['URL_MANAGE_COMMON']), 'target' => '_self', 'title' => _t($CNF['T']['menu_item_manage_my']), 'active' => 1);
         }
         if (!empty($CNF['OBJECT_GRID_ADMINISTRATION']) && !empty($CNF['T']['menu_item_manage_all'])) {
             $aMenuItems[] = array('id' => 'manage-administration', 'name' => 'manage-administration', 'class' => '', 'link' => $oPermalink->permalink($CNF['URL_MANAGE_ADMINISTRATION']), 'target' => '_self', 'title' => _t($CNF['T']['menu_item_manage_all']), 'active' => 1);
         }
         if (count($aMenuItems) > 1) {
             $oMenu = new BxTemplMenu(array('template' => 'menu_vertical.html', 'menu_items' => $aMenuItems), $this->_oTemplate);
             $oMenu->setSelected($this->_aModule['name'], 'manage-' . $sType);
             $sMenu = $oMenu->getCode();
         }
     }
     if (!empty($CNF['OBJECT_MENU_SUBMENU'])) {
         BxDolMenu::getObjectInstance($CNF['OBJECT_MENU_SUBMENU'])->setSelected($this->_aModule['name'], $CNF['URI_MANAGE_COMMON']);
     }
     $this->_oTemplate->addCss(array('manage_tools.css'));
     $this->_oTemplate->addJs(array('manage_tools.js'));
     $this->_oTemplate->addJsTranslation(array('_sys_grid_search'));
     return array('content' => $this->_oTemplate->getJsCode('manage_tools', array('sObjNameGrid' => $this->_oConfig->getGridObject($sType))) . $oGrid->getCode(), 'menu' => $sMenu);
 }
 public function serviceLoginForm($sParams = '', $sForceRelocate = '')
 {
     if (isLogged()) {
         return false;
     }
     // get all auth types
     $aAuthTypes = BxDolDb::getInstance()->fromCache('sys_objects_auths', 'getAll', 'SELECT * FROM `sys_objects_auths`');
     $oForm = BxDolForm::getObjectInstance('sys_login', 'sys_login');
     $sCustomHtmlBefore = '';
     $sCustomHtmlAfter = '';
     bx_alert('profile', 'show_login_form', 0, 0, array('oForm' => $oForm, 'sParams' => &$sParams, 'sCustomHtmlBefore' => &$sCustomHtmlBefore, 'sCustomHtmlAfter' => &$sCustomHtmlAfter, 'aAuthTypes' => &$aAuthTypes));
     if ($sForceRelocate && 0 === mb_stripos($sForceRelocate, BX_DOL_URL_ROOT)) {
         $oForm->aInputs['relocate']['value'] = $sForceRelocate;
     } elseif ('homepage' == $sForceRelocate) {
         $oForm->aInputs['relocate']['value'] = BX_DOL_URL_ROOT;
     }
     $sFormCode = $oForm->getCode();
     $sJoinText = '';
     if (strpos($sParams, 'no_join_text') === false) {
         $sJoinText = '<hr class="bx-def-hr bx-def-margin-sec-topbottom" /><div class="bx-def-font-align-center">' . _t('_sys_txt_login_description', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-account')) . '</div>';
     }
     BxDolTemplate::getInstance()->addJs(array('jquery.form.min.js'));
     $sAuth = $this->serviceMemberAuthCode($aAuthTypes);
     return $sCustomHtmlBefore . $sAuth . $sFormCode . $sCustomHtmlAfter . $sJoinText;
 }
Beispiel #10
0
 public function serviceGetContactPageUrl()
 {
     //if (true !== $this->isAllowedContact())
     //    return false;
     bx_import('BxDolPermalinks');
     return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=contact');
 }
Beispiel #11
0
 public function serviceLoginForm($sParams = '', $sForceRelocate = '')
 {
     if (isLogged()) {
         return false;
     }
     // get all auth types
     $aAuthTypes = BxDolDb::getInstance()->fromCache('sys_objects_auths', 'getAll', 'SELECT * FROM `sys_objects_auths`');
     // define additional auth types
     if ($aAuthTypes) {
         $aAddInputEl[''] = _t('_Basic');
         // procces all additional menu's items
         foreach ($aAuthTypes as $iKey => $aItems) {
             $aAddInputEl[$aItems['Link']] = _t($aItems['Title']);
         }
         $aAuthTypes = array('type' => 'select', 'caption' => _t('_Auth type'), 'values' => $aAddInputEl, 'value' => '', 'attrs' => array('onchange' => 'if (this.value) { location.href = "' . BX_DOL_URL_ROOT . '" + this.value }'));
     } else {
         $aAuthTypes = array('type' => 'hidden');
     }
     $oForm = BxDolForm::getObjectInstance('sys_login', 'sys_login');
     $sCustomHtmlBefore = '';
     $sCustomHtmlAfter = '';
     bx_alert('profile', 'show_login_form', 0, 0, array('oForm' => $oForm, 'sParams' => &$sParams, 'sCustomHtmlBefore' => &$sCustomHtmlBefore, 'sCustomHtmlAfter' => &$sCustomHtmlAfter, 'aAuthTypes' => &$aAuthTypes));
     if ($sForceRelocate && 0 === mb_stripos($sForceRelocate, BX_DOL_URL_ROOT)) {
         $oForm->aInputs['relocate']['value'] = $sForceRelocate;
     } elseif ('homepage' == $sForceRelocate) {
         $oForm->aInputs['relocate']['value'] = BX_DOL_URL_ROOT;
     }
     $sFormCode = $oForm->getCode();
     $sJoinText = '';
     if (strpos($sParams, 'no_join_text') === false) {
         $sJoinText = '<hr class="bx-def-hr bx-def-margin-sec-topbottom" /><div>' . _t('_sys_txt_login_description', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-account')) . '</div>';
     }
     BxDolTemplate::getInstance()->addJs(array('jquery.form.min.js'));
     return $sCustomHtmlBefore . $sFormCode . $sCustomHtmlAfter . $sJoinText;
 }
Beispiel #12
0
 protected function _redirectAndExit($sUrl, $isPermalink = true, $aMarkers = false)
 {
     if ($isPermalink) {
         $sUrl = BxDolPermalinks::getInstance()->permalink($sUrl);
     }
     header('Location: ' . BX_DOL_URL_ROOT . $this->_replaceMarkers($sUrl, $aMarkers));
     exit;
 }
 function getRssPageUrl()
 {
     if (false === parent::getRssPageUrl()) {
         return false;
     }
     $oPermalinks = BxDolPermalinks::getInstance();
     return BX_DOL_URL_ROOT . $oPermalinks->permalink($this->aCurrent['rss']['link']);
 }
 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')));
 }
 protected function _getActionEdit($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
 {
     $CNF =& $this->_oModule->_oConfig->CNF;
     bx_import('BxDolPermalinks');
     $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_EDIT_ENTRY'] . '&id=' . $aRow[$CNF['FIELD_ID']]);
     $a['attr'] = array_merge($a['attr'], array("onclick" => "window.open('" . $sUrl . "','_self');"));
     return $this->_getActionDefault($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
 }
Beispiel #16
0
 function __construct()
 {
     parent::__construct();
     $oTemplate = BxDolStudioTemplate::getInstance();
     $this->aVisible[BX_DOL_STUDIO_MT_LEFT] = true;
     $this->aVisible[BX_DOL_STUDIO_MT_RIGHT] = true;
     $this->aItems[BX_DOL_STUDIO_MT_LEFT] = $oTemplate->parseHtmlByName('splash_logo.html', array());
     $this->aItems[BX_DOL_STUDIO_MT_RIGHT] = array('site' => array('name' => 'profile', 'icon' => 'user', 'link' => BxDolPermalinks::getInstance()->permalink('page.php?i=create-account'), 'title' => ''));
 }
Beispiel #17
0
 protected function _getActionAdd($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
 {
     $oModule = BxDolModule::getInstance($this->MODULE);
     $CNF =& $oModule->_oConfig->CNF;
     $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_ADD_ENTRY']);
     $a['attr']['onclick'] = "document.location='{$sUrl}'";
     unset($a['attr']['bx_grid_action_independent']);
     return parent::_getActionDefault($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
 }
 protected function _getTemplateVars()
 {
     $aVars = parent::_getTemplateVars();
     $aVars['bx_repeat:menu_items'] = array(true);
     $aVars['profile_display_name'] = BxDolProfile::getInstance()->getDisplayName();
     $aVars['url_switch_profile'] = BxDolPermalinks::getInstance()->permalink('page.php?i=account-profile-switcher');
     $aVars['menu_account'] = BxDolMenu::getObjectInstance('sys_account')->getCode();
     $aVars['menu_notifications'] = BxDolMenu::getObjectInstance('sys_account_notifications')->getCode();
     return $aVars;
 }
 protected function _getActionEdit($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
 {
     if ($this->_sManageType == BX_DOL_MANAGE_TOOLS_ADMINISTRATION && $this->_oModule->checkAllowedEditAnyEntry() !== CHECK_ACTION_RESULT_ALLOWED) {
         return '';
     }
     $CNF =& $this->_oModule->_oConfig->CNF;
     $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_EDIT_ENTRY'] . '&id=' . $aRow[$CNF['FIELD_ID']]);
     $a['attr'] = array_merge($a['attr'], array("onclick" => "window.open('" . $sUrl . "','_self');"));
     return $this->_getActionDefault($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
 }
Beispiel #20
0
function getPageMainCode()
{
    $oTemplate = BxDolTemplate::getInstance();
    $bEnabled = getParam('sys_site_cover_enabled');
    if (!$bEnabled) {
        $oTemplate->displayPageNotFound();
    }
    $oTemplate->addJs(array('skrollr/skrollr.min.js'));
    return $oTemplate->parseHtmlByContent(getParam('sys_site_cover_code'), array('join_link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-account'), 'login_form' => BxDolService::call('system', 'login_form', array(), 'TemplServiceLogin')));
}
 function __construct($sMode = '', $aParams = array())
 {
     $this->aUnitViews = array('extended' => 'unit.html');
     if (empty($aParams['unit_view'])) {
         $aParams['unit_view'] = 'extended';
     }
     parent::__construct($sMode, $aParams);
     $this->aCurrent = array('name' => 'bx_albums', 'module_name' => 'bx_albums', 'object_metatags' => 'bx_albums', 'title' => _t('_bx_albums_page_title_browse'), 'table' => 'bx_albums_albums', 'ownFields' => array('id', 'title', 'text', 'thumb', 'author', 'added'), 'searchFields' => array('title', 'text'), 'restriction' => array('author' => array('value' => '', 'field' => 'author', 'operator' => '='), 'status' => array('value' => 'active', 'field' => 'status', 'operator' => '=')), 'paginate' => array('perPage' => getParam('bx_albums_per_page_browse'), 'start' => 0), 'sorting' => 'last', 'rss' => array('title' => '', 'link' => '', 'image' => '', 'profile' => 0, 'fields' => array('Guid' => 'link', 'Link' => 'link', 'Title' => 'title', 'DateTimeUTS' => 'added', 'Desc' => 'text')), 'ident' => 'id');
     $this->sFilterName = 'bx_albums_filter';
     $this->oModule = $this->getMain();
     $oProfileAuthor = null;
     $CNF =& $this->oModule->_oConfig->CNF;
     switch ($sMode) {
         case 'author':
             $oProfileAuthor = BxDolProfile::getInstance((int) $aParams['author']);
             if (!$oProfileAuthor) {
                 $this->isError = true;
                 break;
             }
             $this->aCurrent['restriction']['author']['value'] = $oProfileAuthor->id();
             $this->sBrowseUrl = 'page.php?i=' . $CNF['URI_AUTHOR_ENTRIES'] . '&profile_id={profile_id}';
             $this->aCurrent['title'] = _t('_bx_albums_page_title_browse_by_author');
             $this->aCurrent['rss']['link'] = 'modules/?r=albums/rss/' . $sMode . '/' . $oProfileAuthor->id();
             break;
         case 'public':
             $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
             $this->aCurrent['title'] = _t('_bx_albums_page_title_browse_recent');
             $this->aCurrent['rss']['link'] = 'modules/?r=albums/rss/' . $sMode;
             break;
         case 'popular':
             $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_POPULAR']);
             $this->aCurrent['title'] = _t('_bx_albums_page_title_browse_popular');
             $this->aCurrent['rss']['link'] = 'modules/?r=albums/rss/' . $sMode;
             $this->aCurrent['sorting'] = 'popular';
             break;
         case 'updated':
             $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_UPDATED']);
             $this->aCurrent['title'] = _t('_bx_albums_page_title_browse_updated');
             $this->aCurrent['rss']['link'] = 'modules/?r=albums/rss/' . $sMode;
             $this->aCurrent['sorting'] = 'updated';
             break;
         case '':
             // search results
             $this->sBrowseUrl = BX_DOL_SEARCH_KEYWORD_PAGE;
             $this->aCurrent['title'] = _t('_bx_albums');
             $this->aCurrent['paginate']['perPage'] = 3;
             unset($this->aCurrent['rss']);
             break;
         default:
             $sMode = '';
             $this->isError = true;
     }
     $this->processReplaceableMarkers($oProfileAuthor);
     $this->addConditionsForPrivateContent($CNF, $oProfileAuthor);
 }
 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' => ''));
     }
 }
 /**
  * Class constructor.
  */
 protected function __construct()
 {
     if (isset($GLOBALS['bxDolClasses'][get_class($this)])) {
         trigger_error('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
     }
     parent::__construct();
     $oLang = BxDolLanguages::getInstance();
     $this->iDefaultLangId = $oLang->getCurrentLangId();
     $this->iFallbackLangId = $oLang->getLangId('en');
     $sAboutUsLink = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=about');
     $this->aDefaultKeys = array('site_url' => BX_DOL_URL_ROOT, 'site_name' => getParam('site_title'), 'about_us' => '<a href="' . $sAboutUsLink . '">' . _t('_sys_et_txt_about_us') . '</a>');
     $this->_oEmailTemplatesQuery = BxDolEmailTemplatesQuery::getInstance();
 }
Beispiel #24
0
/**
 * page code function
 */
function PageCompMainCode()
{
    ob_start();
    $oPermalinks = BxDolPermalinks::getInstance();
    $a = array('http://192.168.1.215/d8/page/create-account', 'http://192.168.1.215/d8/page.php?i=create-account', 'http://192.168.1.215/d8/page.php?o=create-account', '/d8/page/create-account', '/d8/page.php?i=create-account', '/d8/page.php?o=create-account', 'page/create-account', 'page.php?i=create-account', 'page.php?o=create-account');
    foreach ($a as $sLink) {
        echo '<hr /><b>Original:</b> ' . $sLink . '<br />';
        echo '<b>UNpermalinked:</b> ' . ($sLink = $oPermalinks->unpermalink($sLink)) . '<br />';
        echo '<b>Page Name:</b> ' . $oPermalinks->getPageNameFromLink($sLink) . '<br />';
        echo '<b>Permalinked:</b> ' . ($sLink = $oPermalinks->permalink($sLink)) . '<br />';
    }
    return DesignBoxContent("Permalinks", ob_get_clean(), BX_DB_PADDING_DEF);
}
Beispiel #25
0
 public function setSubmenu($sSelected)
 {
     $oSubmenuSystem = BxDolMenu::getObjectInstance('sys_site_submenu');
     if (!$oSubmenuSystem) {
         return;
     }
     $CNF =& $this->_oConfig->CNF;
     $oSubmenuSystem->setObjectSubmenu($CNF['OBJECT_MENU_SUBMENU'], array('title' => _t('_bx_ntfs'), 'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']), 'icon' => ''));
     $oSubmenuModule = BxDolMenu::getObjectInstance($CNF['OBJECT_MENU_SUBMENU']);
     if ($oSubmenuModule) {
         $oSubmenuModule->setSelected($this->_oConfig->getName(), $sSelected);
     }
 }
 function getLoginForm()
 {
     $oTemplate = BxDolStudioTemplate::getInstance();
     $sUrlRelocate = bx_get('relocate');
     if (empty($sUrlRelocate) || basename($sUrlRelocate) == 'index.php') {
         $sUrlRelocate = '';
     }
     $oTemplate->addJsTranslation(array('_adm_txt_login_username', '_adm_txt_login_password'));
     $sHtml = $oTemplate->parseHtmlByName('login_form.html', array('role' => BX_DOL_ROLE_ADMIN, 'csrf_token' => BxDolForm::genCsrfToken(true), 'relocate_url' => bx_html_attribute($sUrlRelocate), 'action_url' => BX_DOL_URL_ROOT . 'member.php', 'forgot_password_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password')));
     $sHtml = $oTemplate->parseHtmlByName('login.html', array('form' => $this->transBox('bx-std-login-form-box', $sHtml, true)));
     $oTemplate->setPageNameIndex(BX_PAGE_CLEAR);
     $oTemplate->setPageParams(array('css_name' => array('forms.css', 'login.css'), 'js_name' => array('jquery-ui/jquery.ui.position.min.js', 'jquery.form.min.js', 'jquery.dolPopup.js', 'login.js'), 'header' => _t('_adm_page_cpt_login')));
     $oTemplate->setPageContent('page_main_code', $sHtml);
     $oTemplate->getPageCode();
 }
Beispiel #27
0
 /**
  * Check if email is uniq.
  */
 function checkEmailUniq($s)
 {
     if (!$this->checkEmail($s)) {
         return false;
     }
     $oAccount = BxDolAccount::getInstance();
     if ($oAccount) {
         // user is logged in
         $aAccountInfo = $oAccount->getInfo();
         if ($s == $aAccountInfo['email']) {
             // don't check email for uniq, if it wasn't changed
             return true;
         }
         return BxDolAccountQuery::getInstance()->getIdByEmail($s) ? _t('_sys_form_account_input_email_uniq_error_loggedin') : true;
     }
     return BxDolAccountQuery::getInstance()->getIdByEmail($s) ? _t('_sys_form_account_input_email_uniq_error', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password')) : true;
 }
Beispiel #28
0
 /**
  * get comments list for specified parent comment
  *
  * @param array $aBp - browse params array
  * @param array $aDp - display params array
  *
  */
 function getComments($aBp = array(), $aDp = array())
 {
     $this->_prepareParams($aBp, $aDp);
     $aCmts = $this->getCommentsArray($aBp['vparent_id'], $aBp['filter'], $aBp['order'], $aBp['start'], $aBp['per_view']);
     if (empty($aCmts) || !is_array($aCmts)) {
         if ((int) $aBp['parent_id'] == 0 && !isLogged()) {
             $oPermalink = BxDolPermalinks::getInstance();
             return MsgBox(_t('_cmt_msg_login_required', $oPermalink->permalink('page.php?i=login'), $oPermalink->permalink('page.php?i=create-account')));
         }
         return isset($aDp['show_empty']) && $aDp['show_empty'] === true ? $this->_getEmpty() : '';
     }
     $sCmts = '';
     foreach ($aCmts as $k => $aCmt) {
         $sCmts .= $this->getComment($aCmt, $aBp, $aDp);
     }
     $sCmts = $this->_getMoreLink($sCmts, $aBp, $aDp);
     return $sCmts;
 }
Beispiel #29
0
 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'));
 }
 function unit($aData, $isCheckPrivateContent = true, $sTemplateName = 'unit.html', $aParams = array())
 {
     $oModule = BxDolModule::getInstance($this->MODULE);
     $CNF =& $oModule->_oConfig->CNF;
     if ($s = $this->checkPrivacy($aData, $isCheckPrivateContent, $oModule)) {
         return $s;
     }
     // get thumb url
     $sPhotoThumb = '';
     $sPhotoGallery = '';
     if ($aData[$CNF['FIELD_THUMB']]) {
         $oImagesTranscoder = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW']);
         if ($oImagesTranscoder) {
             $sPhotoThumb = $oImagesTranscoder->getFileUrl($aData[$CNF['FIELD_THUMB']]);
         }
         $oImagesTranscoder = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_GALLERY']);
         if ($oImagesTranscoder) {
             $sPhotoGallery = $oImagesTranscoder->getFileUrl($aData[$CNF['FIELD_THUMB']]);
         } else {
             $sPhotoGallery = $sPhotoThumb;
         }
     }
     // get entry url
     $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aData[$CNF['FIELD_ID']]);
     $oProfile = BxDolProfile::getInstance($aData[$CNF['FIELD_AUTHOR']]);
     if (!$oProfile) {
         $oProfile = BxDolProfileUndefined::getInstance();
     }
     // get summary
     $sLinkMore = ' <a title="' . bx_html_attribute(_t('_sys_read_more', $aData[$CNF['FIELD_TITLE']])) . '" href="' . $sUrl . '"><i class="sys-icon ellipsis-h"></i></a>';
     $sSummary = strmaxtextlen($aData[$CNF['FIELD_TEXT']], (int) getParam($CNF['PARAM_CHARS_SUMMARY']), $sLinkMore);
     $sSummaryPlain = BxTemplFunctions::getInstance()->getStringWithLimitedLength(strip_tags($sSummary), (int) getParam($CNF['PARAM_CHARS_SUMMARY_PLAIN']));
     $sText = $aData[$CNF['FIELD_TEXT']];
     if (!empty($CNF['OBJECT_METATAGS'])) {
         $oMetatags = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS']);
         // keywords
         if ($oMetatags->keywordsIsEnabled()) {
             $sText = $oMetatags->keywordsParse($aData[$CNF['FIELD_ID']], $sText);
         }
     }
     // generate html
     $aVars = array('id' => $aData[$CNF['FIELD_ID']], 'content_url' => $sUrl, 'title' => bx_process_output($aData[$CNF['FIELD_TITLE']]), 'summary' => $sSummary, 'text' => $sText, 'author' => $oProfile->getDisplayName(), 'author_url' => $oProfile->getUrl(), 'entry_posting_date' => bx_time_js($aData[$CNF['FIELD_ADDED']], BX_FORMAT_DATE), 'module_name' => _t($CNF['T']['txt_sample_single']), 'ts' => $aData[$CNF['FIELD_ADDED']], 'bx_if:thumb' => array('condition' => $sPhotoThumb, 'content' => array('title' => bx_process_output($aData[$CNF['FIELD_TITLE']]), 'summary_attr' => bx_html_attribute($sSummaryPlain), 'content_url' => $sUrl, 'thumb_url' => $sPhotoThumb ? $sPhotoThumb : '', 'gallery_url' => $sPhotoGallery ? $sPhotoGallery : '', 'strecher' => str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ', 40))), 'bx_if:no_thumb' => array('condition' => !$sPhotoThumb, 'content' => array('content_url' => $sUrl, 'summary_plain' => $sSummaryPlain, 'strecher' => mb_strlen($sSummaryPlain) > 240 ? '' : str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ', round((240 - mb_strlen($sSummaryPlain)) / 6)))));
     return $this->parseHtmlByName($sTemplateName, $aVars);
 }