1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
target.php
См. документацию.
1<?php
2namespace Bitrix\Landing\Note;
3
4use \Bitrix\Landing\Rights;
5use \Bitrix\Landing\Landing;
6use \Bitrix\Landing\Site;
7use \Bitrix\Landing\Site\Type;
8
9class Target
10{
14 const UO_CODE_NOTES_LAST = 'notes_last';
15
21 public static function rememberLastSite(int $landingId): void
22 {
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
69 $item['SITE_ID'],
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
90 $data
91 );
92
93 return $data;
94 }
95}
static recognizeSiteTitle(array $input)
Определения group.php:50
static rememberLastSite(int $landingId)
Определения target.php:21
const UO_CODE_NOTES_LAST
Определения target.php:14
static getShortList()
Определения target.php:57
const ACCESS_TYPES
Определения rights.php:21
static hasAccessForSite($siteId, $accessType, $deleted=false)
Определения rights.php:546
setScope($scope)
Определения controller.php:373
static getList(array $parameters=array())
Определения datamanager.php:431
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$res
Определения filter_act.php:7
</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
Определения options.php:1711