2namespace Bitrix\Landing\PublicAction;
4use \Bitrix\Landing\Manager;
5use \Bitrix\Landing\File;
6use \Bitrix\Landing\Rights;
7use \Bitrix\Landing\Landing;
8use \Bitrix\Landing\Site as SiteCore;
9use \Bitrix\Landing\PublicActionResult;
10use \Bitrix\Main\Localization\Loc;
12Loc::loadMessages(__FILE__);
23 $disallow = [
'ACTIVE',
'SPECIAL',
'TPL_CODE'];
29 if (in_array(
$k, $disallow))
49 if ((
$fields = SiteCore::getAdditionalFields($id)))
74 static $mixedParams = [
'id'];
77 $result->setResult(SiteCore::getPublicUrl($id));
89 $result->setResult(SiteCore::getPreview($id));
103 $getPublicUrl =
false;
104 $getPreviewPicture =
false;
106 $mobileHit = $initiator ===
'mobile';
131 isset(
$params[
'filter'][
'=TYPE']) &&
132 $params[
'filter'][
'=TYPE'] ==
'STORE'
141 isset(
$params[
'filter'][
'TYPE']) &&
142 $params[
'filter'][
'TYPE'] ==
'STORE'
151 if (isset(
$params[
'filter'][
'CHECK_PERMISSIONS']))
153 unset(
$params[
'filter'][
'CHECK_PERMISSIONS']);
157 if (is_array(
$params[
'select']))
159 if (in_array(
'DOMAIN_NAME',
$params[
'select']))
161 $params[
'select'][
'DOMAIN_NAME'] =
'DOMAIN.DOMAIN';
163 if (in_array(
'PUBLIC_URL',
$params[
'select']))
165 $getPublicUrl =
true;
167 if (in_array(
'PREVIEW_PICTURE',
$params[
'select']))
169 $getPreviewPicture =
true;
171 if (in_array(
'PHONE',
$params[
'select']))
177 $deleted = [
'DOMAIN_NAME',
'PUBLIC_URL',
'PREVIEW_PICTURE',
'PHONE'];
180 if (in_array(
$code, $deleted))
189 $getPreviewPicture &&
190 !in_array(
'LANDING_ID_INDEX',
$params[
'select'])
193 $params[
'select'][] =
'LANDING_ID_INDEX';
195 if (!in_array(
'ID',
$params[
'select']))
199 if (!in_array(
'TYPE',
$params[
'select']))
206 $landingIndexes = [];
208 while ($row =
$res->fetch())
210 if (isset($row[
'DATE_CREATE']))
212 $row[
'DATE_CREATE'] = (string) $row[
'DATE_CREATE'];
214 if (isset($row[
'DATE_MODIFY']))
216 $row[
'DATE_MODIFY'] = (string) $row[
'DATE_MODIFY'];
218 if ($row[
'LANDING_ID_INDEX'] && $getPreviewPicture)
220 $landingIndexes[$row[
'ID']] = $row[
'LANDING_ID_INDEX'];
224 $row[
'PUBLIC_URL'] =
'';
226 if ($getPreviewPicture)
228 $row[
'PREVIEW_PICTURE'] =
'';
236 $data[$row[
'ID']] = $row;
240 if ($getPublicUrl || $getPreviewPicture)
242 $urls = SiteCore::getPublicUrl(array_keys(
$data),
true, !$mobileHit);
252 $landing = Landing::createInstance(0);
253 foreach ($landingIndexes as
$siteId => $landingId)
255 $data[
$siteId][
'PREVIEW_PICTURE'] = $landing->getPreview(
279 $error = new \Bitrix\Landing\Error;
286 if (
$res->isSuccess())
308 $error = new \Bitrix\Landing\Error;
314 if (
$res->isSuccess())
332 public static function delete($id)
335 $error = new \Bitrix\Landing\Error;
337 $res = SiteCore::delete($id);
339 if (
$res->isSuccess())
361 $error = new \Bitrix\Landing\Error;
366 $res = SiteCore::markDelete($id);
370 $res = SiteCore::markUnDelete($id);
372 if (
$res->isSuccess())
392 return self::markDelete($id,
false);
404 $error = new \Bitrix\Landing\Error;
405 if (!(
$fields[
'PARENT_ID'] ??
null))
411 if ($addResult->isSuccess())
413 $result->setResult($addResult->getId());
417 $error->addFromResult($addResult);
434 $error = new \Bitrix\Landing\Error;
436 if (!(
$fields[
'PARENT_ID'] ??
null))
442 if ($addResult->isSuccess())
448 $error->addFromResult($addResult);
465 $error = new \Bitrix\Landing\Error;
466 $moveResult = SiteCore::moveFolder($folderId, $toFolderId ?:
null, $toSiteId ?:
null);
468 if ($moveResult->isSuccess())
470 $result->setResult($moveResult->getId());
474 $error->addFromResult($moveResult);
490 $error = new \Bitrix\Landing\Error;
492 $publicationResult = SiteCore::publicationFolder($folderId, $mark);
494 if ($publicationResult->isSuccess())
496 $result->setResult($publicationResult->isSuccess());
500 $error->addFromResult($publicationResult);
514 return self::publicationFolder($folderId,
false);
526 if (array_key_exists(
'PARENT_ID',
$filter) && !(
$filter[
'PARENT_ID'] ??
null))
532 foreach (
$rows as &$row)
534 if (isset($row[
'DATE_CREATE']))
536 $row[
'DATE_CREATE'] = (string) $row[
'DATE_CREATE'];
538 if (isset($row[
'DATE_MODIFY']))
540 $row[
'DATE_MODIFY'] = (string) $row[
'DATE_MODIFY'];
559 $error = new \Bitrix\Landing\Error;
563 $res = SiteCore::markFolderDelete($id);
567 $res = SiteCore::markFolderUnDelete($id);
569 if (
$res->isSuccess())
589 return self::markFolderDelete($id,
false);
601 $error = new \Bitrix\Landing\Error;
605 $res = SiteCore::publication($id);
609 $res = SiteCore::unpublic($id);
612 if (
$res->isSuccess())
632 return self::publication($id,
false);
646 SiteCore::fullExport($id,
$params)
660 static $mixedParams = [
'rights'];
663 $error = new \Bitrix\Landing\Error;
677 Loc::getMessage(
'LANDING_IS_NOT_ADMIN_ERROR')
686 'limit_sites_access_permissions'
713 $error = new \Bitrix\Landing\Error;
723 'limit_sites_access_permissions'
752 static $internal =
true;
753 static $mixedParams = [
'picture'];
757 $error = new \Bitrix\Landing\Error;
774 'src' => $file[
'SRC']
781 Loc::getMessage(
'LANDING_FILE_ERROR')
818 $result->setResult($binding->bindSite($id));
822 $result->setResult($binding->unbindSite($id));
842 $binding = new \Bitrix\Landing\Binding\Menu($menuCode);
843 return self::binding($id, $binding,
true);
855 $binding = new \Bitrix\Landing\Binding\Menu($menuCode);
856 return self::binding($id, $binding,
false);
874 $binding = new \Bitrix\Landing\Binding\Group($groupId);
875 $result = self::binding($id, $binding,
true);
879 \Bitrix\Landing\Site::update($id, [
904 $binding = new \Bitrix\Landing\Binding\Group($groupId);
905 $result = self::binding($id, $binding,
false);
909 \Bitrix\Landing\Site::update($id, [
910 'TYPE' =>
'KNOWLEDGE'
930 foreach ($bindings as
$i => $binding)
932 if (!$binding[
'PUBLIC_URL'])
934 unset($bindings[
$i]);
938 return array_values($bindings);
950 $bindings = \Bitrix\Landing\Binding\Menu::getList($menuCode);
951 $result->setResult(self::removeEmptyBindings($bindings));
964 $bindings = \Bitrix\Landing\Binding\Group::getList($groupId);
965 $result->setResult(self::removeEmptyBindings($bindings));
static getContacts(int $siteId)
static addToSite(int $id, int $fileId, bool $temp=false)
const FEATURE_PERMISSIONS_AVAILABLE
static savePicture($file, $ext=false, $params=array())
static checkFeature(string $feature, array $params=array())
static getGroupBindings(?int $groupId=null)
static unPublicFolder(int $folderId)
static addFolder(int $siteId, array $fields)
static binding(int $id, \Bitrix\Landing\Binding\Entity $binding, bool $bind)
static fullExport($id, array $params=array())
static getFolders(int $siteId, array $filter=[])
static updateFolder(int $siteId, int $folderId, array $fields)
static getMenuBindings(?string $menuCode=null)
static setRights($id, $rights=[])
static getAdditionalFields($id)
static getPreview(int $id)
static bindingToMenu(int $id, string $menuCode)
static moveFolder(int $folderId, ?int $toFolderId, ?int $toSiteId=null)
static removeEmptyBindings(array $bindings)
static unbindingFromMenu(int $id, string $menuCode)
static markFolderDelete(int $id, bool $mark=true)
static getList(array $params=[], $initiator=null)
static clearDisallowFields(array $fields)
static publication(int $id, bool $mark=true)
static bindingToGroup(int $id, int $groupId)
static unbindingFromGroup(int $id, int $groupId)
static markDelete($id, $mark=true)
static add(array $fields)
static uploadFile($id, $picture, $ext=false, array $params=[], $temp=false)
static update($id, array $fields)
static markFolderUnDelete(int $id)
static publicationFolder(int $folderId, bool $mark=true)
static setOperationsForSite($siteId, array $rights=[])
static getOperationsForSite($siteId)
static hasAccessForSite($siteId, $accessType, $deleted=false)
static setScope($scope, array $params=[])
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
if(empty($signedUserToken)) $key
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']