本文整理汇总了PHP中bx_js_string函数的典型用法代码示例。如果您正苦于以下问题:PHP bx_js_string函数的具体用法?PHP bx_js_string怎么用?PHP bx_js_string使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bx_js_string函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: attachEditor
/**
* Attach editor to HTML element, in most cases - textarea.
* @param $sSelector - jQuery selector to attach editor to.
* @param $iViewMode - editor view mode: BX_EDITOR_STANDARD, BX_EDITOR_MINI, BX_EDITOR_FULL
* @param $bDynamicMode - is AJAX mode or not, the HTML with editor area is loaded dynamically.
*/
public function attachEditor($sSelector, $iViewMode = BX_EDITOR_STANDARD, $bDynamicMode = false)
{
// set visual mode
switch ($iViewMode) {
case BX_EDITOR_MINI:
$sToolsItems = self::$CONF_MINI;
break;
case BX_EDITOR_FULL:
$sToolsItems = self::$CONF_FULL;
break;
case BX_EDITOR_STANDARD:
default:
$sToolsItems = self::$CONF_STANDARD;
}
// detect language
$sLang = BxDolLanguages::getInstance()->detectLanguageFromArray(self::$CONF_LANGS);
// initialize editor
$sInitEditor = $this->_replaceMarkers(self::$CONF_COMMON, array('bx_var_custom_init' => $sToolsItems, 'bx_var_custom_conf' => $this->_sConfCustom, 'bx_var_plugins_path' => bx_js_string(BX_DOL_URL_PLUGINS, BX_ESCAPE_STR_APOS), 'bx_var_css_path' => bx_js_string($this->_oTemplate->getCssUrl('editor.css'), BX_ESCAPE_STR_APOS), 'bx_var_skin' => bx_js_string($this->_aObject['skin'], BX_ESCAPE_STR_APOS), 'bx_var_lang' => bx_js_string($sLang, BX_ESCAPE_STR_APOS), 'bx_var_selector' => bx_js_string($sSelector, BX_ESCAPE_STR_APOS), 'bx_url_root' => bx_js_string(BX_DOL_URL_ROOT, BX_ESCAPE_STR_APOS), 'bx_url_tinymce' => bx_js_string(BX_DOL_URL_PLUGINS_PUBLIC . 'tinymce/', BX_ESCAPE_STR_APOS)));
if ($bDynamicMode) {
$sScript = "<script>\n if ('undefined' == typeof(jQuery(document).tinymce)) {\n window.tinyMCEPreInit = {base : '" . bx_js_string(BX_DOL_URL_PLUGINS_PUBLIC . 'tinymce', BX_ESCAPE_STR_APOS) . "', suffix : '.min', query : ''};\n \$.getScript('" . bx_js_string(BX_DOL_URL_ROOT . 'inc/js/editor.tinymce.js', BX_ESCAPE_STR_APOS) . "');\n \$.getScript('" . bx_js_string(BX_DOL_URL_PLUGINS_PUBLIC . 'tinymce/tinymce.min.js', BX_ESCAPE_STR_APOS) . "', function(data, textStatus, jqxhr) {\n \$.getScript('" . bx_js_string(BX_DOL_URL_PLUGINS_PUBLIC . 'tinymce/jquery.tinymce.min.js', BX_ESCAPE_STR_APOS) . "', function(data, textStatus, jqxhr) {\n {$sInitEditor}\n });\n });\n } else {\n {$sInitEditor}\n }\n </script>";
} else {
$sScript = "\n <script>\n \$(document).ready(function () {\n {$sInitEditor}\n });\n </script>";
}
return $this->_addJsCss($bDynamicMode) . $sScript;
}
示例3: getJsScript
public function getJsScript($bDynamicMode = false)
{
$aParams = array('sObjName' => $this->_sJsObjName, 'sSystem' => $this->getSystemName(), 'iAuthorId' => $this->_getAuthorId(), 'iObjId' => $this->getId(), 'iLikeMode' => $this->isLikeMode() ? 1 : 0, 'sRootUrl' => BX_DOL_URL_ROOT, 'sStylePrefix' => $this->_sStylePrefix, 'aHtmlIds' => $this->_aHtmlIds);
$sCode = $this->_sJsObjName . " = new BxDolVote(" . json_encode($aParams) . ");";
if ($bDynamicMode) {
$sCode = "var " . $this->_sJsObjName . " = null; \n\t\t\t\$.getScript('" . bx_js_string($this->_oTemplate->getJsUrl('BxDolVote.js'), BX_ESCAPE_STR_APOS) . "', function(data, textStatus, jqxhr) {\n\t\t\t\tbx_get_style('" . bx_js_string($this->_oTemplate->getCssUrl('vote.css'), BX_ESCAPE_STR_APOS) . "');\n\t\t\t\t" . $sCode . "\n \t}); ";
} else {
$sCode = "var " . $sCode;
}
$this->addCssJs($bDynamicMode);
return $this->_oTemplate->_wrapInTagJsCode($sCode);
}
示例4: PageCodeClear
function PageCodeClear()
{
global $oAdmTemplate, $oCacheUtilities, $aCacheTypes;
$sChartData = '';
foreach ($aCacheTypes as $r) {
if ('all' == $r['action']) {
continue;
}
$iSize = $oCacheUtilities->size($r['action']);
$sChartData .= ",\n['" . bx_js_string($r['title'], BX_ESCAPE_STR_APOS) . "', {v:" . $iSize . ", f:'" . bx_js_string(_t_format_size($iSize)) . "'}]";
}
$s = $oAdmTemplate->parseHtmlByName('cache.html', array('bx_repeat:clear_action' => $aCacheTypes, 'chart_data' => trim($sChartData, ',')));
return DesignBoxAdmin(_t('_adm_txt_cache'), $s, $GLOBALS['aTopItems'], '', 11);
}
示例5: PageCodeClear
function PageCodeClear()
{
global $oAdmTemplate, $oCacheUtilities, $aCacheTypes;
$aChartData = array();
foreach ($aCacheTypes as $r) {
if ('all' == $r['action']) {
continue;
}
$aChartData[] = array('value' => round($oCacheUtilities->size($r['action']) / 1024, 2), 'color' => '#' . dechex(rand(0x0, 0xffffff)), 'highlight' => '', 'label' => bx_js_string($r['title'], BX_ESCAPE_STR_APOS));
}
$sChartData = json_encode($aChartData);
$oAdmTemplate->addJsTranslation(array('_sys_kilobyte'));
$oAdmTemplate->addJsSystem(array('chart.min.js'));
$s = $oAdmTemplate->parseHtmlByName('cache.html', array('bx_repeat:clear_action' => $aCacheTypes, 'chart_data' => $sChartData));
return DesignBoxAdmin(_t('_adm_txt_cache'), $s, $GLOBALS['aTopItems'], '', 11);
}
示例6: GenIPBlackListTable
function GenIPBlackListTable()
{
$sSQL = "SELECT *, FROM_UNIXTIME(`LastDT`) AS `LastDT_U` FROM `sys_ip_list` ORDER BY `From` ASC";
$rIPList = db_res($sSQL);
$aTmplVarsItems = array();
while ($aIPList = mysql_fetch_assoc($rIPList)) {
$iID = (int) $aIPList['ID'];
$sFrom = long2ip($aIPList['From']);
$sTo = $aIPList['To'] == 0 ? '' : long2ip($aIPList['To']);
$sType = process_html_output($aIPList['Type']);
$sLastDT_Formatted = getLocaleDate($aIPList['LastDT'], BX_DOL_LOCALE_DATE);
$sLastDT = preg_replace('/([\\d]{2}):([\\d]{2}):([\\d]{2})/', '$1:$2', $aIPList['LastDT_U']);
$sDesc = process_html_output($aIPList['Desc']);
$sDescAttr = bx_html_attribute(bx_js_string($aIPList['Desc'], BX_ESCAPE_STR_APOS));
$aTmplVarsItems[] = array('id' => $iID, 'from' => $sFrom, 'to' => $sTo, 'type' => $sType, 'date' => $sLastDT, 'date_uf' => $sLastDT_Formatted, 'description' => $sDesc, 'description_attr' => $sDescAttr, 'delete_action_url' => bx_append_url_params($this->_sActionUrl, array('action' => 'apply_delete', 'id' => $iID)));
}
if (empty($aTmplVarsItems)) {
return MsgBox(_t('_Empty'));
}
return $GLOBALS['oAdmTemplate']->parseHtmlByName('ip_blacklist_list_filters.html', array('bx_repeat:items' => $aTmplVarsItems));
}
示例7: db_res
exit;
}
// generate all active menu items ;
$sTopQuery = "SELECT `ID`, `Name`, `Movable` FROM `" . $oMenu->sDbTable . "`\tWHERE `Active`='1' ORDER BY `Order`";
$rTopItems = db_res($sTopQuery);
$sAllQuery = "SELECT `ID`, `Name` FROM `" . $oMenu->sDbTable . "` WHERE `Clonable`='1' OR (`Clonable`='0' AND `Active`='0') ORDER BY `Name`";
$rAllItems = db_res($sAllQuery);
$sComposerInit = "\n <script type=\"text/javascript\">\n topParentID = 'menu_app_wrapper';\n parserUrl = '" . $GLOBALS['site']['url_admin'] . "service_menu_compose.php?';\n\n allowNewItem = true;\n allowAddToTop = true;\n allowAddToCustom = false;\n iInactivePerRow = 5;\n sendSystemOrder = false;\n\n aCoords = {};\n aCoords['startX'] = 6;\n aCoords['startY'] = 24;\n aCoords['width'] = 117;\n aCoords['height'] = 28;\n aCoords['diffX'] = 122;\n aCoords['diffY'] = 32;\n\n aTopItems = {};\n aCustomItems = {};\n aSystemItems = {};\n aAllItems = {};\n";
$iIndex = 0;
while (($aTopItem = $rTopItems->fetch()) !== false) {
$sComposerInit .= "\n\n aTopItems[{$iIndex}] = [{$aTopItem['ID']}, '" . addslashes($aTopItem['Name']) . "', {$aTopItem['Movable']}];\n aCustomItems[{$iIndex}] = {};";
$iIndex++;
}
$sComposerInit .= "\n";
while (($aAllItem = $rAllItems->fetch()) !== false) {
$sComposerInit .= "\n aAllItems['{$aAllItem['ID']} '] = '" . bx_js_string($aAllItem['Name'], BX_ESCAPE_STR_APOS) . "';";
}
$sComposerInit .= "\n </script>\n";
$iNameIndex = 12;
$_page = array('name_index' => $iNameIndex, 'css_name' => array('menu_compose.css', 'forms_adv.css'), 'js_name' => array('menu_compose.js', 'BxDolMenu.js'), 'header' => _t('_adm_smbuilder_page_title'));
$sContent = $GLOBALS['oAdmTemplate']->parseHtmlByName('menu_compose.html', array('extra_js' => $sComposerInit));
$_page_cont[$iNameIndex]['controls'] = '';
$_page_cont[$iNameIndex]['page_main_code'] = DesignBoxAdmin(_t('_adm_smbuilder_box_title'), $sContent);
PageCodeAdmin();
function showEditForm($aItem)
{
$aForm = array('form_attrs' => array('id' => 'formItemEdit', 'name' => 'formItemEdit', 'action' => $GLOBALS['site']['url_admin'] . 'bottom_menu_compose.php', 'method' => 'post', 'enctype' => 'multipart/form-data'), 'inputs' => array('Name' => array('type' => 'text', 'name' => 'Name', 'caption' => _t('_adm_mbuilder_System_Name'), 'value' => $aItem['Name'], 'attrs' => array()), 'Caption' => array('type' => 'text', 'name' => 'Caption', 'caption' => _t('_adm_mbuilder_Language_Key'), 'value' => $aItem['Caption'], 'attrs' => array()), 'LangCaption' => array('type' => 'text', 'name' => 'LangCaption', 'caption' => _t('_adm_mbuilder_Default_Name'), 'value' => _t($aItem['Caption']), 'attrs' => array()), 'Link' => array('type' => 'text', 'name' => 'Link', 'caption' => _t('_URL'), 'value' => htmlspecialchars_adv($aItem['Link']), 'attrs' => array()), 'Script' => array('type' => 'text', 'name' => 'Script', 'caption' => _t('_adm_mbuilder_script'), 'value' => htmlspecialchars_adv($aItem['Script']), 'attrs' => array()), 'Icon' => array('type' => 'text', 'name' => 'Icon', 'caption' => _t('_adm_mbuilder_icon'), 'value' => htmlspecialchars_adv($aItem['Icon']), 'attrs' => array()), 'Target' => array('type' => 'radio_set', 'name' => 'Target', 'caption' => _t('_adm_mbuilder_Target_Window'), 'value' => $aItem['Target'] == '_blank' ? '_blank' : '_self', 'values' => array('_self' => _t('_adm_mbuilder_Same'), '_blank' => _t('_adm_mbuilder_New')), 'attrs' => array()), 'Visible' => array('type' => 'checkbox_set', 'name' => 'Visible', 'caption' => _t('_adm_mbuilder_Visible_for'), 'value' => array(), 'values' => array('non' => _t('_Guest'), 'memb' => _t('_Member')), 'attrs' => array()), 'submit' => array('type' => 'input_set', array('type' => 'button', 'name' => 'save', 'value' => _t('_Save Changes'), 'attrs' => array('onclick' => 'javascript:saveItem(' . $aItem['ID'] . ');')), array('type' => 'button', 'name' => 'delete', 'value' => _t('_Delete'), 'attrs' => array('onclick' => 'javascript:deleteItem(' . $aItem['ID'] . ');')))));
foreach ($aForm['inputs'] as $sKey => $aInput) {
if (in_array($aInput['type'], array('text', 'checkbox')) && !$aItem['Editable']) {
$aForm['inputs'][$sKey]['attrs']['disabled'] = "disabled";
}
示例8: actionPost
/**
* ACTION METHODS
* Post somthing on the wall.
*
* @return string with JavaScript code.
*/
function actionPost()
{
$sResult = "parent." . $this->_sJsPostObject . "._loading(null, false);\n";
$this->_iOwnerId = (int) $_POST['WallOwnerId'];
if (!$this->_isCommentPostAllowed(true)) {
return "<script>" . $sResult . "alert('" . bx_js_string(_t('_wall_msg_not_allowed_post')) . "');</script>";
}
$sPostType = process_db_input($_POST['WallPostType'], BX_TAGS_STRIP);
$sContentType = process_db_input($_POST['WallContentType'], BX_TAGS_STRIP);
$sMethod = "_process" . ucfirst($sPostType) . ucfirst($sContentType);
if (method_exists($this, $sMethod)) {
$aResult = $this->{$sMethod}();
if ((int) $aResult['code'] == 0) {
$iId = $this->_oDb->insertEvent(array('owner_id' => $this->_iOwnerId, 'object_id' => $aResult['object_id'], 'type' => $this->_oConfig->getCommonPostPrefix() . $sPostType, 'action' => '', 'content' => process_db_input($aResult['content'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION), 'title' => process_db_input($aResult['title'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION), 'description' => process_db_input($aResult['description'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION)));
//--- Event -> Post for Alerts Engine ---//
bx_import('BxDolAlerts');
$oAlert = new BxDolAlerts($this->_oConfig->getAlertSystemName(), 'post', $iId, $this->_getAuthorId());
$oAlert->alert();
//--- Event -> Post for Alerts Engine ---//
$sResult = "parent.\$('form#WallPost" . ucfirst($sPostType) . "').find(':input:not(:button,:submit,[type = hidden],[type = radio],[type = checkbox])').val('');\n";
$sResult .= "parent." . $this->_sJsPostObject . "._getPost(null, " . $iId . ");";
} else {
$sResult .= "alert('" . bx_js_string(_t($aResult['message'])) . "');";
}
} else {
$sResult .= "alert('" . bx_js_string(_t('_wall_msg_failed_post')) . "');";
}
return '<script>' . $sResult . '</script>';
}
示例9: getSimpleMessengerCore
/**
* Function will generate messenger's js core ;
*
* @return : (text) - js code;
*/
function getSimpleMessengerCore()
{
$sOutputCode = null;
if (!$this->iLoggedMemberId) {
return;
}
$this->_oTemplate->addJs(array('emoji-picker/js/jquery.emojipicker.js', 'emoji-picker/js/jquery.emojipicker.tw.js', 'messenger_core.js'));
$this->_oTemplate->addCss(array('plugins/emoji-picker/css/|jquery.emojipicker.css', 'simple_messenger.css', 'simple_messenger_phone.css'));
$this->_oTemplate->addCssAsync('plugins/emoji-picker/css|jquery.emojipicker.tw.css');
// it's toooooooo big, so include it separately
$sEmptyMessage = bx_js_string(_t('_simple_messenger_empty_message'));
$sWaitMessage = bx_js_string(_t('_simple_messenger_wait'));
$sOutputCode .= "\n <script type=\"text/javascript\">\n \$(document).ready(function () {\n var sMemberMenuOutputBlock = '{$this->aCoreSettings['output_block']}';\n\n // if member menu was defined;\n \$('#' + sMemberMenuOutputBlock).each(\n function(){\n oSimpleMessenger.chatBoxSettings =\n {\n // the page which will process all AJAX queries ;\n sPageReceiver : '{$this->aCoreSettings['page_receiver']}',\n\n // contain block's id where the list of messages will be generated ;\n sOutputBlockId : sMemberMenuOutputBlock,\n\n // time (in seconds) script checks for new messages ;\n updateTime : {$this->aCoreSettings['update_time']},\n\n // contain descriptor of the created timeout ;\n updateTimeNotifyHandler : '',\n\n // the number of visible messages into chat box ;\n iNumberVisibleMessages : {$this->aCoreSettings['number_visible_messages']},\n\n // contains history block's prefix (block's name where will add the new messages);\n sHistoryBlockPrefix : '{$this->aCoreSettings['history_block_prefix']}',\n\n iParentContainerHeight : 0,\n\n // current member's menu position ;\n sMemberMenuPosition : '{$this->sMemberMenuPosition}',\n\n // wrapper for chat boxes;\n sChatBox : 'simple_messenger_chat_block',\n\n // flashing signals amount of the non-active window ;\n iMaxBlinkCounter : '{$this->aCoreSettings['blink_counter']}'\n };\n\n oSimpleMessenger.systemMessages.emptyMessage = '{$sEmptyMessage}';\n oSimpleMessenger.systemMessages.waitMessage = '{$sWaitMessage}';\n\n var oMenuContainer = \$(this).parents('div:first');\n var iContainerHeight = parseInt( oMenuContainer.height() );\n\n oSimpleMessenger.chatBoxSettings.iParentContainerHeight = (iContainerHeight) ? iContainerHeight + 5 : 0;\n oSimpleMessenger.oDefinedChatBoxes.boxes = Array();\n oSimpleMessenger.messageNotification();\n }\n );\n });\n </script>\n ";
return $sOutputCode;
}
示例10: getCode
public function getCode($isDisplayHeader = true)
{
$this->_replaceMarkers();
if ($isDisplayHeader && empty($this->_aOptions['paginate_url'])) {
// reset page query params if grid is just initialized and it uses AJAX paginate
$this->resetQueryParams();
}
$sPaginate = '';
$aData = array();
$sIdWrapper = 'bx-grid-wrap-' . $this->_sObject;
$sIdContainer = 'bx-grid-cont-' . $this->_sObject;
$sIdTable = 'bx-grid-table-' . $this->_sObject;
$sFilter = bx_unicode_urldecode(bx_process_input(bx_get('filter')));
$sOrderField = bx_unicode_urldecode(bx_process_input(bx_get('order_field')));
$sOrderDir = 0 == strcasecmp('desc', bx_get('order_dir')) ? 'DESC' : 'ASC';
if ($this->_aOptions['paginate_get_start']) {
$iStart = (int) bx_get($this->_aOptions['paginate_get_start']);
} else {
$iStart = 0;
}
if ($this->_aOptions['paginate_get_per_page'] && (int) bx_get($this->_aOptions['paginate_get_per_page']) > 0) {
$iPerPage = (int) bx_get($this->_aOptions['paginate_get_per_page']);
} elseif ($this->_aOptions['paginate_per_page']) {
$iPerPage = (int) $this->_aOptions['paginate_per_page'];
} else {
$iPerPage = 10;
}
if ($this->_aOptions['paginate_get_start']) {
$aData = $this->_getData($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage + 1);
$sPageUrl = false;
if (!empty($this->_aOptions['paginate_url'])) {
$sPageUrl = $this->_aOptions['paginate_url'];
$aParamsAppend = array();
if ($sFilter) {
$aParamsAppend['filter'] = bx_process_input(bx_get('filter'));
}
if ($sOrderField) {
$aParamsAppend['order_field'] = bx_process_input(bx_get('order_field'));
$aParamsAppend['order_dir'] = bx_process_input(bx_get('order_dir'));
}
if ($aParamsAppend) {
$sPageUrl = bx_append_url_params($sPageUrl, $aParamsAppend);
}
}
$aPaginateParams = array('start' => $iStart, 'per_page' => $iPerPage, 'page_url' => $sPageUrl ? $sPageUrl : "javascript:glGrids." . $this->_sObject . ".reload('{start}'); void(0);");
bx_import('BxTemplPaginate');
$oPaginate = new BxTemplPaginate($aPaginateParams, $this->_oTemplate);
$oPaginate->setNumFromDataArray($aData);
if (isset($this->_aOptions['paginate_simple']) && false !== $this->_aOptions['paginate_simple']) {
$sPaginate = $oPaginate->getSimplePaginate($this->_aOptions['paginate_simple']);
} else {
$sPaginate = $oPaginate->getPaginate();
}
} else {
$aData = $this->_getData($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
}
$sPopupOptions = '{}';
if (!empty($this->_aPopupOptions) && is_array($this->_aPopupOptions)) {
$sPopupOptions = json_encode($this->_aPopupOptions);
}
$aQueryAppend = array_merge(is_array($this->_aQueryAppend) ? $this->_aQueryAppend : array(), is_array($this->_aMarkers) ? $this->_aMarkers : array());
$sQueryAppend = '{}';
if (!empty($aQueryAppend) && is_array($aQueryAppend)) {
$sQueryAppend = json_encode($aQueryAppend);
}
$sConfirmMessages = '{}';
if (!empty($this->_aConfirmMessages) && is_array($this->_aConfirmMessages)) {
$sConfirmMessages = json_encode($this->_aConfirmMessages);
}
$aVars = array('object' => $this->_sObject, 'id_table' => $sIdTable, 'id_cont' => $sIdContainer, 'id_wrap' => $sIdWrapper, 'sortable' => empty($this->_aOptions['field_order']) ? 0 : 1, 'sorting' => empty($this->_aOptions['sorting_fields']) ? 0 : 1, 'sorting_field' => $sOrderField, 'sorting_dir' => $sOrderDir, 'bx_repeat:row_header' => $this->_getRowHeader(), 'bx_repeat:rows_data' => $this->_getRowsDataDesign($aData), 'paginate' => $sPaginate, 'paginate_get_start' => $this->_aOptions['paginate_get_start'], 'paginate_get_per_page' => $this->_aOptions['paginate_get_per_page'], 'start' => $iStart, 'per_page' => $iPerPage, 'filter' => bx_js_string($sFilter, BX_ESCAPE_STR_APOS), 'order_field' => bx_js_string($sOrderField, BX_ESCAPE_STR_APOS), 'order_dir' => bx_js_string($sOrderDir, BX_ESCAPE_STR_APOS), 'popup_options' => $sPopupOptions, 'query_append' => $sQueryAppend, 'confirm_messages' => $sConfirmMessages, 'columns' => count($this->_aOptions['fields']), 'bx_if:actions_bulk' => array('condition' => !empty($this->_aOptions['actions_bulk']), 'content' => array('actions_bulk' => $this->_getActions('bulk'))), 'bx_if:display_header' => array('condition' => $isDisplayHeader, 'content' => array('bx_if:actions_independent' => array('condition' => !empty($this->_aOptions['actions_independent']), 'content' => array('actions_independent' => $this->_getActions('independent'))), 'bx_if:filter' => array('condition' => !empty($this->_aOptions['filter_fields']) || !empty($this->_aOptions['filter_fields_translatable']), 'content' => array('controls' => $this->_getFilterControls())))));
$this->_addJsCss();
return $this->_oTemplate->parseHtmlByName('grid.html', $aVars);
}
示例11: _wrapMobileUnit
function _wrapMobileUnit($sContent, $iPostID, $oMain)
{
$aVars = array('content' => $sContent, 'url' => bx_js_string($oMain->genBlogSubUrl() . '?action=mobile&mode=post&id=' . $iPostID));
bx_import('BxDolMobileTemplate');
$oMobileTemplate = new BxDolMobileTemplate($oMain->_oConfig, $oMain->_oDb);
return $oMobileTemplate->parseHtmlByName($this->sMobileWrapper, $aVars);
}
示例12: msgBox
function msgBox($sText, $iTimer = 0, $sOnTimer = "")
{
$iId = mktime() . mt_rand(1, 1000);
return $GLOBALS['oSysTemplate']->parseHtmlByName('messageBox.html', array('id' => $iId, 'msgText' => $sText, 'bx_if:timer' => array('condition' => $iTimer > 0, 'content' => array('id' => $iId, 'time' => 1000 * $iTimer, 'on_timer' => bx_js_string($sOnTimer, BX_ESCAPE_STR_QUOTE)))));
}
示例13: getCodeStats
function getCodeStats()
{
$aStats = getSiteStatArray();
$aTmplItemsCom = $aTmplItemsImp = array();
foreach ($aStats as $aStat) {
$mixedItem = $this->_getStatsItem($aStat);
if ($mixedItem !== false) {
$aTmplItemsCom[] = $mixedItem;
}
$mixedItem = $this->_getStatsItem($aStat, 'adm_');
if ($mixedItem !== false) {
$aTmplItemsImp[] = $mixedItem;
}
}
$aCommonChartData = array();
foreach ($aTmplItemsCom as $r) {
$aCommonChartData[] = array('value' => $r['number'], 'color' => '#' . dechex(rand(0x0, 0xffffff)), 'highlight' => '', 'label' => bx_js_string($r['caption'], BX_ESCAPE_STR_APOS));
}
$sCommonChartData = json_encode($aCommonChartData);
$GLOBALS['oAdmTemplate']->addJsSystem(array('chart.min.js'));
$sContent = $GLOBALS['oAdmTemplate']->parseHtmlByName('dashboard_stats.html', array('bx_repeat:items_common' => $aTmplItemsCom, 'bx_repeat:items_important' => $aTmplItemsImp, 'common_chart_data' => $sCommonChartData));
return DesignBoxAdmin(_t('_adm_box_cpt_content'), $sContent, '', '', 11);
}
示例14: genInputFiles
/**
* Generate Select Box Element
*
* @param array $aInput
* @return string
*/
function genInputFiles(&$aInput, $sInfo = '', $sError = '')
{
bx_import('BxDolUploader');
$sUniqId = genRndPwd(8, false);
$sUploaders = '';
$oUploader = null;
foreach ($aInput['uploaders'] as $sUploaderObject) {
$oUploader = BxDolUploader::getObjectInstance($sUploaderObject, $aInput['storage_object'], $sUniqId);
if (!$oUploader) {
continue;
}
$sGhostTemplate = false;
if (isset($aInput['ghost_template']) && is_object($aInput['ghost_template'])) {
// form is not submitted and ghost template is BxDolFormNested object
$oFormNested = $aInput['ghost_template'];
if ($oFormNested instanceof BxDolFormNested) {
$sGhostTemplate = $oFormNested->getCode();
}
} elseif (isset($aInput['ghost_template']) && is_array($aInput['ghost_template']) && isset($aInput['ghost_template']['inputs'])) {
// form is not submitted and ghost template is form array
bx_import('BxDolFormNested');
$oFormNested = new BxDolFormNested($aInput['name'], $aInput['ghost_template'], $this->aParams['db']['submit_name'], $this->oTemplate);
$sGhostTemplate = $oFormNested->getCode();
} elseif (isset($aInput['ghost_template']) && is_array($aInput['ghost_template']) && $aInput['ghost_template']) {
// form is submitted and ghost template is array of BxDolFormNested objects
bx_import('BxDolFormNested');
$sGhostTemplate = array();
foreach ($aInput['ghost_template'] as $iFileId => $oFormNested) {
if (is_object($oFormNested) && $oFormNested instanceof BxDolFormNested) {
$sGhostTemplate[$iFileId] = $oFormNested->getCode();
}
}
} elseif (isset($aInput['ghost_template']) && is_string($aInput['ghost_template'])) {
// ghost template is just string template, without nested form
$sGhostTemplate = $aInput['ghost_template'];
}
$aParams = array('button_title' => bx_js_string($oUploader->getUploaderButtonTitle(isset($aInput['upload_buttons_titles']) ? $aInput['upload_buttons_titles'] : false)), 'content_id' => isset($aInput['content_id']) ? $aInput['content_id'] : '');
if (isset($aInput['images_transcoder']) && $aInput['images_transcoder']) {
$aParams['images_transcoder'] = bx_js_string($aInput['images_transcoder']);
}
$sUploaders .= $oUploader->getUploaderButton($sGhostTemplate, isset($aInput['multiple']) ? $aInput['multiple'] : true, $aParams);
}
return $this->oTemplate->parseHtmlByName('form_field_uploader.html', array('uploaders_buttons' => $sUploaders, 'info' => $sInfo, 'error' => $sError, 'id_container_errors' => $oUploader ? $oUploader->getIdContainerErrors() : '', 'id_container_result' => $oUploader ? $oUploader->getIdContainerResult() : '', 'uploader_instance_name' => $oUploader ? $oUploader->getNameJsInstanceUploader() : '', 'is_init_ghosts' => isset($aInput['init_ghosts']) && !$aInput['init_ghosts'] ? 0 : 1));
}
示例15: serviceResponseCmtsPlayer
/**
* Cmts Player
*/
function serviceResponseCmtsPlayer($oAlert)
{
if (!($iFileId = (int) $oAlert->iObject)) {
return false;
}
if (!($aFile = $this->_oDb->getRow("SELECT * FROM `RayVideo_commentsFiles` WHERE `ID` = {$iFileId}"))) {
return false;
}
global $sIncPath;
global $sModulesPath;
global $sFilesPath;
global $sFilesUrl;
global $oDb;
require_once $sIncPath . 'db.inc.php';
$sModule = "video_comments";
$sModulePath = $sModulesPath . $sModule . '/inc/';
require_once $sModulesPath . $sModule . '/inc/header.inc.php';
require_once $sModulesPath . $sModule . '/inc/constants.inc.php';
require_once $sModulesPath . $sModule . '/inc/functions.inc.php';
require_once $sModulesPath . $sModule . '/inc/customFunctions.inc.php';
$sOverride = false;
switch ($aFile['Status']) {
case VC_STATUS_DISAPPROVED:
$sOverride = $this->_oTemplate->addCss(array('default.css', 'common.css', 'general.css'), true) . MsgBox(_t('_sys_media_disapproved'));
break;
case VC_STATUS_PENDING:
case VC_STATUS_PROCESSING:
$sOverride = $this->_oTemplate->addCss(array('default.css', 'common.css', 'general.css'), true) . MsgBox(_t('_sys_media_processing'));
break;
case VC_STATUS_APPROVED:
if (file_exists($sFilesPath . $iFileId . VC_M4V_EXTENSION)) {
$sToken = _getToken($iFileId);
if (file_exists($sFilesPath . $iFileId . '.webm')) {
$sSourceWebm = '<source type=\'video/webm; codecs="vp8, vorbis"\' src="' . BX_DOL_URL_ROOT . "flash/modules/video_comments/get_file.php?id=" . $iFileId . "&ext=webm&token=" . $sToken . '" />';
}
$sFlash = $oAlert->aExtras['data'];
$sId = 'bx-media-' . genRndPwd(8, false);
$sOverride = '
<video controls preload="auto" autobuffer id="' . $sId . '">
' . $sSourceWebm . '
<source src="' . BX_DOL_URL_ROOT . "flash/modules/video_comments/get_file.php?id=" . $iFileId . "&ext=m4v&token=" . $sToken . '" />
' . (BX_H5AV_FALLBACK ? $sFlash : '<b>Can not playback media - your browser doesn\'t support HTML5 audio/video tag.</b>') . '
</video>' . ($sSourceWebm ? '' : '<script>
var eMedia = document.createElement("video");
if (eMedia.canPlayType && !eMedia.canPlayType("video/x-m4v")) {
var sReplace = "' . bx_js_string(BX_H5AV_FALLBACK ? $sFlash : '<b>Your browser doesn\'t support this media playback.</b>', BX_ESCAPE_STR_QUOTE) . '";
$("#' . $sId . '").replaceWith(sReplace);
}
</script>');
break;
}
case VC_STATUS_FAILED:
default:
if (!BX_H5AV_FALLBACK || !file_exists($sFilesPath . $iFileId . FLV_EXTENSION)) {
$sOverride = $this->_oTemplate->addCss(array('default.css', 'common.css', 'general.css'), true) . MsgBox(_t('_sys_media_not_found'));
}
break;
}
if ($sOverride) {
$oAlert->aExtras['data'] = $sOverride;
}
return true;
}