1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
target.php
См. документацию.
1
<?php
2
namespace
Bitrix\Landing\Note;
3
4
use \Bitrix\Landing\Rights;
5
use \Bitrix\Landing\Landing;
6
use \Bitrix\Landing\Site;
7
use \Bitrix\Landing\Site\Type;
8
9
class
Target
10
{
14
const
UO_CODE_NOTES_LAST
=
'notes_last'
;
15
21
public
static
function
rememberLastSite
(
int
$landingId): void
22
{
23
$res
=
Landing::getList
([
24
'select'
=> [
25
'SITE_ID'
,
26
'SITE_TITLE'
=>
'SITE.TITLE'
,
27
'SITE_TYPE'
=>
'SITE.TYPE'
28
],
29
'filter'
=> [
30
'ID'
=> $landingId
31
],
32
'limit'
=> 1
33
]);
34
if
($row =
$res
->fetch())
35
{
36
$option
= \CUserOptions::getOption(
'landing'
, self::UO_CODE_NOTES_LAST, []);
37
foreach
(
$option
as $item)
38
{
39
if
($item[
'SITE_ID'
] == $row[
'SITE_ID'
])
40
{
41
return
;
42
}
43
}
44
$option
[] = $row;
45
if
(
count
(
$option
) > 5)
46
{
47
unset(
$option
[0]);
48
}
49
\CUserOptions::setOption(
'landing'
, self::UO_CODE_NOTES_LAST, array_values(
$option
));
50
}
51
}
52
57
public
static
function
getShortList
():
array
58
{
59
$data
= [];
60
$option
= \CUserOptions::getOption(
'landing'
, self::UO_CODE_NOTES_LAST, []);
61
$option
= array_reverse(
$option
);
62
63
// check every item in short list on accessibility
64
foreach
(
$option
as $item)
65
{
66
Type::setScope
($item[
'SITE_TYPE'
]);
67
// because every item may by in different scopes
68
$check =
Rights::hasAccessForSite
(
69
$item[
'SITE_ID'
],
70
Rights::ACCESS_TYPES
[
'edit'
]
71
);
72
if
($check)
73
{
74
$res
= Site::getList([
75
'select'
=> [
76
'ID'
,
'TITLE'
,
'TYPE'
77
],
78
'filter'
=> [
79
'ID'
=> $item[
'SITE_ID'
]
80
]
81
]);
82
if
($row =
$res
->fetch())
83
{
84
$data
[] = $row;
85
}
86
}
87
}
88
89
$data
=
\Bitrix\Landing\Binding\Group::recognizeSiteTitle
(
90
$data
91
);
92
93
return
$data
;
94
}
95
}
Bitrix\Landing\Binding\Group\recognizeSiteTitle
static recognizeSiteTitle(array $input)
Определения
group.php:50
Bitrix\Landing\Note\Target
Определения
target.php:10
Bitrix\Landing\Note\Target\rememberLastSite
static rememberLastSite(int $landingId)
Определения
target.php:21
Bitrix\Landing\Note\Target\UO_CODE_NOTES_LAST
const UO_CODE_NOTES_LAST
Определения
target.php:14
Bitrix\Landing\Note\Target\getShortList
static getShortList()
Определения
target.php:57
Bitrix\Landing\Rights\ACCESS_TYPES
const ACCESS_TYPES
Определения
rights.php:21
Bitrix\Landing\Rights\hasAccessForSite
static hasAccessForSite($siteId, $accessType, $deleted=false)
Определения
rights.php:546
Bitrix\Main\Engine\Controller\setScope
setScope($scope)
Определения
controller.php:373
Bitrix\Main\ORM\Data\DataManager\getList
static getList(array $parameters=array())
Определения
datamanager.php:431
$data
$data['IS_AVAILABLE']
Определения
.description.php:13
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$res
$res
Определения
filter_act.php:7
count
</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."%"
Определения
waybill.php:936
$option
$option
Определения
options.php:1711
bitrix
modules
landing
lib
note
target.php
Создано системой
1.14.0