27 $lastId = Option::get(
'landing',
'update_landing_app', 0);
29 \Bitrix\Landing\Rights::setGlobalOff();
32 if (!isset($result[
'steps']))
39 $res = Demos::getList([
44 while ($row = $res->fetch())
46 $demos[$row[
'APP_CODE'] .
'.' . $row[
'XML_ID']] = $row;
59 if ($row = $res->fetch())
61 $result[
'count'] = $row[
'CNT'];
79 while ($row = $res->fetch())
83 $appCode = isset($demos[$row[
'TPL_CODE']][
'APP_CODE'])
84 ? $demos[$row[
'TPL_CODE']][
'APP_CODE']
88 $resBlock = BlockTable::getList([
97 while ($rowBlock = $resBlock->fetch())
99 $appCodeBlock = isset($blocksRepo[$rowBlock[
'CODE']])
100 ? $blocksRepo[$rowBlock[
'CODE']][
'app_code']
102 if ($appCodeBlock != $appCode)
104 $appCodeBlock =
null;
106 $resTmp = BlockTable::update($rowBlock[
'ID'], [
107 'INITIATOR_APP_CODE' => $appCodeBlock
109 $resTmp->isSuccess();
111 unset($resBlock, $rowBlock);
114 $resTmp = LandingTable::update($row[
'ID'], [
115 'INITIATOR_APP_CODE' => $appCode
117 $resTmp->isSuccess();
123 \Bitrix\Landing\Rights::setGlobalOn();
128 Option::set(
'landing',
'update_landing_app', $lastId);
133 Option::delete(
'landing', array(
'name' =>
'update_landing_app'));