10if(!defined(
"B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==
true)
die();
19define(
"ADMIN_THEMES_PATH",
"/bitrix/themes");
27 private $isHideTitle =
false;
31 if (defined(
"PUBLIC_MODE") && PUBLIC_MODE == 1)
33 $this->publicMode =
true;
43 $module_list = CModule::GetList();
44 while($module = $module_list->Fetch())
45 $this->aModules[] = $module[
"ID"];
63 return htmlspecialcharsex(
$APPLICATION->GetTitle(
false,
true));
68 return $this->isHideTitle;
79 return CUtil::JSEscape(
$APPLICATION->GetTitle(
false,
true));
84 if ($this->publicMode)
99 $s =
'<script bxrunfirst>'.
"\n";
100 for (
$i = 0, $cnt =
count($arCSS);
$i < $cnt;
$i++)
102 $bExternalLink = (strncmp($arCSS[
$i],
'http://', 7) == 0 || strncmp($arCSS[
$i],
'https://', 8) == 0);
103 if($bExternalLink || file_exists(
$_SERVER[
'DOCUMENT_ROOT'].$arCSS[
$i]))
104 $s .=
'top.BX.loadCSS(\''.CUtil::JSEscape($arCSS[
$i]).
'\');
'."\n";
110 public function ShowCSS()
112 if ($this->publicMode)
122 $arCSS = array_merge(array(
123 ADMIN_THEMES_PATH.'/
'.ADMIN_THEME_ID.'/compatible.css
',
124 //ADMIN_THEMES_PATH.'/
'.ADMIN_THEME_ID.'/adminstyles.css
',
125 '/bitrix/panel/main/adminstyles_fixed.css
',
126 '/bitrix/panel/main/admin.css
',
128 $this->GetModulesCSS(),
129 $APPLICATION->GetCSSArray()
133 foreach($arCSS as $css)
135 $bExternalLink = (strncmp($css, 'http:
136 if($bExternalLink || file_exists(
$_SERVER[
'DOCUMENT_ROOT'].$css))
137 $s .=
'<link rel="stylesheet" type="text/css" href="'.($bExternalLink? $css :
CUtil::GetAdditionalFileURL($css, true)).
'">'.
"\n";
146 $abs_theme_path =
$_SERVER[
"DOCUMENT_ROOT"].$rel_theme_path;
151 if(file_exists($abs_theme_path.$module_id.
".css"))
152 return array($rel_theme_path.$module_id.
'.css');
162 foreach($this->aModules as $module)
164 $fname = $abs_theme_path.$module.
".css";
165 if(file_exists($fname))
166 $time_fact .= filemtime($fname);
169 $css_file = $abs_theme_path.
"modules.css";
171 if($time_fact !== $time_cached)
175 foreach($this->aModules as $module)
177 $fname = $abs_theme_path.$module.
".css";
178 if(file_exists($fname))
179 $sCss .= file_get_contents($fname).
"\n";
183 file_put_contents($css_file, $sCss);
185 if($time_cached !==
'')
194 if(file_exists($css_file))
195 return array($rel_theme_path.
'modules.css');
205 $APPLICATION->AddHeadScript(
'/bitrix/js/main/utils.js');
206 $APPLICATION->AddHeadScript(
'/bitrix/js/main/hot_keys.js');
208 $APPLICATION->SetAdditionalCSS(
'/bitrix/panel/main/hot_keys.css');
210 if ($this->publicMode)
216 $aUserOpt = CUserOptions::GetOption(
"global",
"settings");
221 'LANGUAGE_ID': '".CUtil::JSEscape(LANGUAGE_ID).
"',
224 'opt_context_ctrl': ".((
$aUserOpt[
"context_ctrl"] ??
'') ==
"Y"?
"true":
"false").
",
225 'cookiePrefix': '".CUtil::JSEscape(COption::GetOptionString(
"main",
"cookie_name",
"BITRIX_SM")).
"',
226 'titlePrefix': '".CUtil::JSEscape(COption::GetOptionString(
"main",
"site_name",
$_SERVER[
"SERVER_NAME"])).
" - ',
228 'messHideMenu': '".CUtil::JSEscape(
GetMessage(
"admin_lib_hide_menu")).
"',
229 'messShowMenu': '".CUtil::JSEscape(
GetMessage(
"admin_lib_show_menu")).
"',
230 'messHideButtons': '".CUtil::JSEscape(
GetMessage(
"admin_lib_less_buttons")).
"',
231 'messShowButtons': '".CUtil::JSEscape(
GetMessage(
"admin_lib_more_buttons")).
"',
232 'messFilterInactive': '".CUtil::JSEscape(
GetMessage(
"admin_lib_filter_clear")).
"',
233 'messFilterActive': '".CUtil::JSEscape(
GetMessage(
"admin_lib_filter_set")).
"',
234 'messFilterLess': '".CUtil::JSEscape(
GetMessage(
"admin_lib_filter_less")).
"',
235 'messLoading': '".CUtil::JSEscape(
GetMessage(
"admin_lib_loading")).
"',
236 'messMenuLoading': '".CUtil::JSEscape(
GetMessage(
"admin_lib_menu_loading")).
"',
237 'messMenuLoadingTitle': '".CUtil::JSEscape(
GetMessage(
"admin_lib_loading_title")).
"',
238 'messNoData': '".CUtil::JSEscape(
GetMessage(
"admin_lib_no_data")).
"',
239 'messExpandTabs': '".CUtil::JSEscape(
GetMessage(
"admin_lib_expand_tabs")).
"',
240 'messCollapseTabs': '".CUtil::JSEscape(
GetMessage(
"admin_lib_collapse_tabs")).
"',
241 'messPanelFixOn': '".CUtil::JSEscape(
GetMessage(
"admin_lib_panel_fix_on")).
"',
242 'messPanelFixOff': '".CUtil::JSEscape(
GetMessage(
"admin_lib_panel_fix_off")).
"',
243 'messPanelCollapse': '".CUtil::JSEscape(
GetMessage(
"admin_lib_panel_hide")).
"',
244 'messPanelExpand': '".CUtil::JSEscape(
GetMessage(
"admin_lib_panel_show")).
"'
248 $APPLICATION->AddHeadScript(
'/bitrix/js/main/admin_tools.js');
249 $APPLICATION->AddHeadScript(
'/bitrix/js/main/popup_menu.js');
250 $APPLICATION->AddHeadScript(
'/bitrix/js/main/admin_search.js');
260 echo
'<div id="index_page_result_div">';
267 var '.$sTableID.
' = new JCAdminList("'.
$sTableID.
'");
268 jsUtils.addEvent(window, "unload", function(){'.
$sTableID.
'.Destroy(true);});
270 function LoadIndex(mode)
273 jsUtils.LoadPageToDiv("'.
$page.
'?show_mode="+mode+"&mode=list'.($param<>
""?
"&".$param:
"").
'", "index_page_result_div");
296 if(
$USER->IsAuthorized() && !isset($_COOKIE[COption::GetOptionString(
"main",
"cookie_name",
"BITRIX_SM").
'_SOUND_LOGIN_PLAYED']))
303 $aUserOptGlobal[
"sound_login"] =
"/bitrix/sounds/main/bitrix_tune.mp3";
306 $APPLICATION->IncludeComponent(
"bitrix:player",
"audio",
311 "CONTROLBAR" =>
"none",
316 "HIGH_QUALITY" =>
"Y",
317 "BUFFER_LENGTH" =>
"2",
320 null,
array(
"HIDE_ICONS"=>
"Y")
322 $res = ob_get_contents();
326<div style="position:absolute; top:-1000px; left:-1000px;">
339 if(
$CACHE_MANAGER->Read(86400,
"sso_portal_list_".$USER->GetID()))
345 $queryResult =
false;
346 if(\
Bitrix\Main\Loader::includeModule(
'socialservices'))
348 if(class_exists(
'CBitrix24NetTransport'))
353 $queryResult =
$query->call(
'admin.profile.list',
array());
361 if(is_array($queryResult))
365 if(isset($queryResult[
'error']))
368 $queryResult[
'error'] ==
'insufficient_scope'
369 && \
Bitrix\Main\Loader::includeModule(
'socialservices')
370 && class_exists(
"Bitrix\\Socialservices\\Network")
371 && method_exists(
"Bitrix\\Socialservices\\Network",
"getAuthUrl")
374 $n = new \Bitrix\Socialservices\Network();
376 "TEXT" => \
Bitrix\Main\Localization\Loc::getMessage(
"admin_lib_sso_auth"),
377 "TITLE" => \
Bitrix\Main\Localization\Loc::getMessage(
"admin_lib_sso_auth_title"),
378 "ONCLICK"=>
"BX.util.popup('".CUtil::JSEscape(
$n->getAuthUrl(
"popup",
array(
"admin"))).
"', 800, 600);",
382 elseif(isset($queryResult[
'result']))
384 $currentHost = \Bitrix\Main\Context::getCurrent()->getRequest()->getHttpHost();
386 foreach($queryResult[
'result'][
'admin'] as
$site)
388 if(
$site[
"TITLE"] != $currentHost)
391 "TEXT" =>
$site[
"TITLE"],
392 "TITLE"=>
"Go to ".
$site[
"TITLE"],
393 "LINK"=>
$site[
"URL"].
"bitrix/admin/",
400 && !empty($queryResult[
'result'][
"portal"])
403 $ssoMenu[] =
array(
"SEPARATOR" =>
true);
406 foreach($queryResult[
'result'][
'portal'] as
$site)
409 "TEXT" =>
$site[
"TITLE"],
410 "TITLE"=>
"Go to ".
$site[
"TITLE"],
411 "LINK"=>
$site[
"URL"],
424 return (defined(
"SELF_FOLDER_URL") ? SELF_FOLDER_URL :
"/bitrix/admin/");
441 $this->context = Application::getInstance()->getContext();
442 $this->request = $this->context->getRequest();
472 $response = Bitrix\Main\Context::getCurrent()->getResponse()->copyHeadersTo(
$response);
490 return $this->request->isAjaxRequest();
495 define(
"ADMIN_AJAX_MODE",
true);
496 require_once(
$_SERVER[
"DOCUMENT_ROOT"].
BX_ROOT.
"/modules/main/include/epilog_admin_after.php");
508 parent::__construct();
516 || (defined(
"PUBLIC_MODE") && PUBLIC_MODE == 1)
522 $this->publicPageProcessMode = $mode;
532 $this->skipResponse = $skip;
537 $post = $this->request->getPostList()->toArray();
539 $listActions =
array();
540 switch ($responseType)
543 if (!empty(
$post[
"save"]))
544 $listActions[] =
"destroy";
545 if (!empty(
$post[
"save_and_add"]))
546 $listActions[] =
"closeAndOpen";
549 if (!empty(
$post[
"save"]))
550 $listActions[] =
"close";
551 if (!empty(
$post[
"apply"]))
552 $listActions[] =
"reload";
555 $listActions[] =
"close";
558 $listActions[] =
"destroy";
561 $listActions[] =
"close";
564 if (!empty($dataToForm[
"reloadUrl"]))
568 if (!str_contains($dataToForm[
"reloadUrl"],
"publicSidePanel"))
570 $dataToForm[
"reloadUrl"] = (
new Uri($dataToForm[
"reloadUrl"]))
571 ->addParams([
"publicSidePanel" =>
"Y"])
579 "status" =>
"success",
580 "listActions" => $listActions,
582 "formParams" => $dataToForm
591 $uri = (
new Uri($redirectUrl))->addParams([
593 "IFRAME_TYPE" =>
"SIDE_SLIDER",
594 "sidePanelAction" =>
$type
598 $uri->addParams([
"publicSidePanel" =>
"Y"]);
610 return ((
$_REQUEST[
"IFRAME"] ??
'') ==
"Y") && ((
$_REQUEST[
"IFRAME_TYPE"] ??
'') ==
"SIDE_SLIDER");
615 return ((
$_REQUEST[
"IFRAME"] ??
'') ===
"Y");
625 return ((
$_REQUEST[
"IFRAME"] ??
'') ==
"Y") && ((
$_REQUEST[
"IFRAME_TYPE"] ??
'') ==
"SIDE_SLIDER");
630 return ((
$_REQUEST[
"IFRAME"] ??
'') ==
"Y") && ((
$_REQUEST[
"IFRAME_TYPE"] ??
'') ==
"PUBLIC_FRAME");
637 $frameType =
"SIDE_SLIDER";
640 $frameType =
"PUBLIC_FRAME";
642 $params =
array(
"IFRAME" =>
"Y",
"IFRAME_TYPE" => $frameType);
645 $params[
"publicSidePanel"] =
"Y";
659 $url = str_replace(
".php",
"/",
$url);
673 echo
"top.window.location.href = '".CUtil::JSEscape(
$url).
"';";
699 $aOptMenu = CUserOptions::GetOption(
"admin_menu",
"pos",
array());
702 $aModuleMenu =
array();
710 $fname =
getLocalPath(
"modules/".$module.
"/admin/menu.php");
714 if(is_array($menu) && !empty($menu))
716 if(isset($menu[
"parent_menu"]) && $menu[
"parent_menu"] <>
"")
719 $aModuleMenu[] = $menu;
724 foreach($menu as $submenu)
726 if(is_array($submenu) && !empty($submenu))
728 $aModuleMenu[] = $submenu;
738 $aMenuLinks =
array();
739 if(file_exists(
$_SERVER[
"DOCUMENT_ROOT"].
BX_ROOT.
"/admin/.left.menu.php"))
741 if(!empty($aMenuLinks))
743 $bWasSeparator =
false;
745 foreach($aMenuLinks as $module_menu)
747 if($module_menu[3][
"SEPARATOR"] ==
"Y")
751 $aModuleMenu[] = $menu;
754 "parent_menu" =>
"global_menu_services",
755 "icon" =>
"default_menu_icon",
756 "page_icon" =>
"default_page_icon",
757 "items_id"=>$module_menu[3][
"SECTION_ID"],
759 "sort"=>$module_menu[3][
"SORT"],
760 "text" => $module_menu[0],
762 $bWasSeparator =
true;
764 elseif($bWasSeparator && $module_menu[3][
"SECTION_ID"] ==
"")
767 $menu[
"items"][] =
array(
768 "text" => $module_menu[0],
769 "title"=>$module_menu[3][
"ALT"],
770 "url" => $module_menu[1],
771 "more_url"=>$module_menu[2],
774 elseif($module_menu[3][
"SECTION_ID"] ==
"" || $module_menu[3][
"SECTION_ID"] ==
"statistic" || $module_menu[3][
"SECTION_ID"] ==
"sale")
777 $aModuleMenu[] =
array(
778 "parent_menu" => ($module_menu[3][
"SECTION_ID"] ==
"statistic"?
"global_menu_statistics" : ($module_menu[3][
"SECTION_ID"] ==
"sale"?
"global_menu_store":
"global_menu_services")),
779 "icon" =>
"default_menu_icon",
780 "page_icon" =>
"default_page_icon",
781 "sort"=>$module_menu[3][
"SORT"],
782 "text" => $module_menu[0],
783 "title"=>$module_menu[3][
"ALT"],
784 "url" => $module_menu[1],
785 "more_url"=>$module_menu[2],
791 foreach($aModuleMenu as
$i=>$section)
793 if($section[
"section"] == $module_menu[3][
"SECTION_ID"])
795 if(!is_array($section[
"items"]))
796 $aModuleMenu[
$i][
"items"] =
array();
798 $aModuleMenu[
$i][
"items"][] =
array(
799 "text" => $module_menu[0],
800 "title"=>$module_menu[3][
"ALT"],
801 "url" => $module_menu[1],
802 "more_url"=>$module_menu[2],
810 $aModuleMenu[] = $menu;
813 $this->aGlobalMenu =
array(
814 "global_menu_desktop" =>
array(
815 "menu_id" =>
"desktop",
817 "title" =>
GetMessage(
'admin_lib_desktop_title'),
818 "url" =>
"index.php?lang=".LANGUAGE_ID,
820 "items_id" =>
"global_menu_desktop",
821 "help_section" =>
"desktop",
824 "global_menu_content" =>
array(
825 "menu_id" =>
"content",
826 "text" =>
GetMessage(
"admin_lib_menu_content"),
827 "title" =>
GetMessage(
"admin_lib_menu_content_title"),
829 "items_id" =>
"global_menu_content",
830 "help_section" =>
"content",
833 "global_menu_landing" =>
array(
834 "menu_id" =>
"landing",
835 "text" =>
GetMessage(
"admin_lib_menu_landing"),
837 "items_id" =>
"global_menu_landing",
838 "help_section" =>
"landing",
841 "global_menu_marketing" =>
array(
842 "menu_id" =>
"marketing",
843 "text" =>
GetMessage(
"admin_lib_menu_marketing"),
845 "items_id" =>
"global_menu_marketing",
846 "help_section" =>
"marketing",
849 "global_menu_store" =>
array(
850 "menu_id" =>
"store",
852 "title" =>
GetMessage(
"admin_lib_menu_store_title"),
854 "items_id" =>
"global_menu_store",
855 "help_section" =>
"store",
858 "global_menu_services" =>
array(
859 "menu_id" =>
"services",
860 "text" =>
GetMessage(
"admin_lib_menu_services"),
861 "title" =>
GetMessage(
"admin_lib_menu_service_title"),
863 "items_id" =>
"global_menu_services",
864 "help_section" =>
"service",
867 "global_menu_statistics" =>
array(
868 "menu_id" =>
"analytics",
870 "title" =>
GetMessage(
"admin_lib_menu_stat_title"),
872 "items_id" =>
"global_menu_statistics",
873 "help_section" =>
"statistic",
876 "global_menu_marketplace" =>
array(
877 "menu_id" =>
"marketPlace",
878 "text" =>
GetMessage(
"admin_lib_menu_marketplace"),
879 "title" =>
GetMessage(
"admin_lib_menu_marketplace_title"),
880 "url" =>
"update_system_market.php?lang=".LANGUAGE_ID,
882 "items_id" =>
"global_menu_marketplace",
883 "help_section" =>
"marketplace",
886 "global_menu_settings" =>
array(
887 "menu_id" =>
"settings",
888 "text" =>
GetMessage(
"admin_lib_menu_settings"),
889 "title" =>
GetMessage(
"admin_lib_menu_settings_title"),
891 "items_id" =>
"global_menu_settings",
892 "help_section" =>
"settings",
899 foreach(
GetModuleEvents(
"main",
"OnBuildGlobalMenu",
true) as $arEvent)
904 $this->aGlobalMenu = array_merge($this->aGlobalMenu,
$arRes);
907 uasort($this->aGlobalMenu,
array($this,
'_sort'));
909 foreach($aModuleMenu as $menu)
910 $this->aGlobalMenu[$menu[
"parent_menu"]][
"items"][] = $menu;
912 $sort_func =
array($this,
'_sort');
913 foreach($this->aGlobalMenu as
$key => $menu)
915 if(empty($menu[
"items"]) &&
$key !=
"global_menu_desktop")
917 unset($this->aGlobalMenu[
$key]);
919 elseif(is_array($this->aGlobalMenu[
$key][
"items"]))
921 usort($this->aGlobalMenu[
$key][
"items"], $sort_func);
925 foreach($this->aGlobalMenu as
$key=>$menu)
932 if(
$a[
"sort"] == $b[
"sort"])
934 return (
$a[
"sort"] < $b[
"sort"]? -1 : 1);
942 $aModuleMenuLinks =
array();
943 $menu = include($fname);
945 if(is_array($menu) && !empty($menu))
948 if(!empty($aModuleMenuLinks))
952 foreach($aModuleMenuLinks as $module_menu)
958 "parent_menu" =>
"global_menu_services",
959 "icon" =>
"default_menu_icon",
960 "page_icon" =>
"default_page_icon",
961 "items_id"=>
"sect_".md5($fname),
963 "sort"=>$module_menu[3][
"SORT"],
964 "text" => $module_menu[0],
965 "url" => $module_menu[1],
971 $menu[
"items"][] =
array(
972 "text" => $module_menu[0],
973 "title"=>$module_menu[3][
"ALT"],
974 "url" => $module_menu[1],
975 "more_url"=>$module_menu[2],
990 $bSubmenu = (!empty(
$aMenu[
"items"]) && is_array(
$aMenu[
"items"]));
993 "menu_id" =>
$aMenu[
"menu_id"] ??
null,
994 "items_id"=>
$aMenu[
"items_id"],
995 "page_icon"=>
$aMenu[
"page_icon"] ??
null,
997 "url"=>
$aMenu[
"url"] ??
null,
998 "skip_chain"=>
$aMenu[
"skip_chain"] ??
null,
999 "help_section"=>
$aMenu[
"help_section"] ??
null,
1003 $mainUrl = (isset(
$aMenu[
"url"]) &&
$aMenu[
"url"] <>
"");
1004 $bMoreUrl = (!empty(
$aMenu[
"more_url"]) && is_array(
$aMenu[
"more_url"]));
1005 if($mainUrl || $bMoreUrl)
1009 $all_links =
array();
1011 $all_links[] =
$aMenu[
"url"];
1013 $all_links = array_merge($all_links,
$aMenu[
"more_url"]);
1016 for($j = 0; $j <
$n; $j++)
1021 if(empty($all_links[$j]))
1024 if(!str_starts_with($all_links[$j],
"/bitrix/admin/"))
1025 $tested_link =
"/bitrix/admin/".$all_links[$j];
1027 $tested_link = $all_links[$j];
1029 if($tested_link <>
'' && mb_strpos($cur_page,$tested_link) === 0)
1035 if(($pos = mb_strpos($tested_link,
"?"))!==
false)
1037 if(mb_substr($tested_link,0,$pos)==$cur_page)
1039 $right = mb_substr($tested_link,$pos+1);
1043 foreach (
$params as $paramKeyAndValue)
1045 $eqpos = mb_strpos($paramKeyAndValue,
"=");
1047 if($eqpos ===
false)
1049 $varname = $paramKeyAndValue;
1057 $varname = mb_substr($paramKeyAndValue,0,$eqpos);
1058 $varvalue = urldecode(mb_substr($paramKeyAndValue,$eqpos+1));
1061 $globvarvalue =
$_REQUEST[$varname] ??
"";
1062 if($globvarvalue != $varvalue)
1079 $bSelectedInside =
false;
1085 $bSelectedInside =
true;
1090 if($bSelected && !$bSelectedInside)
1094 $aSections[
"_active"] =
array(
1095 "menu_id"=>
$aMenu[
"menu_id"] ??
null,
1096 "page_icon"=>
$aMenu[
"page_icon"] ??
null,
1098 "url"=>
$aMenu[
"url"] ??
null,
1099 "skip_chain"=>
$aMenu[
"skip_chain"] ??
null,
1100 "help_section"=>
$aMenu[
"help_section"] ??
null,
1103 $aMenu[
"_active"] =
true;
1104 $this->aActiveSections = $aSections;
1107 return $bSelected || $bSelectedInside;
1110 private function _get_menu_item_width($level)
1112 static $START_MAGIC_NUMBER = 30, $STEP_MAGIC_NUMBER = 21;
1113 return $START_MAGIC_NUMBER + $level*$STEP_MAGIC_NUMBER;
1116 private function _get_menu_item_padding($level)
1118 static $ADDED_MAGIC_NUMBER = 8;
1119 return $this->_get_menu_item_width($level) + $ADDED_MAGIC_NUMBER;
1126 $bSubmenu = (!empty(
$aMenu[
"items"]) && is_array(
$aMenu[
"items"])) || isset(
$aMenu[
"dynamic"]) &&
$aMenu[
"dynamic"] ==
true;
1127 $bSectionActive = isset(
$aMenu[
"items_id"]) && (in_array(
$aMenu[
"items_id"], array_keys($this->aActiveSections)) || $this->
IsSectionActive(
$aMenu[
"items_id"]));
1130 ?
'<span class="adm-submenu-item-link-icon '.$aMenu[
"icon"].
'"></span>'
1133 $id =
'menu_item_'.RandString(10);
1134 ?><div
class=
"adm-sub-submenu-block<?=$level > 0 ? ' adm-submenu-level-'.($level+1) : ''?><?=$bSectionActive && !empty($aMenu['items']) && is_array($aMenu["items
"]) ? ' adm-sub-submenu-open' : ''?><?= isset($aMenu["_active
"]) && $aMenu["_active
"] ? ' adm-submenu-item-active' : ''?>"><?
1135 ?><div
class=
"adm-submenu-item-name<?=!$bSubmenu ? ' adm-submenu-no-children' : ''?>" id=
"<?=$id?>" data-type=
"submenu-item"<?=isset(
$aMenu[
'fav_id']) ?
' data-fav-id="'.intval(
$aMenu[
'fav_id']).
'"' :
''?>><?
1141 $onclick =
"BX.adminMenu.toggleDynSection(".$this->_get_menu_item_width($level).
", this.parentNode.parentNode, '".
htmlspecialcharsbx(CUtil::JSEscape(
$aMenu[
"module_id"])).
"', '".urlencode(
htmlspecialcharsbx(CUtil::JSEscape(
$aMenu[
"items_id"]))).
"', '".($level+1).
"')";
1145 $onclick =
"BX.adminMenu.toggleSection(this.parentNode.parentNode, '".htmlspecialcharsbx(CUtil::JSEscape(
$aMenu[
"items_id"])).
"', '".($level+1).
"')";
1149 ?><span
class=
"adm-submenu-item-arrow"<?=$level > 0 ?
' style="width:'.$this->_get_menu_item_width($level).
'px;"' :
''?><?=$onclick ?
' onclick="'.$onclick.
'"' :
''?>><span
class=
"adm-submenu-item-arrow-icon"></span></span><?
1154 ?><a
class=
"adm-submenu-item-name-link<?=(isset($aMenu["readonly
"]) && $aMenu["readonly
"]? ' menutext-readonly':'')?>"<?=$level > 0 ?
' style="padding-left:'.$this->_get_menu_item_padding($level).
'px;"' :
''?> href=
"<?=$menuUrl?>"><?=$icon?><span
class=
"adm-submenu-item-name-link-text"><?=$menuText?></span></a><?
1156 if(isset(
$aMenu[
"dynamic"]) &&
$aMenu[
"dynamic"] && !$bSectionActive && empty(
$aMenu[
"items"])):
1157 ?><a
class=
"adm-submenu-item-name-link<?=(isset($aMenu["readonly
"]) && $aMenu["readonly
"]? ' menutext-readonly':'')?>"<?=$level > 0 ?
' style="padding-left:'.$this->_get_menu_item_padding($level).
'px;"' :
''?> href=
"javascript:void(0)" onclick=
"BX.adminMenu.toggleDynSection(<?=$this->_get_menu_item_width($level)?>, this.parentNode.parentNode, '<?=htmlspecialcharsbx(CUtil::JSEscape($aMenu["module_id
"]))?>', '<?=htmlspecialcharsbx(CUtil::JSEscape($aMenu["items_id
"]))?>', '<?=$level+1?>')"><?=$icon?><span
class=
"adm-submenu-item-name-link-text"><?=$menuText?></span></a><?
1159 ?><a
class=
"adm-submenu-item-name-link<?=(isset($aMenu["readonly
"]) && $aMenu["readonly
"]? ' menutext-readonly':'')?>"<?=$level > 0 ?
' style="padding-left:'.$this->_get_menu_item_padding($level).
'px;"' :
''?> href=
"javascript:void(0)" onclick=
"BX.adminMenu.toggleSection(this.parentNode.parentNode, '<?=htmlspecialcharsbx(CUtil::JSEscape($aMenu["items_id
"]))?>', '<?=$level+1?>')"><?=$icon?><span
class=
"adm-submenu-item-name-link-text"><?=$menuText?></span></a><?
1161 ?><span
class=
"adm-submenu-item-name-link<?=(isset($aMenu["readonly
"]) && $aMenu["readonly
"]? ' menutext-readonly':'')?>"<?=$level > 0 ?
' style="padding-left:'.$this->_get_menu_item_padding($level).
'px"' :
''?>><?=$icon?><span
class=
"adm-submenu-item-name-link-text"><?=$menuText?></span></span><?
1164 ?><span
class=
"adm-submenu-item-name-link<?=(isset($aMenu["readonly
"]) && $aMenu["readonly
"]? ' menutext-readonly':'')?>"<?=$level > 0 ?
' style="padding-left:'.$this->_get_menu_item_padding($level).
'px"' :
''?>><?=$icon?><span
class=
"adm-submenu-item-name-link-text"><?=$menuText?></span></span><?
1168 if(($bSubmenu || (isset(
$aMenu[
"dynamic"]) &&
$aMenu[
"dynamic"])) && is_array(
$aMenu[
"items"]))
1170 echo
"<div class=\"adm-sub-submenu-block-children\">";
1171 foreach(
$aMenu[
"items"] as $submenu)
1175 $scripts .= $this->
Show($submenu, $level+1);
1181 echo
"<div class=\"adm-sub-submenu-block-children\"></div>";
1183 $url = str_replace(
"&",
"&",
$aMenu[
'url'] ??
'');
1185 if (isset(
$aMenu[
"fav_id"]))
1187 $scripts .=
"BX.adminMenu.registerItem('".$id.
"', {FAV_ID:'".CUtil::JSEscape(
$aMenu[
'fav_id']).
"'});";
1191 $scripts .=
"BX.adminMenu.registerItem('".$id.
"', {ID:'".CUtil::JSEscape(
$aMenu[
'items_id']).
"', URL:'".CUtil::JSEscape(
$url).
"', MODULE_ID:'".(
$aMenu[
'module_id'] ??
'').
"'});";
1195 $scripts .=
"BX.adminMenu.registerItem('".$id.
"', {ID:'".CUtil::JSEscape(
$aMenu[
'items_id']).
"', MODULE_ID:'".(
$aMenu[
'module_id'] ??
'').
"'});";
1199 $scripts .=
"BX.adminMenu.registerItem('".$id.
"', {URL:'".CUtil::JSEscape(
$url).
"'});";
1207 foreach(
$aMenu[
"items"] as $submenu)
1212 '<div class="index-icon-block" align="center">'.
1213 '<a href="'.$submenu[
"url"].
'" title="'.$submenu[
"title"].
'"><div class="index-icon" id="'.($submenu[
"page_icon"]<>
""? $submenu[
"page_icon"]:
$aMenu[
"page_icon"]).
'"></div>'.
1214 '<div class="index-label">'.$submenu[
"text"].
'</div></a>'.
1217 echo
'<br clear="all">';
1222 foreach(
$aMenu[
"items"] as $submenu)
1226 echo
'<div class="index-list" id="'.($submenu[
"icon"]<>
""? $submenu[
"icon"]:
$aMenu[
"icon"]).
'"><a href="'.$submenu[
"url"].
'" title="'.$submenu[
"title"].
'">'.$submenu[
"text"].
'</a></div>';
1238 array(
"id"=>
"NAME",
"content"=>
GetMessage(
"admin_lib_index_name"),
"default"=>
true),
1239 array(
"id"=>
"DESCRIPTION",
"content"=>
GetMessage(
"admin_lib_index_desc"),
"default"=>
true),
1242 foreach(
$aMenu[
"items"] as $submenu)
1247 $row = &
$lAdmin->AddRow(0,
null, $submenu[
"url"],
GetMessage(
"admin_lib_index_go"));
1248 $row->AddField(
"NAME",
'<a href="'.$submenu[
"url"].
'" title="'.$submenu[
"title"].
'">'.$submenu[
"text"].
'</a>');
1249 $row->AddField(
"DESCRIPTION", $submenu[
"title"]);
1256'.$sTableID.
'.InitTable();
1263 foreach($this->aGlobalMenu as
$key=>$menu)
1270 $bSubmenu = !empty(
$aMenu[
"items"]) && is_array(
$aMenu[
"items"]);
1273 if(
$aMenu[
"items_id"] == $menu_id)
1278 foreach(
$aMenu[
"items"] as $submenu)
1280 $menuScripts .= $this->
Show($submenu, $level);
1282 if ($menuScripts !=
"")
1283 echo
'<script>'.$menuScripts.
'</script>';
1296 foreach(
$aMenu[
"items"] as $submenu)
1297 if($this->
_ShowSubmenu($submenu, $menu_id, $mode, $level+1))
1306 if(!empty($this->aActiveSections))
1307 foreach($this->aActiveSections as $menu)
1310 foreach($this->aGlobalMenu as $menu)
1318 if(!empty($this->aActiveSections))
1320 $aSections = array_keys($this->aActiveSections);
1322 if($this->aActiveSections[$aSections[
$i]][
"page_icon"] <>
"")
1323 return $this->aActiveSections[$aSections[
$i]][
"page_icon"];
1325 return "default_page_icon";
1330 $aSect = explode(
",", $sections);
1331 foreach($aSect as $sect)
1332 if(trim($sect) <>
"")
1333 $this->aOpenedSections[] = trim($sect);
1338 return in_array($section, $this->aOpenedSections);
1343 return implode(
",", $this->aOpenedSections);
1358 $this->name =
$name;
1371window.'.$this->name.
' = new PopupMenu("'.$this->
id.
'"'.
1372 (is_array($this->params) && isset($this->params[
'zIndex'])?
', '.$this->params[
'zIndex']:
'').
1373 (is_array($this->params) && isset($this->params[
'dxShadow'])?
', '.$this->params[
'dxShadow']:
'').
1376 if(is_array($this->items))
1399 return 'adm-menu-edit';
1402 case 'btn_fileman_view':
1403 return 'adm-menu-view';
1406 return 'adm-menu-copy';
1409 return 'adm-menu-move';
1412 return 'adm-menu-rename';
1415 return 'adm-menu-delete';
1417 case 'btn_fileman_html':
1418 return 'adm-menu-edit-htm';
1420 case 'btn_fileman_php':
1421 return 'adm-menu-edit-php';
1423 case 'btn_fileman_text':
1424 return 'adm-menu-edit-txt';
1426 case 'btn_fileman_galka':
1427 return 'adm-menu-edit-wf';
1429 case 'btn_download':
1430 return 'adm-menu-download';
1433 return 'adm-menu-pack';
1436 return 'adm-menu-unpack';
1439 return 'adm-menu-access';
1441 case 'btn_fileman_prop':
1442 return 'adm-menu-folder-props';
1460 $sMenuUrl .=
"{'SEPARATOR':true}";
1463 if((
$action[
"ONCLICK"] ??
'') <>
"")
1467 && empty(
$action[
"GLOBAL_ICON"]))
1470 if ($icon_global_class)
1472 $action[
"GLOBAL_ICON"] = $icon_global_class;
1478 (isset(
$action[
"LINK"]) &&
$action[
"LINK"]<>
""?
"'LINK':'".CUtil::JSEscape(
$action[
"LINK"]).
"',":
"").
1479 (isset(
$action[
"DEFAULT"]) &&
$action[
"DEFAULT"] ===
true?
"'DEFAULT':true,":
"").
1480 (isset(
$action[
"CHECKED"]) &&
$action[
"CHECKED"] ===
true?
"'CHECKED':true,":
"").
1481 (isset(
$action[
"ICON"]) &&
$action[
"ICON"]<>
""?
"'ICONCLASS':'".CUtil::JSEscape(
$action[
"ICON"]).
"',":
"").
1482 (isset(
$action[
"GLOBAL_ICON"]) &&
$action[
"GLOBAL_ICON"]<>
""?
"'GLOBAL_ICON':'".CUtil::JSEscape(
$action[
"GLOBAL_ICON"]).
"',":
"").
1483 (isset(
$action[
"IMAGE"]) &&
$action[
"IMAGE"]<>
""?
"'IMAGE':'".CUtil::JSEscape(
$action[
"IMAGE"]).
"',":
"").
1485 (isset(
$action[
"DISABLED"]) &&
$action[
"DISABLED"]?
"'DISABLED':true,":
"").
1486 (isset(
$action[
"AUTOHIDE"]) && !
$action[
"AUTOHIDE"]?
"'AUTOHIDE':false,":
"").
1487 (isset(
$action[
"DEFAULT"]) &&
$action[
"DEFAULT"]?
"'DEFAULT':true,":
"").
1488 ((
$action[
"TEXT"] ??
'') <>
'' ?
"'TEXT':'".CUtil::JSEscape(
$action[
"TEXT"]).
"'," :
"").
1489 ((
$action[
"HTML"] ??
'') <>
'' ?
"'HTML':'".CUtil::JSEscape(
$action[
"HTML"]).
"'," :
"").
1490 (isset(
$action[
"TITLE"]) &&
$action[
"TITLE"]<>
""?
"'TITLE':'".CUtil::JSEscape(
$action[
"TITLE"]).
"',":
"").
1491 (isset(
$action[
"SHOW_TITLE"]) &&
$action[
"SHOW_TITLE"] ?
"'SHOW_TITLE':true,":
"").
1492 ((
$action[
"ACTION"] ??
'') <>
'' ?
"'ONCLICK':'".CUtil::JSEscape(str_replace(
"&",
"&",
$action[
"ACTION"])).
"'," :
"").
1493 (isset(
$action[
"ONMENUPOPUP"]) &&
$action[
"ONMENUPOPUP"]<>
""?
"'ONMENUPOPUP':'".CUtil::JSEscape(
$action[
"ONMENUPOPUP"]).
"',":
"").
1495 (isset(
$action[
"MENU_URL"]) &&
$action[
"MENU_URL"]<>
''?
"'MENU_URL':'".CUtil::JSEscape(
$action[
"MENU_URL"]).
"',":
"").
1496 (isset(
$action[
"MENU_PRELOAD"]) &&
$action[
"MENU_PRELOAD"]?
"'MENU_PRELOAD':true,":
"").
1497 (isset(
$action[
"CLOSE_ON_CLICK"]) && !
$action[
"CLOSE_ON_CLICK"]?
"'CLOSE_ON_CLICK':false,":
"");
1499 $sItem = mb_substr($sItem,0,-1);
1500 $sMenuUrl .=
"{".$sItem.
"}";
1527 public function Show($bReturnValue=
false)
1530 if((!isset(
$_REQUEST[
"mode"]) ||
$_REQUEST[
"mode"] !=
"frame") && is_array($this->items))
1533 if (is_array($this->params))
1539 BX.bind(BX('".$this->element_id.
"'), 'click', function() {
1571 require_once(
$_SERVER[
"DOCUMENT_ROOT"].
BX_ROOT.
"/modules/main/interface/admin_lib.php");
1576 $this->isPublicMode = (defined(
"PUBLIC_MODE") && PUBLIC_MODE == 1);
1589 foreach ($listItems as &$item)
1591 if (!empty($item[
"LINK"]) && (!isset($item[
"PUBLIC"]) || !$item[
"PUBLIC"]))
1593 $selfFolderUrl = (defined(
"SELF_FOLDER_URL") ? SELF_FOLDER_URL :
"/bitrix/admin/");
1595 if (!preg_match($reqValue, $item[
"LINK"]) && !preg_match(
"/javascript:/", $item[
"LINK"]))
1601 $icon = $item[
"ICON"] ??
null;
1605 if ($this->isSidePanel)
1607 if (isset($item[
"TYPE"]))
1609 switch ($item[
"TYPE"])
1619 if (empty($item[
"ONCLICK"]))
1621 $item[
"ONCLICK"] =
"top.BX.onCustomEvent('SidePanel:close');";
1627 if (!empty($item[
"LINK"]) && preg_match(
"/set_default/", $item[
"LINK"]))
1628 $item[
"LINK"] .=
"&apply_filter=Y";
1633 if ($this->isSidePanel)
1635 if (empty($item[
"ONCLICK"]))
1637 $link = $item[
"ACTION"] ?: $item[
"LINK"];
1638 if (preg_match(
"/javascript:/", $item[
"LINK"]) || !empty($item[
"ACTION"]))
1640 if (preg_match(
"/window.location=(?P<postUrl>[^<]+(\"|\'))/", $link, $found) ||
1641 preg_match(
"/window.location.href=(?P<postUrl>[^<]+(\"|\'))/", $link, $found))
1644 $postUrl = $found[
"postUrl"];
1645 if (preg_match(
"/confirm\((?P<text>[^<]+(\"|\'))\)/", $link, $found))
1647 $confirmText = $found[
"text"];
1650 if ($confirmText && $postUrl)
1652 $item[
"ONCLICK"] =
"if(confirm(".$confirmText.
1653 ")) top.BX.onCustomEvent('AdminSidePanel:onSendRequest', [".$postUrl.
"]);";
1659 $item[
"ONCLICK"] = $item[
"LINK"];
1661 unset($item[
"LINK"]);
1662 unset($item[
"ACTION"]);
1669 if (!empty($item[
"MENU"]))
1681 foreach(
GetModuleEvents(
"main",
"OnAdminContextMenuShow",
true) as $arEvent)
1686 if(empty($this->items) && empty($this->additional_items))
1691 $hkInst = CHotKeys::getInstance();
1694 $bNeedSplitClosing =
false;
1695 foreach($this->items as $item)
1697 $item[
'ICON'] = (string)($item[
'ICON'] ??
'');
1698 if(!empty($item[
"NEWBAR"]))
1701 if($bFirst || !empty($item[
"NEWBAR"]))
1704 if(!empty($item[
"NEWBAR"]) || !empty($item[
'SEPARATOR']))
1707 if ($item[
'ICON'] !=
'btn_list' && !$bNeedSplitClosing)
1710 $bNeedSplitClosing =
true;
1713 $this->
Button($item, $hkInst);
1718 if (!empty($this->additional_items))
1728 if ($bNeedSplitClosing)
1737<div
class=
"adm-detail-toolbar"><span
style=
"position:absolute;"></span>
1750 $id =
'context_right_'.RandString(8);
1752<script>BX.ready(
function(){
1753var right_bar = BX(
'<?=$id?>');
1754BX.Fix(right_bar, {type:
'right', limit_node: BX.previousSibling(right_bar)});
1756<div
class=
"adm-detail-toolbar-right" id=
"<?=$id?>">
1772 return 'adm-btn-add';
1774 return 'adm-btn-copy';
1776 return 'adm-btn-delete';
1777 case 'btn_desktop_gadgets':
1778 return 'adm-btn-desktop-gadgets';
1779 case 'btn_desktop_settings':
1780 return 'adm-btn-desktop-settings';
1782 return 'adm-btn-active';
1784 return 'adm-btn-green';
1792 return 'adm-btn-active';
1802 $icon = (string)($item[
"ICON"] ??
'');
1803 $onclick = (string)($item[
'ONCLICK'] ??
'');
1804 $item[
'LINK'] = (string)($item[
'LINK'] ??
'');
1805 $item[
'LINK_PARAM'] = (string)($item[
'LINK_PARAM'] ??
'');
1806 $item[
'TITLE'] = (string)($item[
'TITLE'] ??
'');
1808 if(isset($item[
"HTML"]) && $item[
"HTML"] <>
"")
1810 echo
'<span class="adm-list-table-top-wrapper">'.$item[
'HTML'].
'</span>';
1812 elseif(!empty($item[
"MENU"]))
1815 ", {active_class: '".$this->GetActiveClassByID($icon).
"', public_frame: '".($this->isPublicFrame ? 1 : 0).
"'});";
1818 <a href=
"javascript:void(0)" hidefocus=
"true" onclick=
"this.blur();<?=$sMenuUrl?> return false;" class=
"adm-btn<?=$sClassName != '' ? ' '.$sClassName : ''?> adm-btn-menu" title=
"<?=($item["TITLE
"] ?? '');?>"><?=$item[
"TEXT"]?></a>
1825 if ($icon ==
'btn_list'):
1827 <a <?
if ($this->isPublicFrame):?>target=
"_top"<?
endif;?> href=
"<?=($onclick !== '' ? 'javascript:void(0)' : $link)?>" <?=$item[
"LINK_PARAM"]?>
class=
"adm-detail-toolbar-btn" title=
"<?=$item["TITLE
"].$hkInst->GetTitle($icon)?>"<?=($onclick !==
'' ?
' onclick="'.htmlspecialcharsbx($onclick).
'"':
'')?><?=(!empty($item[
"ICON"])?
' id="'.$item[
"ICON"].
'"':
'')?>><span
class=
"adm-detail-toolbar-btn-l"></span><span
class=
"adm-detail-toolbar-btn-text"><?=$item[
"TEXT"]?></span><span
class=
"adm-detail-toolbar-btn-r"></span></a>
1832 <a <?
if ($this->isPublicFrame):?>target=
"_top"<?
endif;?> href=
"<?=($onclick !== '' ? 'javascript:void(0)' : $link)?>" <?=$item[
"LINK_PARAM"]?>
class=
"adm-btn<?=$sClassName != '' ? ' '.$sClassName : ''?>" title=
"<?=$item["TITLE
"].$hkInst->GetTitle($icon)?>"<?=($onclick !==
'' ?
' onclick="'.htmlspecialcharsbx($onclick).
'"' :
'')?><?=(!empty($item[
"ICON"])?
' id="'.$item[
"ICON"].
'"':
'')?>><?=$item[
"TEXT"]?></a>
1836 $arExecs = $hkInst->GetCodeByClassName($icon);
1837 echo $hkInst->PrintJSExecs($arExecs,
"",
true,
true);
1845 <div
class=
"adm-small-button adm-table-setting" title=
"<?=htmlspecialcharsbx(GetMessage('admin_lib_context_sett_title'))?>" onclick=
"this.blur();<?=$sMenuUrl?> return false;" ></div>
1856<div
class=
"adm-list-table-top">
1862 if (str_starts_with($icon_id,
'btn_new'))
1863 return 'adm-btn-save adm-btn-add';
1865 return parent::GetClassByID($icon_id);
1870 if (str_starts_with($icon_id,
'btn_new'))
1871 return 'adm-btn-save-active';
1873 return parent::GetActiveClassByID($icon_id);
1878 if (isset($item[
'ICON']) && $item[
'ICON'] ==
'btn_list')
1881 parent::Button($item, $hkInst);
1911 $this->table_id = preg_replace(
'/[^a-z0-9_]/i',
'',
$table_id);
1915 $needUserByField =
false;
1916 $needUserOrder =
false;
1917 if(isset(
$GLOBALS[$this->by_name]))
1921 elseif(isset(\
Bitrix\Main\Application::getInstance()->getSession()[
"SESS_SORT_BY"][$this->table_id]))
1927 $needUserByField =
true;
1930 if(isset(
$GLOBALS[$this->ord_name]))
1934 elseif(isset(\
Bitrix\Main\Application::getInstance()->getSession()[
"SESS_SORT_ORDER"][$this->table_id]))
1940 $needUserOrder =
true;
1943 if ($needUserByField || $needUserOrder)
1946 if ($needUserByField)
1948 if (!empty($userSorting[
"by"]))
1950 elseif ($this->by_initial !==
false)
1955 if(!empty($userSorting[
"order"]))
1957 elseif($this->order_initial !==
false)
1973 public function Show(
$text, $sort_by, $alt_title =
false, $baseCssClass =
"")
1979 if(mb_strtolower($this->field) == mb_strtolower($sort_by))
1981 if(mb_strtolower($this->order) ==
"desc")
1984 $title .=
" ".GetMessage(
"admin_lib_sort_down");
1989 $title .=
" ".GetMessage(
"admin_lib_sort_up");
1998 $path = preg_replace(
"/([?&])".$this->by_name.
"=[^&]*[&]*/i",
"\\1",
$path);
1999 $path = preg_replace(
"/([?&])".$this->ord_name.
"=[^&]*[&]*/i",
"\\1",
$path);
2000 $path = preg_replace(
"/([?&])mode=[^&]*[&]*/i",
"\\1",
$path);
2001 $path = preg_replace(
"/([?&])table_id=[^&]*[&]*/i",
"\\1",
$path);
2002 $path = preg_replace(
"/([?&])action=[^&]*[&]*/i",
"\\1",
$path);
2005 if(($last = mb_substr(
$path,-1,1)) ==
"?" || $last ==
"&")
2008 $url =
$path.$sep.$this->by_name.
"=".$sort_by.
"&".$this->ord_name.
"=".($class <>
""? $ord:
"");
2010 return 'class="'.$baseCssClass.
' adm-list-table-cell-sort'.$class.
'" onclick="'.$this->table_id.
'.Sort(\''.
htmlspecialcharsbx(CUtil::addslashes(
$url)).
'\',
'.($class <> ""? "false" : "true").', arguments);
" title="'.$title.'"';
2016 public function getField()
2018 return $this->field;
2024 public function getOrder()
2026 return $this->order;
2032 protected function getUserSorting()
2034 $userSorting = CUserOptions::GetOption(
2037 array("by
" => $this->by_initial, "order
" => $this->order_initial)
2040 "by
" => (!empty($userSorting["by
"]) ? $userSorting["by
"] : null),
2041 "order
" => (!empty($userSorting["order
"]) ? $userSorting["order
"] : null)
2049 CIBlockResult has copy of the methods of this class
2050 because we need CIBlockResult::Fetch method to be called on iblock_element_admin.php page.
2051 So this page based on CIBlockResult not on CAdminResult!
2053class CAdminResult extends CDBResult
2063 public function __construct($res, $table_id)
2065 parent::__construct($res);
2066 $this->table_id = preg_replace('/[^a-z0-9_]/i', '', $table_id);
2069 public function NavStart($nPageSize=20, $bShowAll=true, $iNumPage=false)
2071 $nSize = self::GetNavSize($this->table_id, $nPageSize);
2073 if(!is_array($nPageSize))
2074 $nPageSize = array();
2076 $nPageSize["nPageSize
"] = $nSize;
2077 if (isset($_REQUEST["mode
"]) && $_REQUEST["mode
"] === "excel
")
2079 $nPageSize["NavShowAll
"] = true;
2082 $this->nInitialSize = $nPageSize["nPageSize
"];
2084 parent::NavStart($nPageSize, $bShowAll, $iNumPage);
2087 protected function parentNavStart($nPageSize, $bShowAll, $iNumPage)
2089 parent::NavStart($nPageSize, $bShowAll, $iNumPage);
2097 public static function GetNavSize($table_id=false, $nPageSize=20)
2099 global $NavNum, $APPLICATION;
2101 if (!isset($NavNum))
2104 if (is_array($nPageSize))
2106 $sNavID = (string)($nPageSize["sNavID
"] ?? '');
2109 $application = Application::getInstance();
2111 $inSession = (CPageOption::GetOptionString("main
", "nav_page_in_session
", "Y
") == "Y
") && $application->getKernelSession()->isStarted();
2115 $localStorage = $application->getLocalSession('navigation');
2116 $session = $localStorage->getData();
2118 $unique = md5($sNavID ?? $APPLICATION->GetCurPage()) . "PAGE_SIZE_
" . ($NavNum + 1);
2121 if (isset($_REQUEST["SIZEN_
".($NavNum+1)]))
2123 $nSize = (int)$_REQUEST["SIZEN_
".($NavNum+1)];
2126 $localStorage->set($unique, $nSize);
2129 elseif ($inSession && isset($session[$unique]))
2131 $nSize = $session[$unique];
2135 $aOptions = array();
2138 $aOptions = CUserOptions::GetOption("list
", $table_id);
2140 if (!is_array($aOptions))
2144 $optionSize = (int)($aOptions['page_size'] ?? 0);
2145 if ($optionSize > 0)
2147 $nSize = $optionSize;
2151 $nSize = (is_array($nPageSize)? $nPageSize["nPageSize
"]:$nPageSize);
2157 public function GetNavPrint($title, $show_allways=true, $StyleText="", $template_path=false, $arDeleteParam=false)
2159 if($template_path === false)
2160 $template_path = $_SERVER["DOCUMENT_ROOT
"]."/bitrix/modules/main/interface/navigation.php
";
2161 return parent::GetNavPrint($title, $show_allways, $StyleText, $template_path, array('action', 'sessid'));
2175 public function __construct($message, $exception=false)
2177 //array("MESSAGE
"=>"", "TYPE
"=>("ERROR
"|"OK
"|"PROGRESS
"), "DETAILS
"=>"", "HTML
"=>true)
2178 if(!is_array($message))
2179 $message = array("MESSAGE
"=>$message, "TYPE
"=>"ERROR
");
2180 if(empty($message["DETAILS
"]) && $exception !== false)
2181 $message["DETAILS
"] = $exception->GetString();
2182 $this->message = $message;
2183 $this->exception = $exception;
2186 public function Show()
2188 $publicMode = false;
2189 if (defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1 && $this->message["TYPE
"] != "PROGRESS
" && (!isset($this->message['SKIP_PUBLIC_MODE']) || $this->message['SKIP_PUBLIC_MODE'] !== true))
2191 $alertMessage = ($this->message['DETAILS'] <> ''? $this->message['DETAILS'] : $this->message['MESSAGE']);
2192 $alertMessage = htmlspecialcharsback($alertMessage); //we don't need html entities in an alert() box, see BX.CWindow.prototype.ShowError
2193 $alertMessage = str_replace(array('<br>', '<br />', '<BR>', '<BR />'), "\r\n
", $alertMessage);
2197 var currentWindow =
top.window;
2198 if (
top.BX.SidePanel &&
top.BX.SidePanel.Instance &&
top.BX.SidePanel.Instance.getTopSlider())
2200 currentWindow =
top.BX.SidePanel.Instance.getTopSlider().getWindow();
2202 currentWindow.BX.WindowManager.Get().ShowError(
'".CUtil::JSEscape($alertMessage)."');</script>
";
2206 if (defined('PUBLIC_MODE') && PUBLIC_MODE == 1)
2209 \Bitrix\Main\UI\Extension::load("ui.alerts
");
2212 if (isset($this->message["MESSAGE
"]) && $this->message["MESSAGE
"])
2213 $title = '<div class="adm-info-message-
title">'.$this->_formatHTML($this->message["MESSAGE
"]).'</div>';
2217 if(isset($this->message["DETAILS
"]) && $this->message["DETAILS
"])
2218 $details = $this->_formatHTML($this->message["DETAILS
"]);
2222 if(isset($this->message["TYPE
"]) && $this->message["TYPE
"] == "OK
")
2224 $baseClass = "adm-info-message-wrap adm-info-message-green
";
2225 $messageClass = "adm-info-message
";
2228 $baseClass = "ui-alert ui-alert-success
";
2229 $messageClass = "ui-btn-message
";
2233 <div class="'.$baseClass.'">
2234 <div class="'.$messageClass.'">
2237 <div class="adm-info-message-icon
"></div>
2242 elseif(isset($this->message["TYPE
"]) && $this->message["TYPE
"] == "PROGRESS
")
2244 $baseClass = "adm-info-message-wrap adm-info-message-gray
";
2245 $messageClass = "adm-info-message
";
2248 $baseClass = "ui-alert ui-alert-primary
";
2249 $messageClass = "ui-btn-message
";
2252 if (isset($this->message['PROGRESS_ICON']) && $this->message['PROGRESS_ICON'])
2253 $title = '<div class="adm-info-message-icon-progress
"></div>'.$title;
2255 $details = str_replace("#PROGRESS_BAR#
", $this->_getProgressHtml(), $details);
2257 <div class="'.$baseClass.'">
2258 <div class="'.$messageClass.'">
2261 <div class="adm-info-message-buttons
">'.$this->_getButtonsHtml().'</div>
2268 $baseClass = "adm-info-message-wrap adm-info-message-red
";
2269 $messageClass = "adm-info-message
";
2272 $baseClass = "ui-alert ui-alert-danger
";
2273 $messageClass = "ui-btn-message
";
2276 <div class="'.$baseClass.'">
2277 <div class="'.$messageClass.'">
2280 <div class="adm-info-message-icon
"></div>
2289 public function _getProgressHtml()
2291 $w = isset($this->message['PROGRESS_WIDTH']) ? intval($this->message['PROGRESS_WIDTH']) : 500;
2293 if (isset($this->message['PROGRESS_TOTAL']) && $this->message['PROGRESS_TOTAL'] > 0)
2294 $p = $this->message['PROGRESS_VALUE']/$this->message['PROGRESS_TOTAL'];
2301 $innerText = number_format(100*$p, 0) .'%';
2302 if (!empty($this->message['PROGRESS_TEMPLATE']))
2304 $innerText = str_replace(
2305 array('#PROGRESS_TOTAL#', '#PROGRESS_VALUE#', '#PROGRESS_PERCENT#'),
2306 array($this->message['PROGRESS_TOTAL'], $this->message['PROGRESS_VALUE'], $innerText),
2307 $this->message['PROGRESS_TEMPLATE']
2311 $s = '<div class="adm-progress-bar-outer
" style="width:
'.$w.'px;
"><div class="adm-progress-bar-inner
" style="width:
'.intval($p*($w-4)).'px;
"><div class="adm-progress-bar-inner-text
" style="width:
'.$w.'px;
">'.$innerText.'</div></div>'.$innerText.'</div>';
2316 public function _getButtonsHtml()
2319 if(isset($this->message["BUTTONS
"]) && is_array($this->message["BUTTONS
"]))
2321 foreach($this->message["BUTTONS
"] as $button)
2322 $s .= '<input type="button
" onclick="'.htmlspecialcharsbx($button["ONCLICK"]).'" value="'.htmlspecialcharsbx($button["VALUE"]).'" '.($button["ID
"]? 'id="'.htmlspecialcharsbx($button["ID"]).'"': '').'>';
2327 public function _formatHTML($html)
2329 if(isset($this->message["HTML
"]) && $this->message["HTML
"])
2332 return _ShowHtmlspec($html);
2335 public function GetMessages()
2337 if($this->exception && method_exists($this->exception, 'GetMessages'))
2338 return $this->exception->GetMessages();
2342 public static function ShowOldStyleError($message)
2344 if(!empty($message))
2346 $m = new CAdminMessage(array("MESSAGE
"=>GetMessage("admin_lib_error
"), "DETAILS
"=>$message, "TYPE
"=>"ERROR
"));
2351 public static function ShowMessage($message)
2353 if(!empty($message))
2355 $m = new CAdminMessage($message);
2360 public static function ShowNote($message)
2362 if(!empty($message))
2363 CAdminMessage::ShowMessage(array("MESSAGE
"=>$message, "TYPE
"=>"OK
"));
2369 var $items = array();
2372 public function __construct($id=false, $bVisible=true)
2375 $this->bVisible = $bVisible;
2378 public function AddItem($item)
2380 //array("TEXT
"=>"", "LINK
"=>"", "ONCLICK
"=>"", "MENU
"=>array(array("TEXT
"=>"", "LINK
"=>"", "CLASS
"=>""), ...))
2381 $this->items[] = $item;
2384 public function Show()
2386 if(empty($this->items))
2392<div class="adm-navchain
"<?=($this->id ? ' id="'.$this->id.'"':'').(!$this->bVisible? ' style="display:none;
"' : '')?>>
2396 $cnt = count($this->items)-1;
2397 foreach($this->items as $n => $item)
2399 $openerUrl = '/bitrix/admin/get_start_menu.php?skip_recent=Y&lang='.LANGUAGE_ID.(($item['ID'] ?? '') ? '&mode=chain&admin_mnu_menu_id='.urlencode($item['ID']) : '');
2401 $className = !empty($item['CLASS'])?' '.htmlspecialcharsbx($item['CLASS']):'';
2403 $text = htmlspecialcharsbx(htmlspecialcharsback($item["TEXT
"]));
2404 if (!empty($item['LINK']))
2406 $link = htmlspecialcharsbx($item["LINK
"], ENT_COMPAT, false);
2407 echo '<a class="adm-navchain-item
" href="'.$link.'"'.
2408 (!empty($item["ONCLICK
"])? ' onclick="'.htmlspecialcharsbx($item["ONCLICK"]).'"':'').
2409 '><span class="adm-navchain-item-text
'.$className.'">'.$text.'</span></a>';
2411 elseif (!empty($item['ID']))
2413 echo '<a href="javascript:void(0)
" class="adm-navchain-item
" id="bx_admin_chain_item_
'.$item['ID
'].'"><span class="adm-navchain-item-text
'.$className.'">'.$text.'</span></a>';
2415 $chainScripts .= 'new BX.COpener(' . Json::encode(array(
2416 'DIV' => 'bx_admin_chain_item_'.$item['ID'],
2417 'ACTIVE_CLASS' => 'adm-navchain-item-active',
2418 'MENU_URL' => $openerUrl
2424 echo '<span class="adm-navchain-item adm-navchain-item-empty
'.$className.'"><span class="adm-navchain-item-text
">'.$text.'</span></span>';
2429 if(isset($item['ID']) && $item['ID'] || ($n==0 && $this->id == 'main_navchain'))
2431 echo '<span class="adm-navchain-item
" id="bx_admin_chain_delimiter_
'.($item['ID
'] ?? '').'"><span class="adm-navchain-delimiter
"></span></span>';
2433 $chainScripts .= 'new BX.COpener(' . Json::encode(array(
2434 'DIV' => 'bx_admin_chain_delimiter_'.($item['ID'] ?? ''),
2435 'ACTIVE_CLASS' => 'adm-navchain-item-active',
2436 'MENU_URL' => $openerUrl
2441 echo '<span class="adm-navchain-delimiter
"></span>';
2451 if ($chainScripts != '')
2454<script><?=$chainScripts?></script>
2462class CAdminMainChain extends CAdminChain
2466 public function __construct($id=false, $bVisible=true)
2468 parent::__construct($id, $bVisible);
2480 $this->bInit = true;
2482 $adminMenu->Init($adminPage->aModules);
2484 parent::AddItem(array("TEXT
"=> GetMessage("admin_lib_navchain_first
"), "LINK
"=>"/bitrix/admin/index.php?
lang=
".LANGUAGE_ID, "CLASS
" => "adm-navchain-item-desktop
"));
2486 foreach($adminMenu->aActiveSections as $sect)
2488 if($sect["skip_chain
"] !== true)
2489 parent::AddItem(array("TEXT
"=>$sect["text
"], "LINK
"=>$sect["url
"], "ID
" => $sect['items_id'] ?? ''));
2493 public function AddItem($item)
2496 parent::AddItem($item);
2502 public static function GetList()
2508 $dir = $_SERVER["DOCUMENT_ROOT
"].ADMIN_THEMES_PATH;
2509 if(is_dir($dir) && ($dh = opendir($dir)))
2511 while (($file = readdir($dh)) !== false)
2513 if(is_dir($dir."/
".$file) && $file!=".
" && $file!="..
")
2515 $path = ADMIN_THEMES_PATH."/
".$file;
2517 $sLangFile = $_SERVER["DOCUMENT_ROOT
"].$path."/
lang/
".LANGUAGE_ID."/.description.php
";
2518 if(file_exists($sLangFile))
2519 include($sLangFile);
2522 $sLangFile = $_SERVER["DOCUMENT_ROOT
"].$path."/
lang/en/.description.php
";
2523 if(file_exists($sLangFile))
2524 include($sLangFile);
2528 $sDescFile = $_SERVER["DOCUMENT_ROOT
"].$path."/.description.php
";
2529 if(file_exists($sDescFile))
2530 $aTheme = include($sDescFile);
2531 $aTheme["ID
"] = $file;
2532 if($aTheme["NAME
"] == "")
2533 $aTheme["NAME
"] = $file;
2535 $aThemes[] = $aTheme;
2544 return strcasecmp($a["ID
"], $b["ID
"]);
2551 public static function GetCurrentTheme()
2553 $aUserOpt = CUserOptions::GetOption("global
", "settings
");
2554 if (is_array($aUserOpt) && ($aUserOpt["theme_id
"] ?? '') <> '')
2556 $theme = preg_replace("/[^a-z0-9_.-]/i
", "", $aUserOpt["theme_id
"]);
2569 public static function dumpVars($vars, $arExclusions = array())
2572 if (is_array($vars))
2574 foreach ($vars as $varName => $varValue)
2576 if (in_array($varName, $arExclusions))
2579 $result .= self::dumpVar($varName, $varValue);
2586 private static function dumpVar($varName, $varValue, $varStack = array())
2589 if (is_array($varValue))
2591 foreach ($varValue as $key => $value)
2593 $result .= self::dumpVar($key, $value, array_merge($varStack ,array($varName)));
2598 $htmlName = $varName;
2599 if (!empty($varStack))
2601 $htmlName = $varStack[0];
2602 for ($i = 1, $intCount = count($varStack); $i < $intCount; $i++)
2603 $htmlName .= "[
".$varStack[$i]."]
";
2604 $htmlName .= "[
".$varName."]
";
2607 return '<input type="hidden
" name="'.htmlspecialcharsbx($htmlName).'" value="'.htmlspecialcharsbx($varValue).'">';
2614function ShowJSHint($text, $arParams=false)
2623 $id = "h
".mt_rand();
2626 <script>BX.ready(function(){BX.hint_replace(BX("'.$id.'"), "'.CUtil::JSEscape($text).'");})</script>
2627 <span id="'.$id.'"></span>
2630 if (isset($arParams['return']) && $arParams['return'])
change_password_forgot_link login popup forget pas AUTH_GOTO_FORGOT_FORM login btn wrap change_password_button login popup link login popup return auth javascript
sendJsonSuccessResponse()
sendJsonErrorResponse($message)
sendJsonResponse($params=array())
GetModulesCSS($module_id='')
ShowSectionIndex($menu_id, $module_id=false)
reloadPage($redirectUrl, $type)
initPublicPageProcessMode()
editUrlToPublicPage($url)
getPublicPageProcessMode()
sendSuccessResponse($responseType="", $dataToForm=array())
setDefaultQueryParams($url)
setPublicPageProcessMode(bool $mode)
__construct($table_id, $by_initial=false, $order_initial=false, $by_name="by", $ord_name="order")
Show($text, $sort_by, $alt_title=false, $baseCssClass="")
static init($networkNode=null)
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
bx_acc_lim_group_list limitGroupList[] multiple<?=$group[ 'ID']?> ID selected margin top
<? if( $useEditor3):?>< tr class="heading">< td colspan="2"><? echo GetMessage("FILEMAN_OPTION_SPELL_SET");?></td ></tr ><? if(function_exists( 'pspell_config_create')):$use_pspell_checked=(COption::GetOptionString( $module_id, "use_pspell", "Y")=="Y") ? "checked" :"";?>< tr >< td valign="top">< label for="use_pspell"><?echo GetMessage("FILEMAN_OPTION_USE_PSPELL");?></label >< br >< a title="<?echo GetMessage("FILEMAN_OPTION_ADDISH_DICS_TITLE");?> http
global $adminSidePanelHelper
$_SERVER["DOCUMENT_ROOT"]
if(( $ACTION=='EXPORT_EDIT'||$ACTION=='EXPORT_COPY') &&$STEP==1) if($STEP > 1) if(( $ACTION=='EXPORT_EDIT'||$ACTION=='EXPORT_COPY') &&$STEP==2) if($STEP >2) $aMenu
if(file_exists($_SERVER['DOCUMENT_ROOT'] . "/urlrewrite.php")) $uri
ExecuteModuleEventEx($arEvent, $arParams=[])
htmlspecialcharsback($str)
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
GetModuleEvents($MODULE_ID, $MESSAGE_ID, $bReturnArray=false)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
GetMessage($name, $aReplace=null)
getLocalPath($path, $baseFolder="/bitrix")
LocalRedirect($url, $skip_security_check=false, $status="302 Found")
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
<? endif;?> window document title
if(empty($signedUserToken)) $key
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
$GLOBALS['_____370096793']
adm detail iblock types adm detail iblock list tr_SITE_ID display