1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
cloud.php
См. документацию.
1<?php
2namespace Bitrix\Landing\PublicAction;
3
4use \Bitrix\Landing\Site;
5use \Bitrix\Landing\Demos as DemoCore;
6use \Bitrix\Landing\PublicActionResult;
7
8class Cloud
9{
14 public static function getRepository()
15 {
16 return Block::getRepository(null, true);
17 }
18
26 protected static function getDemoItemList(string $type, bool $isPage, array $filter = []): PublicActionResult
27 {
28 if ($isPage)
29 {
30 $result = Demos::getPageList($type)->getResult();
31 }
32 else
33 {
34 $result = Demos::getSiteList($type)->getResult();
35 }
36
37 // we need only used in public templates
38 if (
39 $result &&
40 isset($filter['used_in_public']) &&
41 $filter['used_in_public'] == 'Y'
42 )
43 {
44 $resultNotPublic = $result;
46 'select' => [
47 'ID', 'TITLE', 'TPL_CODE'
48 ],
49 'filter' => [
50 '=ACTIVE' => 'Y',
51 '=TPL_CODE' => array_keys($resultNotPublic)
52 ]
53 ]);
54 while ($row = $res->fetch())
55 {
56 unset($resultNotPublic[$row['TPL_CODE']]);
57 }
58 foreach ($resultNotPublic as $key => $foo)
59 {
60 unset($result[$key]);
61 }
62 }
63
64 // we need't local templates, only from rest
65 if (
66 $result &&
67 isset($filter['only_rest']) &&
68 $filter['only_rest'] == 'Y'
69 )
70 {
71 foreach ($result as $key => $item)
72 {
73 if (!$item['REST'])
74 {
75 unset($result[$key]);
76 }
77 }
78 }
79
80 $actionResult = new PublicActionResult;
81 $actionResult->setResult($result);
82
83 return $actionResult;
84 }
85
92 public static function getDemoSiteList(string $type, array $filter = []): PublicActionResult
93 {
94 return self::getDemoItemList($type, false, $filter);
95 }
96
103 public static function getDemoPageList(string $type, array $filter = []): PublicActionResult
104 {
105 return self::getDemoItemList($type, true, $filter);
106 }
107
114 public static function getUrlPreview($code, $type)
115 {
117 }
118
124 public static function getAppItems(string $appCode): PublicActionResult
125 {
126 return Demos::getList([
127 'filter' => [
128 '=APP_CODE' => $appCode
129 ]
130 ]);
131 }
132
138 public static function getAppItemManifest(int $id): PublicActionResult
139 {
141
143 'filter' => ['ID' => $id]
144 ])->fetch();
145
146 if ($template)
147 {
148 $template['MANIFEST'] = unserialize($template['MANIFEST'], ['allowed_classes' => false]);
149 $result->setResult($template);
150 }
151
152 return $result;
153 }
154}
$type
Определения options.php:106
static getAppItems(string $appCode)
Определения cloud.php:124
static getUrlPreview($code, $type)
Определения cloud.php:114
static getRepository()
Определения cloud.php:14
static getAppItemManifest(int $id)
Определения cloud.php:138
static getDemoItemList(string $type, bool $isPage, array $filter=[])
Определения cloud.php:26
static getDemoPageList(string $type, array $filter=[])
Определения cloud.php:103
static getDemoSiteList(string $type, array $filter=[])
Определения cloud.php:92
static getList(array $params=array())
Определения demos.php:447
static getUrlPreview($code, $type)
Определения demos.php:131
static getSiteList($type, array $filter=[])
Определения demos.php:107
static getPageList($type, array $filter=[])
Определения demos.php:119
static getList(array $params=[], $initiator=null)
Определения site.php:99
$template
Определения file_edit.php:49
</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
$result
Определения get_property_values.php:14
$filter
Определения iblock_catalog_list.php:54
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
if(empty($signedUserToken)) $key
Определения quickway.php:257