本文整理汇总了PHP中bx_html_attribute函数的典型用法代码示例。如果您正苦于以下问题:PHP bx_html_attribute函数的具体用法?PHP bx_html_attribute怎么用?PHP bx_html_attribute使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bx_html_attribute函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getGhostTemplateVars
protected function getGhostTemplateVars($aFile, $iProfileId, $iContentId, $oStorage, $oImagesTranscoder)
{
$sTitle = $this->_oModule->_oDb->getFileTitle($aFile['id']);
$a = array('file_title' => $sTitle ? $sTitle : $aFile['file_name']);
$a['file_title_attr'] = bx_html_attribute($a['file_title']);
return $a;
}
示例2: getBlockCode_Cover
function getBlockCode_Cover()
{
$bUseFeatured = $this->oConfig->getGlParam('cover_featured') == 'on';
$iRows = (int) $this->oConfig->getGlParam('cover_rows');
$iColumns = (int) $this->oConfig->getGlParam('cover_columns');
$iExcess = 20;
$iCountRequired = $iRows * $iColumns + $iExcess;
$this->oSearch->clearFilters(array('activeStatus', 'allow_view', 'album_status', 'albumType', 'ownerStatus'), array('albumsObjects', 'albums'));
if ($bUseFeatured) {
$this->oSearch->aCurrent['restriction']['featured'] = array('field' => 'Featured', 'value' => '1', 'operator' => '=', 'param' => 'featured');
}
$this->oSearch->aCurrent['paginate']['perPage'] = $iCountRequired;
$aFiles = $this->oSearch->getSearchData();
if (empty($aFiles)) {
return '';
}
$iCount = count($aFiles);
if ($iCount < $iCountRequired) {
while ($iCount < $iCountRequired) {
$aFiles = array_merge($aFiles, $aFiles);
$iCount = count($aFiles);
}
}
$sViewUrl = BX_DOL_URL_ROOT . $this->oModule->_oConfig->getBaseUri() . 'view/';
$aTmplVarsImages = array();
foreach ($aFiles as $aFile) {
$aTmplVarsImages[] = array('src' => $this->oSearch->getImgUrl($aFile['Hash'], 'browse'), 'link' => $sViewUrl . $aFile['uri'], 'title' => bx_html_attribute($aFile['title']));
}
$this->oTemplate->addCss(array('cover.css'));
$this->oTemplate->addJs(array('modernizr.js', 'jquery.gridrotator.js'));
return $this->oTemplate->parseHtmlByName('cover.html', array('loading' => $GLOBALS['oFunctions']->loadingBoxInline(), 'bx_repeat:images' => $aTmplVarsImages, 'rows' => $iRows, 'columns' => $iColumns));
}
示例3: getProfilesByAccount
public function getProfilesByAccount($aContentInfo, $iMaxVisible = 2)
{
$oProfilesQuery = BxDolProfileQuery::getInstance();
$aProfiles = $oProfilesQuery->getProfilesByAccount($aContentInfo['id']);
$iProfiles = count($aProfiles);
$aTmplVars = array('class_cnt' => '', 'bx_repeat:profiles' => array(), 'bx_if:profiles_more' => array('condition' => $iProfiles > $iMaxVisible, 'content' => array('html_id' => $this->_oConfig->getHtmlIds('profile_more_popup') . $aContentInfo['id'], 'more' => _t('_bx_accnt_txt_more', $iProfiles - $iMaxVisible), 'more_attr' => bx_html_attribute(_t('_bx_accnt_txt_see_more')), 'popup' => '')));
$aTmplVarsPopup = array('class_cnt' => ' bx-def-padding', 'bx_repeat:profiles' => array(), 'bx_if:profiles_more' => array('condition' => false, 'content' => array()));
$i = 0;
foreach ($aProfiles as $iProfileId => $aProfile) {
$oProfile = BxDolProfile::getInstance($iProfileId);
if (!$oProfile) {
continue;
}
$sName = $oProfile->getDisplayName();
$aTmplVarsProfile = array('html_id' => $this->_oConfig->getHtmlIds('profile') . $aProfile['id'], 'id' => $oProfile->id(), 'url' => $oProfile->getUrl(), 'name' => $sName, 'name_attr' => bx_html_attribute($sName));
if ($i < $iMaxVisible) {
$aTmplVars['bx_repeat:profiles'][] = $aTmplVarsProfile;
}
if ($i >= $iMaxVisible) {
$aTmplVarsPopup['bx_repeat:profiles'][] = $aTmplVarsProfile;
}
++$i;
}
if ($aTmplVarsPopup['bx_repeat:profiles']) {
$aTmplVars['bx_if:profiles_more']['content']['popup'] = BxTemplFunctions::getInstance()->transBox('', $this->parseHtmlByName('profiles.html', $aTmplVarsPopup));
}
return $this->parseHtmlByName('profiles.html', $aTmplVars);
}
示例4: getItemsArray
function getItemsArray($iLimit = 1)
{
if (empty($this->aItems)) {
$this->load();
}
if (isset($GLOBALS['bx_profiler'])) {
$GLOBALS['bx_profiler']->beginMenu(ucfirst($this->sName) . ' Menu');
}
$iCount = 0;
$aTmplVars = array();
foreach ($this->aItems as $aItem) {
if (!$this->checkToShow($aItem)) {
continue;
}
$iCount++;
if ($iCount > $iLimit) {
break;
}
list($aItem['Link']) = explode('|', $aItem['Link']);
$aItem['Caption'] = _t($this->replaceMetas($aItem['Caption']));
$aItem['Link'] = $this->replaceMetas($aItem['Link']);
$aItem['Script'] = $this->replaceMetas($aItem['Script']);
$aTmplVars[] = array('name' => $aItem['Name'], 'caption' => $aItem['Caption'], 'caption_attr' => bx_html_attribute($aItem['Caption']), 'icon' => $aItem['Icon'], 'link' => $aItem['Script'] ? 'javascript:void(0)' : $this->oPermalinks->permalink($aItem['Link']), 'script' => $aItem['Script'] ? 'onclick="' . $aItem['Script'] . '"' : null, 'target' => $aItem['Target'] ? 'target="_blank"' : null);
}
if (isset($GLOBALS['bx_profiler'])) {
$GLOBALS['bx_profiler']->endMenu(ucfirst($this->sName) . ' Menu');
}
return $aTmplVars;
}
示例5: getMenuItems
/**
* Get menu items array, which are ready to pass to template.
* @return array
*/
public function getMenuItems()
{
$aRet = array();
if (!isset($this->_aObject['menu_items'])) {
$this->_aObject['menu_items'] = $this->_oQuery->getMenuItems();
}
foreach ($this->_aObject['menu_items'] as $a) {
if (isset($a['active']) && !$a['active']) {
continue;
}
if (isset($a['visible_for_levels']) && !$this->_isVisible($a)) {
continue;
}
$a['title'] = _t($a['title']);
$a = $this->_replaceMarkers($a);
$mixedAddon = $this->_getMenuAddon($a);
$this->addMarkers(array('addon' => $mixedAddon));
$a = $this->_replaceMarkers($a);
list($sIcon, $sIconUrl) = $this->_getMenuIcon($a);
$a['class_add'] = $this->_isSelected($a) ? 'bx-menu-tab-active' : '';
$a['link'] = isset($a['link']) ? $this->_oPermalinks->permalink($a['link']) : 'javascript:void(0);';
$a['title_attr'] = bx_html_attribute($a['title']);
$a['bx_if:image'] = array('condition' => (bool) $sIconUrl, 'content' => array('icon_url' => $sIconUrl));
$a['bx_if:icon'] = array('condition' => (bool) $sIcon, 'content' => array('icon' => $sIcon));
$a['bx_if:title'] = array('condition' => (bool) $a['title'], 'content' => array('title' => $a['title']));
$a['bx_if:addon'] = array('condition' => (bool) $mixedAddon, 'content' => array('addon' => $mixedAddon));
foreach ($this->_aOptionalParams as $sName => $sDefaultValue) {
if (!isset($a[$sName])) {
$a[$sName] = $sDefaultValue;
}
}
$aRet[] = $a;
}
return $aRet;
}
示例6: getProcessedMessages
/**
* Get processed message
*
* @param $aMessages array
* @param $bDeleteAllowed boolean
* @param $bBlockAllowed boolean
* @return text
*/
function getProcessedMessages($aMessages = array(), $bDeleteAllowed = false, $bBlockAllowed = false)
{
global $oFunctions;
if (!$aMessages) {
return;
}
$sOutputCode = '';
$aLanguageKeys = array('by' => _t('_bx_shoutbox_by'), 'visitor' => _t('_Visitor'), 'delete' => _t('_bx_shoutbox_delete_message'), 'sure' => _t('_Are_you_sure'), 'block' => _t('_bx_shoutbox_block_ip'));
foreach ($aMessages as $iKey => $aItems) {
$sMemberIcon = '';
$aProfileInfo = $aItems['OwnerID'] > 0 ? getProfileInfo($aItems['OwnerID']) : array();
// define some profile's data;
if ($aProfileInfo) {
$sNickName = getNickName($aProfileInfo['ID']);
$sLink = getProfileLink($aItems['OwnerID']);
$sMemberIcon = $oFunctions->getMemberIcon($aItems['OwnerID']);
} else {
$sLink = 'javascript:void(0)';
$sNickName = $aLanguageKeys['visitor'];
}
$aKeys = array('owner_icon' => $sMemberIcon, 'message' => WordWrapStr($aItems['Message']), 'by' => $aLanguageKeys['by'], 'owner_nick' => $sNickName, 'date' => defineTimeInterval($aItems['DateTS'], true, true), 'owner_link' => $sLink, 'bx_if:delete_allowed' => array('condition' => $bDeleteAllowed, 'content' => array('delete_cpt' => bx_html_attribute($aLanguageKeys['delete']), 'sure_cpt' => bx_js_string($aLanguageKeys['sure']), 'message_id' => $aItems['ID'])), 'bx_if:block_allowed' => array('condition' => $bBlockAllowed, 'content' => array('block_cpt' => bx_html_attribute($aLanguageKeys['block']), 'sure_cpt' => bx_js_string($aLanguageKeys['sure']), 'message_id' => $aItems['ID'])));
$sTemplateName = $aProfileInfo ? 'message.html' : 'visitor_message.html';
$sOutputCode .= $this->parseHtmlByName($sTemplateName, $aKeys);
}
return $sOutputCode;
}
示例7: getMySubscriptions
function getMySubscriptions()
{
$aUserInfo = getProfileInfo();
$aSubscriptions = $this->_oDb->getSubscriptionsByUser((int) $aUserInfo['ID']);
if (empty($aSubscriptions)) {
return MsgBox(_t('_Empty'));
}
$aForm = array('form_attrs' => array('id' => 'sbs-subscriptions-form', 'name' => 'sbs-subscriptions-form', 'action' => bx_html_attribute($_SERVER['PHP_SELF']), 'method' => 'post', 'enctype' => 'multipart/form-data'), 'params' => array(), 'inputs' => array());
$sUnit = '';
$bCollapsed = true;
foreach ($aSubscriptions as $aSubscription) {
if ($sUnit != $aSubscription['unit']) {
if (!empty($sUnit)) {
$aForm['inputs'][$sUnit . '_end'] = array('type' => 'block_end');
}
$aForm['inputs'][$aSubscription['unit'] . '_begin'] = array('type' => 'block_header', 'caption' => _t('_sbs_txt_title_' . $aSubscription['unit']), 'collapsable' => true, 'collapsed' => $bCollapsed);
$sUnit = $aSubscription['unit'];
$bCollapsed = true;
}
$oFunction = create_function('$arg1, $arg2, $arg3', $aSubscription['params']);
$aParams = $oFunction($aSubscription['unit'], $aSubscription['action'], $aSubscription['object_id']);
$sName = 'sbs-subscription_' . $aSubscription['entry_id'];
$aForm['inputs'][$sName] = array('type' => 'custom', 'name' => $sName, 'content' => '<a href="' . $aParams['template']['ViewLink'] . '">' . $aParams['template']['Subscription'] . '</a> <a href="javascript:void(0)" onclick="return unsubscribeConfirm(\'' . $this->_getUnsubscribeLink((int) $aSubscription['entry_id']) . '\');">' . _t('_sys_btn_sbs_unsubscribe') . '</a>', 'colspan' => true);
}
//'' . . ''
$aForm['inputs'][$sUnit . '_end'] = array('type' => 'block_end');
$oForm = new BxTemplFormView($aForm);
$sContent = $oForm->getCode();
$GLOBALS['oSysTemplate']->addJsTranslation('_sbs_wrn_unsubscribe');
ob_start();
?>
<script language="javascript" type="text/javascript">
<!--
function unsubscribeConfirm(sUrl){
if(confirm(_t('_sbs_wrn_unsubscribe'))) {
$.get(
sUrl + '&js=1',
{},
function(oData){
alert(oData.message);
if(oData.code == 0)
window.location.href = window.location.href;
},
'json'
);
return true;
}
else
return false;
}
-->
</script>
<?php
$sContent .= ob_get_clean();
return $sContent;
}
示例8: __construct
/**
* constructor
*/
function __construct($mixedCategory, $sActionUrl = '')
{
$this->_oDb = $GLOBALS['MySQL'];
$this->_sActionUrl = !empty($sActionUrl) ? $sActionUrl : bx_html_attribute($_SERVER['PHP_SELF']) . (!empty($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : '');
$this->_mixedCategory = $mixedCategory;
$this->_iCategoryActive = 0;
$this->_iResultTimer = 3;
$this->_aCustomCategories = array('ap' => array('title' => '_getCatTitleAdminPassword', 'content' => '_getCatContentAdminPassword', 'save' => '_saveCatAdminPassword'), 16 => array('save' => '_saveCatWatermark'), 26 => array('on_save' => '_onSavePermalinks'));
}
示例9: getUploader
function getUploader($sResult)
{
$aForm = array('form_attrs' => array('id' => 'module_upload_form', 'action' => bx_html_attribute($_SERVER['PHP_SELF']), 'method' => 'post', 'enctype' => 'multipart/form-data'), 'inputs' => array('header1' => array('type' => 'block_header', 'caption' => _t('_adm_txt_modules_package_to_upload')), 'module' => array('type' => 'file', 'name' => 'module', 'caption' => _t('_adm_txt_modules_module')), 'update' => array('type' => 'file', 'name' => 'update', 'caption' => _t('_adm_btn_modules_update')), 'header2' => array('type' => 'block_header', 'caption' => _t('_adm_txt_modules_ftp_access')), 'login' => array('type' => 'text', 'name' => 'login', 'caption' => _t('_adm_txt_modules_login'), 'value' => getParam('sys_ftp_login')), 'password' => array('type' => 'password', 'name' => 'password', 'caption' => _t('_Password'), 'value' => getParam('sys_ftp_password')), 'path' => array('type' => 'text', 'name' => 'path', 'caption' => _t('_adm_txt_modules_path_to_dolphin'), 'value' => !($sPath = getParam('sys_ftp_dir')) ? 'public_html/' : $sPath), 'submit_upload' => array('type' => 'submit', 'name' => 'submit_upload', 'value' => _t('_adm_box_cpt_upload'))));
$oForm = new BxBaseFormView($aForm);
$sContent = $oForm->getCode();
if (!empty($sResult)) {
$sContent = MsgBox(_t($sResult), 3) . $sContent;
}
return $GLOBALS['oAdmTemplate']->parseHtmlByName('modules_uploader.html', array('content' => $sContent));
}
示例10: serviceProfileStats
public function serviceProfileStats($iProfileId = 0)
{
if (!$iProfileId) {
$iProfileId = bx_get_logged_profile_id();
}
$oMenu = BxDolMenu::getObjectInstance('sys_profile_stats');
$oProfile = BxDolProfile::getInstance($iProfileId);
$aVars = array('profile_id' => $oProfile->id(), 'profile_url' => $oProfile->getUrl(), 'profile_edit_url' => $oProfile->getEditUrl(), 'profile_title' => $oProfile->getDisplayName(), 'profile_title_attr' => bx_html_attribute($oProfile->getDisplayName()), 'profile_ava_url' => $oProfile->getAvatar(), 'menu' => $oMenu->getCode());
$oTemplate = BxDolTemplate::getInstance();
return $oTemplate->parseHtmlByName('profile_stats.html', $aVars);
}
示例11: BxDolTextData
function BxDolTextData(&$oModule)
{
$this->_oModule = $oModule;
$this->_iOwnerId = BxDolTextData::getAuthorId();
$oCategories = new BxDolCategories();
$oCategories->getTagObjectConfig();
$this->_aForm = array('form_attrs' => array('id' => 'text_data', 'name' => 'text_data', 'action' => bx_html_attribute($_SERVER['PHP_SELF']), 'method' => 'post', 'enctype' => 'multipart/form-data'), 'params' => array('db' => array('table' => '', 'key' => 'id', 'uri' => 'uri', 'uri_title' => 'caption', 'submit_name' => 'post')), 'inputs' => array('author_id' => array('type' => 'hidden', 'name' => 'author_id', 'value' => $this->_iOwnerId, 'db' => array('pass' => 'Int')), 'caption' => array('type' => 'text', 'name' => 'caption', 'caption' => _t("_td_caption"), 'value' => '', 'required' => 1, 'checker' => array('func' => 'length', 'params' => array(3, 64), 'error' => _t('_td_err_incorrect_length')), 'db' => array('pass' => 'Xss')), 'snippet' => array('type' => 'textarea', 'html' => 0, 'name' => 'snippet', 'caption' => _t("_td_snippet"), 'value' => '', 'required' => 1, 'checker' => array('func' => 'length', 'params' => array(3, 200), 'error' => _t('_td_err_incorrect_length')), 'db' => array('pass' => 'Xss')), 'content' => array('type' => 'textarea', 'html' => 2, 'name' => 'content', 'caption' => _t("_td_content"), 'value' => '', 'required' => 1, 'checker' => array('func' => 'length', 'params' => array(3, 65536), 'error' => _t('_td_err_incorrect_length')), 'db' => array('pass' => 'XssHtml')), 'when' => array('type' => 'datetime', 'name' => 'when', 'caption' => _t("_td_date"), 'value' => date('Y-m-d H:i'), 'required' => 1, 'checker' => array('func' => 'DateTime', 'error' => _t('_td_err_empty_value')), 'db' => array('pass' => 'DateTime')), 'tags' => array('type' => 'text', 'name' => 'tags', 'caption' => _t("_td_tags"), 'value' => '', 'required' => 1, 'checker' => array('func' => 'length', 'params' => array(3, 64), 'error' => _t('_td_err_incorrect_length')), 'info' => _t('_sys_tags_note'), 'db' => array('pass' => 'Xss')), 'categories' => $oCategories->getGroupChooser($this->_oModule->_oConfig->getCategoriesSystemName(), $this->_iOwnerId, true), 'allow_comment_to' => array(), 'allow_vote_to' => array(), 'post' => array('type' => 'submit', 'name' => 'post', 'value' => _t("_td_post"))));
if (!empty($this->_iOwnerId)) {
$oPrivacy = new BxDolPrivacy();
$sModuleUri = $this->_oModule->_oConfig->getUri();
$this->_aForm['inputs']['allow_comment_to'] = $oPrivacy->getGroupChooser($this->_iOwnerId, $sModuleUri, 'comment');
$this->_aForm['inputs']['allow_vote_to'] = $oPrivacy->getGroupChooser($this->_iOwnerId, $sModuleUri, 'vote');
}
}
示例12: getBuilderPage
function getBuilderPage()
{
$aPagesForTemplate = array(array('value' => '', 'title' => _t('_adm_txt_pb_select_page'), 'selected' => empty($this->_sPage) ? 'selected="selected"' : ''));
$aPages = $this->_getPages();
foreach ($aPages as $r) {
$aPagesForTemplate[] = array('value' => $r['page'], 'title' => htmlspecialchars_adv(_t($r['title'])), 'selected' => $r['page'] == $this->_sPage ? 'selected="selected"' : '');
}
$sPagesSelector = $GLOBALS['oAdmTemplate']->parseHtmlByName('mobile_builder_pages_selector.html', array('bx_repeat:pages' => $aPagesForTemplate, 'url' => bx_html_attribute(BX_DOL_URL_ADMIN . 'mobileBuilder.php')));
$sPagesSelector = $GLOBALS['oAdmTemplate']->parseHtmlByName('designbox_top_controls.html', array('top_controls' => $sPagesSelector));
if (empty($this->_sPage)) {
$this->addExternalResources();
}
return $sPagesSelector . (!empty($this->_sPage) ? parent::getBuilderPage() : MsgBox(_t('_Empty')));
}
示例13: getLoginForm
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();
}
示例14: getListTemplate
function getListTemplate($sCurrent)
{
$sOutputCode = "";
$aTemplates = get_templates_array();
if (count($aTemplates) < 2) {
return $sOutputCode;
}
$sGetTransfer = bx_encode_url_params($_GET, array('skin'));
$aTmplVars = array();
foreach ($aTemplates as $sName => $sTitle) {
$aTmplVars[] = array('bx_if:show_icon' => array('condition' => false, 'content' => array()), 'class' => $sName == $sCurrent ? 'sys-bm-sub-item-selected' : '', 'link' => bx_html_attribute($_SERVER['PHP_SELF']) . '?' . $sGetTransfer . 'skin=' . $sName, 'onclick' => '', 'title' => $sTitle);
}
$sOutputCode .= $GLOBALS['oSysTemplate']->parseHtmlByName('extra_bottom_menu_sub_items.html', array('name_method' => 'Template', 'name_block' => 'template', 'bx_repeat:items' => $aTmplVars));
return PopupBox('sys-bm-switcher-template', _t('_sys_bm_popup_cpt_design'), $sOutputCode);
}
示例15: getItems
function getItems()
{
$aTmplVars = array();
foreach ($this->aItems as $aItem) {
if (!$this->checkToShow($aItem)) {
continue;
}
list($aItem['Link']) = explode('|', $aItem['Link']);
$aItem['Caption'] = _t($this->replaceMetas($aItem['Caption']));
$aItem['Link'] = $this->replaceMetas($aItem['Link']);
$aItem['Script'] = $this->replaceMetas($aItem['Script']);
$aTmplVars[] = array('caption' => $aItem['Caption'], 'caption_attr' => bx_html_attribute($aItem['Caption']), 'icon' => $aItem['Icon'], 'link' => $aItem['Script'] ? 'javascript:void(0)' : $this->oPermalinks->permalink($aItem['Link']), 'script' => $aItem['Script'] ? 'onclick="' . $aItem['Script'] . '"' : null, 'target' => $aItem['Target'] ? 'target="_blank"' : null);
}
return $GLOBALS['oSysTemplate']->parseHtmlByName('extra_' . $this->sName . '_menu.html', array('bx_repeat:items' => $aTmplVars));
}