1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
sitespeed.php
См. документацию.
1<?php
2namespace Bitrix\Main\Analytics;
3
4use Bitrix\Main\Application;
5use Bitrix\Main\IO\Directory;
6use Bitrix\Main\Localization\Loc;
7use Bitrix\Main\Config\Configuration;
8use Bitrix\Main\Config\Option;
9
10Loc::loadMessages(__FILE__);
11
13{
14 public static function onBuildGlobalMenu(&$arGlobalMenu, &$arModuleMenu)
15 {
16 $siteSpeedItem = array(
17 "text" => Loc::getMessage("MAIN_ANALYTICS_MENU_SITE_SPEED"),
18 "url" => "site_speed.php?lang=".LANGUAGE_ID,
19 "more_url" => array("site_speed.php"),
20 "title" => Loc::getMessage("MAIN_ANALYTICS_MENU_SITE_SPEED_ALT"),
21 );
22
23 $found = false;
24 foreach ($arModuleMenu as &$arMenuItem)
25 {
26 if (!isset($arMenuItem["items_id"]) || $arMenuItem["items_id"] !== "menu_perfmon")
27 {
28 continue;
29 }
30
31 if (isset($arMenuItem["items"]) && is_array($arMenuItem["items"]))
32 {
33 array_unshift($arMenuItem["items"], $siteSpeedItem);
34 }
35 else
36 {
37 $arMenuItem["items"] = array($siteSpeedItem);
38 }
39
40 $found = true;
41 break;
42 }
43
44 if (!$found)
45 {
46 $arModuleMenu[] = array(
47 "parent_menu" => "global_menu_settings",
48 "section" => "perfmon",
49 "sort" => 1850,
50 "text" => Loc::getMessage("MAIN_ANALYTICS_MENU_PERFORMANCE"),
51 "title" => Loc::getMessage("MAIN_ANALYTICS_MENU_PERFORMANCE"),
52 "icon" => "perfmon_menu_icon",
53 "page_icon" => "perfmon_page_icon",
54 "items_id" => "menu_perfmon",
55 "items" => array($siteSpeedItem),
56 );
57 }
58 }
59
69 public static function isIntranetSite($siteId)
70 {
71 if (defined("ADMIN_SECTION") && ADMIN_SECTION === true)
72 {
73 return false;
74 }
75
76 $portalSiteList = [];
78 "select" => ["LID"],
79 "cache" => ["ttl" => 86400],
80 ])->fetchAll();
81 foreach ($siteList as $site)
82 {
83 if (Option::get("main", "wizard_firstportal_".$site["LID"], false, $site["LID"]) !== false)
84 {
85 $portalSiteList[] = $site["LID"];
86 }
87 else if (Option::get("main", "wizard_firstbitrix24_".$site["LID"], false, $site["LID"]) !== false)
88 {
89 $portalSiteList[] = $site["LID"];
90 }
91 }
92
93 if ($extranetSiteId = Option::get("extranet", "extranet_site", false))
94 {
95 $portalSiteList[] = $extranetSiteId;
96 }
97
98 return in_array($siteId, $portalSiteList);
99 }
100
101 public static function canGatherStat()
102 {
103 $enabled = !Application::getInstance()->getLicense()->isDemoKey();
104 if($enabled)
105 {
106 $settings = Configuration::getValue("analytics_counter");
107 if(isset($settings["enabled"]) && $settings["enabled"] === false)
108 {
109 $enabled = false;
110 }
111 }
112 return $enabled;
113 }
114
115 public static function isOn()
116 {
117 return false;
118 }
119}
static isIntranetSite($siteId)
Определения sitespeed.php:69
static isOn()
Определения sitespeed.php:115
static canGatherStat()
Определения sitespeed.php:101
static onBuildGlobalMenu(&$arGlobalMenu, &$arModuleMenu)
Определения sitespeed.php:14
static getInstance()
Определения application.php:98
static getList(array $parameters=array())
Определения datamanager.php:431
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$siteId
Определения ajax.php:8
$settings
Определения product_settings.php:43
const ADMIN_SECTION
Определения rss.php:2
$siteList
Определения options.php:47
$site
Определения yandex_run.php:614