1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
sitespeed.php
См. документацию.
1
<?php
2
namespace
Bitrix\Main\Analytics;
3
4
use Bitrix\Main\Application;
5
use Bitrix\Main\IO\Directory;
6
use Bitrix\Main\Localization\Loc;
7
use Bitrix\Main\Config\Configuration;
8
use Bitrix\Main\Config\Option;
9
10
Loc::loadMessages(__FILE__);
11
12
class
SiteSpeed
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 = [];
77
$siteList
=
\Bitrix\Main\SiteTable::getList
([
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
}
Bitrix\Main\Analytics\SiteSpeed
Определения
sitespeed.php:13
Bitrix\Main\Analytics\SiteSpeed\isIntranetSite
static isIntranetSite($siteId)
Определения
sitespeed.php:69
Bitrix\Main\Analytics\SiteSpeed\isOn
static isOn()
Определения
sitespeed.php:115
Bitrix\Main\Analytics\SiteSpeed\canGatherStat
static canGatherStat()
Определения
sitespeed.php:101
Bitrix\Main\Analytics\SiteSpeed\onBuildGlobalMenu
static onBuildGlobalMenu(&$arGlobalMenu, &$arModuleMenu)
Определения
sitespeed.php:14
Bitrix\Main\Application\getInstance
static getInstance()
Определения
application.php:98
Bitrix\Main\ORM\Data\DataManager\getList
static getList(array $parameters=array())
Определения
datamanager.php:431
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$siteId
$siteId
Определения
ajax.php:8
$settings
$settings
Определения
product_settings.php:43
ADMIN_SECTION
const ADMIN_SECTION
Определения
rss.php:2
$siteList
$siteList
Определения
options.php:47
$site
$site
Определения
yandex_run.php:614
bitrix
modules
main
lib
analytics
sitespeed.php
Создано системой
1.14.0