1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
publish.php
См. документацию.
1
<?php
2
namespace
Bitrix\Landing\Update\Site
;
3
4
use
Bitrix\Landing\Rights
;
5
use
Bitrix\Landing\Site
;
6
use
Bitrix\Main\Config\Option
;
7
use
Bitrix\Main\Update\Stepper
;
8
9
class
Publish
extends
Stepper
10
{
11
public
const
SITE_LIMIT
= 5;
12
13
protected
static
$moduleId
=
'landing'
;
14
19
public
function
execute
(
array
&
$result
): bool
20
{
21
Rights::setGlobalOff
();
22
if
(!isset(
$result
[
'steps'
]))
23
{
24
$result
[
'steps'
] = 0;
25
}
26
$result
[
'steps'
]++;
27
28
$publishedIds = [];
29
$ids = [];
30
$stringIds = Option::get(
'landing'
,
'unpublished_ids'
,
''
);
31
if
($stringIds !==
''
)
32
{
33
$ids = explode(
','
, $stringIds);
34
$neededIds = array_slice($ids, 0, self::SITE_LIMIT);
35
foreach
($neededIds as $id)
36
{
37
Site::publication($id);
38
$publishedIds[] = $id;
39
}
40
}
41
Rights::setGlobalOn
();
42
if
($publishedIds === $ids)
43
{
44
Option::delete(
'landing'
,
array
(
'name'
=>
'unpublished_ids'
));
45
return
false
;
46
}
47
$ids = array_diff($ids, $publishedIds);
48
$stringIds = implode(
','
, $ids);
49
50
Option::set(
'landing'
,
'unpublished_ids'
, $stringIds);
51
return
true
;
52
}
53
}
Bitrix\Landing\Restriction\Rights
Определения
rights.php:8
Bitrix\Landing\Rights\setGlobalOn
static setGlobalOn()
Определения
rights.php:116
Bitrix\Landing\Rights\setGlobalOff
static setGlobalOff()
Определения
rights.php:107
Bitrix\Landing\Update\Site\Publish
Определения
publish.php:10
Bitrix\Landing\Update\Site\Publish\execute
execute(array &$result)
Определения
publish.php:19
Bitrix\Landing\Update\Site\Publish\$moduleId
static $moduleId
Определения
publish.php:13
Bitrix\Landing\Update\Site\Publish\SITE_LIMIT
const SITE_LIMIT
Определения
publish.php:11
Bitrix\Main\Config\Option
Определения
option.php:15
Bitrix\Main\Update\Stepper
Определения
stepper.php:29
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
Bitrix\Landing\Site
Определения
cookies.php:2
Bitrix\Landing\Update\Site
Определения
publish.php:2
bitrix
modules
landing
lib
update
site
publish.php
Создано системой
1.14.0