本文整理汇总了PHP中CUtil::GetPopupOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP CUtil::GetPopupOptions方法的具体用法?PHP CUtil::GetPopupOptions怎么用?PHP CUtil::GetPopupOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUtil
的用法示例。
在下文中一共展示了CUtil::GetPopupOptions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetUpdateResult
function GetUpdateResult()
{
$update_res = false;
if(intval(COption::GetOptionString('main', 'update_autocheck')) > 0)
$update_res = unserialize(COption::GetOptionString('main', '~update_autocheck_result'));
if(!is_array($update_res))
$update_res = array("result"=>false, "error"=>"", "modules"=>array());
$update_res['tooltip'] = '';
if($update_res["result"] == true || $update_res["error"] <> '')
{
$updOptions = CUtil::GetPopupOptions('update_tooltip');
if($updOptions['display'] <> 'off')
{
if($update_res["result"] == true)
$update_res['tooltip'] = GetMessage("top_panel_updates").(($n = count($update_res["modules"])) > 0? GetMessage("top_panel_updates_modules", array("#MODULE_COUNT#"=>$n)) : '');
elseif($update_res["error"] <> '')
$update_res['tooltip'] = GetMessage("top_panel_updates_err").' '.$update_res["error"].'<br><a href="/bitrix/admin/settings.php?lang='.LANGUAGE_ID.'&mid=main&tabControl_active_tab=edit5">'.GetMessage("top_panel_updates_settings").'</a>';
}
}
return $update_res;
}
示例2: DrawIcons
function DrawIcons($arIcons, $arParams = array())
{
$bStack = $this->includeLevel > ($GLOBALS['FX_GLOBAL_AREA_EDIT_ICON'] ? 1 : 0);
$arJSIcons = array();
$arOuterIcons = array();
foreach ($arIcons as $arIcon) {
if (isset($arIcon['SEPARATOR'])) {
$size = count($arJSIcons);
if ($size <= 0 || !isset($arJSIcons[$size - 1]["SEPARATOR"])) {
$arJSIcons[] = array('SEPARATOR' => 'Y');
}
} else {
//skip duplicate buttons
if (isset($arIcon["ID"]) && strlen($arIcon["ID"]) > 0) {
if (!array_key_exists("ICONS_ID", $this->includeAreaIcons) || !is_array($this->includeAreaIcons["ICONS_ID"])) {
$this->includeAreaIcons["ICONS_ID"] = array($arIcon["ID"]);
} elseif (in_array($arIcon["ID"], $this->includeAreaIcons["ICONS_ID"])) {
continue;
} else {
$this->includeAreaIcons["ICONS_ID"][] = $arIcon["ID"];
}
}
$jsIcon = CEditArea::GetJSIcon($arIcon);
if ($arIcon['IN_MENU'] || $arIcon['TYPE'] == 'components2_props' && $bStack) {
$arJSIcons[] = $jsIcon;
} elseif ($arIcon['IN_PARAMS_MENU']) {
$jsIcon['TYPE'] = 'components2_submenu_item';
$arOuterIcons[] = $jsIcon;
} else {
$arOuterIcons[] = $jsIcon;
}
}
}
$areaId = $this->__GetAreaId();
$this->includeAreaIcons[$areaId] = array('COMPONENT' => $arParams['COMPONENT'], 'DESCRIPTION' => $arParams['COMPONENT_DESCRIPTION'], 'OUTER_ICONS' => $arOuterIcons, 'ICONS' => $arJSIcons);
if ($bStack) {
$this->bDrawIcons = false;
return '';
} else {
if (array_key_exists("ICONS_ID", $this->includeAreaIcons)) {
unset($this->includeAreaIcons["ICONS_ID"]);
}
$arAllOuterIcons = array();
$arAllInnerIcons = array();
foreach ($this->includeAreaIcons as $arSubIcons) {
$arAllOuterIcons = array_merge($arAllOuterIcons, $arSubIcons['OUTER_ICONS']);
$arAllInnerIcons = array_merge($arAllInnerIcons, array(array('TEXT' => $arSubIcons['DESCRIPTION']['NAME'] ? $arSubIcons['DESCRIPTION']['NAME'] . ' (' . $arSubIcons['COMPONENT'] . ')' : $arSubIcons['COMPONENT'], 'ICON' => 'parameters-2', 'MENU' => $arSubIcons['ICONS'])));
}
$arAllInnerIcons = array_reverse($arAllInnerIcons);
$arAddInnerIcons = array();
foreach ($arAllOuterIcons as $aIcon) {
if ($aIcon['TYPE'] == 'components2_props') {
$arAddInnerIcons['components2_props'] = $aIcon;
} elseif ($aIcon['TYPE'] == 'components2_submenu_item') {
$arAddInnerIcons[] = $aIcon;
}
}
if (count($arAddInnerIcons) > 1) {
$arAddInnerIcons[] = array('SEPARATOR' => 'Y');
}
if (count($arAddInnerIcons) > 0 && count($arAllInnerIcons) > 0) {
$arJSIcons = array_merge($arAllOuterIcons, array(array('TYPE' => 'components2_submenu', 'TEXT' => 'components2_submenu', 'ICON' => 'parameters-2', 'MENU' => array_merge(array_values($arAddInnerIcons), $arAllInnerIcons))));
} else {
$arJSIcons = $arAllOuterIcons;
}
$arUserOptions = false;
if ($arParams['COMPONENT_ID']) {
$arUserOptions = CUtil::GetPopupOptions($arParams['COMPONENT_ID']);
}
$arJSParams = array('parent' => 'bx_incl_area_' . $areaId, 'id' => 'comp_' . $areaId);
if ($arParams['COMPONENT_ID']) {
$arJSParams['component_id'] = $arParams['COMPONENT_ID'];
if (is_array($arUserOptions)) {
if ($arUserOptions['pin'] === 'true' || $arParams['COMPONENT_ID'] == 'page_edit_control') {
$arJSParams['pin'] = $arUserOptions['pin'] === 'true';
if ($arJSParams['pin']) {
if ($arUserOptions['transform']) {
$arJSParams['transform'] = $arUserOptions['transform'] === 'true';
}
if ($arUserOptions['top']) {
$arJSParams['top'] = $arUserOptions['top'] == 'false' ? false : $arJSParams['top'];
}
if ($arUserOptions['left']) {
$arJSParams['left'] = $arUserOptions['left'] == 'false' ? false : $arUserOptions['left'];
}
}
}
}
}
if (is_array($arParams['TOOLTIP']) && ($arParams['TOOLTIP']['TITLE'] || $arParams['TOOLTIP']['TEXT'])) {
$arJSParams['HINT'] = array('TITLE' => $arParams['TOOLTIP']['TITLE'], 'TEXT' => $arParams['TOOLTIP']['TEXT']);
}
if (count($arJSIcons) > 0) {
$arJSParams['menu'] = $arJSIcons;
CUtil::InitJSCore(array('admin'));
$this->bDrawIcons = true;
$res = '<script type="text/javascript">if(window.BX)BX.ready(function() {(new BX.' . ($arParams['COMPONENT_ID'] == 'page_edit_control' ? 'CPageOpener' : 'CMenuOpener') . '(' . CUtil::PhpToJsObject($arJSParams) . ')).Show()});</script>';
} else {
$this->bDrawIcons = false;
$res = '';
//.........这里部分代码省略.........
示例3: GetPanelHtml
//.........这里部分代码省略.........
$last_btn_small_cnt = 0;
}
if (!isset($arButton['TYPE']) || $arButton['TYPE'] != 'BIG') {
$arButton['TYPE'] = 'SMALL';
}
//very old behaviour
if (is_set($arButton, "SRC_0")) {
$arButton["SRC"] = $arButton["SRC_0"];
}
$arButton['HREF'] = isset($arButton['HREF']) ? trim($arButton['HREF']) : '';
$bHasAction = $arButton['HREF'] != '';
if (array_key_exists("RESORT_MENU", $arButton) && $arButton["RESORT_MENU"] === true && is_array($arButton['MENU']) && !empty($arButton['MENU'])) {
sortByColumn($arButton['MENU'], "SORT", '', PHP_INT_MAX);
}
$bHasMenu = is_array($arButton['MENU']) && count($arButton['MENU']) > 0;
if ($bHasMenu && !$bHasAction) {
foreach ($arButton['MENU'] as $arItem) {
if (isset($arItem['DEFAULT']) && $arItem['DEFAULT']) {
$arButton['HREF'] = $arItem['HREF'];
$bHasAction = true;
}
}
}
if ($last_btn_type != '' && $arButton['TYPE'] != $last_btn_type && $main_sort == $arButton["MAIN_SORT"]) {
$result .= '</span><span class="bx-panel-button-group" data-group-id="' . ++$groupId . '">';
$last_btn_small_cnt = 0;
}
if ($bHasAction && substr(strtolower($arButton['HREF']), 0, 11) == 'javascript:') {
$arButton['ONCLICK'] = substr($arButton['HREF'], 11);
$arButton['HREF'] = 'javascript:void(0)';
}
if ($arButton['HINT']) {
if (isset($arButton['HINT']['ID']) && $arButton['HINT']['ID']) {
$hintOptions = CUtil::GetPopupOptions($arButton['HINT']['ID']);
if ($hintOptions['display'] == 'off') {
unset($arButton['HINT']);
}
}
if ($arButton['HINT']) {
unset($arButton['ALT']);
}
if ($bHasMenu && (!isset($arButton['HINT_MENU']) || !$arButton['HINT_MENU'])) {
$arButton['HINT']['TARGET'] = 'parent';
}
}
$title = isset($arButton['ALT']) ? htmlspecialcharsbx($arButton['ALT']) : '';
$onClick = isset($arButton['ONCLICK']) ? htmlspecialcharsbx($arButton['ONCLICK']) : '';
$onClickJs = isset($arButton['ONCLICK']) ? CUtil::JSEscape($arButton['ONCLICK']) : '';
$hintMenu = isset($arButton['HINT_MENU']) ? CUtil::PhpToJsObject($arButton['HINT_MENU']) : '';
switch ($arButton['TYPE']) {
case 'SMALL':
if ($last_btn_small_cnt >= 3 && $main_sort == $arButton["MAIN_SORT"]) {
$result .= '</span><span class="bx-panel-button-group" data-group-id="' . ++$groupId . '">';
$last_btn_small_cnt = 0;
} elseif ($last_btn_small_cnt > 0) {
$result .= '<span class="bx-panel-break"></span>';
}
$result .= '<span class="bx-panel-small-button"><span class="bx-panel-small-button-inner">';
$button_icon = '<span class="bx-panel-small-button-icon' . ($arButton['ICON'] ? ' ' . $arButton['ICON'] : '') . '"' . (isset($arButton['SRC']) && $arButton['SRC'] ? ' style="background: scroll transparent url(' . htmlspecialcharsbx($arButton['SRC']) . ') no-repeat center center !important;"' : '') . '></span>';
$button_text = '<span class="bx-panel-small-button-text">' . htmlspecialcharsbx($arButton['TEXT']) . '</span>';
$button_text_js = CUtil::JSEscape($arButton['TEXT']);
if ($bHasAction) {
$result .= '<a href="' . htmlspecialcharsbx($arButton['HREF']) . '" onclick="' . $onClick . ';BX.removeClass(this.parentNode.parentNode, \'bx-panel-small-button' . ($bHasMenu ? '-text' : '') . '-active\')" id="bx_topmenu_btn_' . $key . '"' . ($title ? ' title="' . $title . $hkInstance->GetTitle("bx_topmenu_btn_" . $key) . '"' : '"' . $hkInstance->GetTitle("bx_topmenu_btn_" . $key) . '"') . '>' . $button_icon . $button_text . '</a>';
$result .= '<script type="text/javascript">BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '\', TYPE: \'SMALL\', ACTIVE_CSS: \'bx-panel-small-button' . ($bHasMenu ? '-text' : '') . '-active\', HOVER_CSS: \'bx-panel-small-button' . ($bHasMenu ? '-text' : '') . '-hover\'' . ($arButton['HINT'] ? ', HINT: ' . CUtil::PhpToJsObject($arButton['HINT']) : '') . ', GROUP_ID : ' . $groupId . ', SKIP : ' . ($bHasMenu ? "true" : "false") . ', LINK: "' . CUtil::JSEscape($arButton['HREF']) . '", ACTION : "' . $onClickJs . '",TEXT : "' . $button_text_js . '" })</script>';
if ($bHasMenu) {
$result .= '<a href="javascript:void(0)" class="bx-panel-small-button-arrow" id="bx_topmenu_btn_' . $key . '_menu"><span class="bx-panel-small-button-arrow"></span></a>';