1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
iblock.php
См. документацию.
1<?php
2namespace Bitrix\Landing\Connector;
3
4use \Bitrix\Landing\Internals\HookDataTable;
5
6class Iblock
7{
14 public static function getElementUrl($siteId, $elementId): string
15 {
16 $url = '';
17
19
20 if (is_string($siteId))
21 {
22 $res = \Bitrix\Landing\Site::getList([
23 'select' => ['ID'],
24 'filter' => ['=TPL_CODE' => $siteId],
25 'order' => ['ID' => 'desc']
26 ]);
27 if ($row = $res->fetch())
28 {
29 $siteId = $row['ID'];
30 }
31 }
32
34 if (isset($syspages['catalog']))
35 {
36 $landing = \Bitrix\Landing\Landing::createInstance(
37 $syspages['catalog']['LANDING_ID'],
38 ['skip_blocks' => true]
39 );
40 if ($landing->exist())
41 {
43 $elementId,
44 'detail'
45 );
46 $url = str_replace(
47 '#system_catalog',
48 $landing->getPublicUrl(),
49 $url
50 );
51 if (mb_substr($url, 0, 1) == '/')
52 {
53 $url = \Bitrix\Landing\Site::getPublicUrl(
54 $landing->getSiteId()
55 ) . $url;
56 }
57 }
58 }
59
61
62 return $url;
63 }
64
70 public static function onAfterIBlockSectionDelete(array $section): void
71 {
72 if ($section['ID'] ?? null)
73 {
74 $res = HookDataTable::getList([
75 'select' => [
76 'ID'
77 ],
78 'filter' => [
79 '=HOOK' => 'SETTINGS',
80 '=CODE' => 'SECTION_ID',
81 '=VALUE' => $section['ID']
82 ]
83 ]);
84 while ($row = $res->fetch())
85 {
86 HookDataTable::delete($row['ID'])->isSuccess();
87 }
88 }
89 }
90}
static getElementUrl($siteId, $elementId)
Определения iblock.php:14
static onAfterIBlockSectionDelete(array $section)
Определения iblock.php:70
static getIblockURL($elementId, $urlType)
Определения utils.php:328
static setGlobalOn()
Определения rights.php:116
static setGlobalOff()
Определения rights.php:107
static get(int $id, bool $active=false, bool $force=false)
Определения syspage.php:100
</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
$siteId
Определения ajax.php:8
$url
Определения iframe.php:7