本文整理汇总了PHP中BxDolPermalinks类的典型用法代码示例。如果您正苦于以下问题:PHP BxDolPermalinks类的具体用法?PHP BxDolPermalinks怎么用?PHP BxDolPermalinks使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BxDolPermalinks类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMainMenu
function getMainMenu()
{
if (!isAdmin()) {
return '';
}
$sUri = $_SERVER['REQUEST_URI'];
$sPath = parse_url(BX_DOL_URL_ROOT, PHP_URL_PATH);
if ($sPath && $sPath != '/' && 0 == strncmp($sPath, $sUri, strlen($sPath))) {
$sUri = substr($sUri, strlen($sPath) - strlen($sUri));
}
$sUri = BX_DOL_URL_ROOT . $sUri;
$sFile = basename($_SERVER['PHP_SELF']);
$oPermalinks = new BxDolPermalinks();
$aMenu = $GLOBALS['MySQL']->getAll("SELECT `id`, `name`, `title`, `url`, `icon` FROM `sys_menu_admin` WHERE `parent_id`='0' ORDER BY `order`");
$aItems = array();
foreach ($aMenu as $aMenuItem) {
$aMenuItem['url'] = str_replace(array('{siteUrl}', '{siteAdminUrl}'), array(BX_DOL_URL_ROOT, BX_DOL_URL_ADMIN), $aMenuItem['url']);
$bActiveCateg = $sFile == 'index.php' && !empty($_GET['cat']) && $_GET['cat'] == $aMenuItem['name'];
$aSubmenu = $GLOBALS['MySQL']->getAll("SELECT * FROM `sys_menu_admin` WHERE `parent_id`='" . $aMenuItem['id'] . "' ORDER BY `order`");
$aSubitems = array();
foreach ($aSubmenu as $aSubmenuItem) {
$aSubmenuItem['url'] = $oPermalinks->permalink($aSubmenuItem['url']);
$aSubmenuItem['url'] = str_replace(array('{siteUrl}', '{siteAdminUrl}'), array(BX_DOL_URL_ROOT, BX_DOL_URL_ADMIN), $aSubmenuItem['url']);
if (!defined('BX_DOL_ADMIN_INDEX') && $aSubmenuItem['url'] != '' && (strpos($sUri, $aSubmenuItem['url']) !== false || strpos($aSubmenuItem['url'], $sUri) !== false)) {
$bActiveCateg = $bActiveItem = true;
} else {
$bActiveItem = false;
}
$aSubitems[] = BxDolAdminMenu::_getMainMenuSubitem($aSubmenuItem, $bActiveItem);
}
$aItems[] = BxDolAdminMenu::_getMainMenuItem($aMenuItem, $aSubitems, $bActiveCateg);
}
return $GLOBALS['oAdmTemplate']->parseHtmlByName('main_menu.html', array('bx_repeat:items' => $aItems));
}
示例2: getUserMusicLink
function getUserMusicLink()
{
global $sRootURL;
if (BxDolInstallerUtils::isModuleInstalled("sounds")) {
$oDolPermalinks = new BxDolPermalinks();
return $sRootURL . $oDolPermalinks->permalink("modules?r=sounds/") . "browse/owner/#nick#";
}
return "";
}
示例3: getUserMusicLink
function getUserMusicLink()
{
global $sRootURL;
if (isModuleAvailable("sounds")) {
$oDolPermalinks = new BxDolPermalinks();
return $sRootURL . $oDolPermalinks->permalink("modules?r=sounds/") . "browse/owner/#nick#";
}
return "";
}
示例4: __construct
/**
* constructor
*/
function __construct($aModule)
{
$this->_iId = empty($aModule['id']) ? 0 : (int) $aModule['id'];
$this->_sVendor = $aModule['vendor'];
$this->_sClassPrefix = $aModule['class_prefix'];
$this->_sDbPrefix = $aModule['db_prefix'];
$this->_sDirectory = $aModule['path'];
$this->_sHomePath = BX_DIRECTORY_PATH_MODULES . $this->_sDirectory;
$this->_sClassPath = $this->_sHomePath . 'classes/';
$this->_sUri = $aModule['uri'];
$this->_sHomeUrl = BX_DOL_URL_MODULES . $this->_sDirectory;
$oPermalinks = new BxDolPermalinks();
$this->_sBaseUri = $oPermalinks->permalink('modules/?r=' . $this->_sUri . '/');
}
示例5: getCode
/**
* 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));
}
示例6: __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();
}
示例7: createAccountForm
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));
}
示例8: getBlockRequest
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))));
}
示例9: serviceManageTools
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);
}
示例10: unit
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);
}
示例11: serviceLoginForm
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;
}
示例12: genCustomInputSubmitText
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>';
}
示例13: serviceLoginForm
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;
}
示例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: serviceGetContactPageUrl
public function serviceGetContactPageUrl()
{
//if (true !== $this->isAllowedContact())
// return false;
bx_import('BxDolPermalinks');
return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=contact');
}