40 ? Loc::getMessage(
'LANDING_HOOK_COPYRIGHT_SHOW')
41 : Loc::getMessage(
'LANDING_HOOK_COPYRIGHT_SHOW_SMN'),
44 'title' => Loc::getMessage(
'LANDING_HOOK_COPYRIGHT_CODE'),
65 'limit_sites_powered_by'
85 return $this->fields[
'SHOW']->getValue() !==
'N';
128 $this->siteId = $this->siteId ?: $siteId;
137 return $this->siteId ?: 0;
146 return in_array($this->
getLang(), self::REGIONS_RU_LANG,
true);
155 $isTermsFooterShow = Site::isTermsFooterShow();
156 $isHookEnabled = $this->
enabled();
157 if ($isTermsFooterShow || $isHookEnabled)
159 $footer =
'<div class="bitrix-footer">';
160 $footer .=
'<span class="bitrix-footer-text">';
163 $footer .=
'<div class="bitrix-footer-seo">';
169 if ($isTermsFooterShow && !$isHookEnabled)
173 $footer .=
'</span>';
176 Extension::load(
'ui.hint');
177 $footer .=
"<script>BX.ready(function() {BX.UI.Hint.init(BX('.bitrix-footer-terms'))})</script>";
190 $commonText = Loc::getMessage(
'LANDING_HOOK_COPYRIGHT_TEXT_COMMON',
null, $lang);
192 '/bitrix/images/landing/copyright/logo_'
193 . (in_array($lang, [
'ru',
'ua',
'en']) ? $lang :
'en')
196 $logoAlt = Loc::getMessage(
'LANDING_HOOK_COPYRIGHT_LOGO_ALT',
null, $lang);
197 $logo =
'<img src="' . $logoUrl .
'" alt="' . $logoAlt .
'">';
205 '<linklogo>',
'</linklogo>',
206 '<linksite>',
'</linksite>',
207 '<linkcrm>',
'</linkcrm>',
210 $logo,
'',
'',
'',
'',
'',
'',
217 $component = $this->getPublicComponent();
220 $advCode = $component->getAdvCode();
223 Loc::getMessage(
'LANDING_HOOK_COPYRIGHT_TEXT_SMN_1')
224 .
'<a href="https://www.1c-bitrix.ru/?' . $advCode .
'" target="_blank" class="bitrix-footer-link">'
225 . Loc::getMessage(
'LANDING_HOOK_COPYRIGHT_TEXT_SMN_2')
231 $linkSite = $component->getRefLink(
'websites',
true,
true);
234 return Loc::getMessage(
235 'LANDING_HOOK_COPYRIGHT_TEXT_COMMON_EN',
238 '<linksite>' =>
'<a class="bitrix-footer-link" target="_blank" href="' . $linkSite .
'">',
239 '</linksite>' =>
'</a>',
249 '<linklogo>',
'</linklogo>',
250 '<linksite>',
'</linksite>',
251 '<linkcrm>',
'</linkcrm>',
254 $logo,
'',
'',
'',
'',
'',
'',
271 $type = strtoupper(Landing::getSiteType());
272 $phrases = $this->getRandomPhraseCollection(
$type);
273 $code = (int)$this->fields[
'CODE']->getValue() ?: 1;
279 $component = $this->getPublicComponent();
281 $link = $component->getRefLink(
'websites',
true,
true);
282 if (
$type === self::PAGE_TYPE_STORE)
284 $link = str_replace(
'features/sites.php',
'features/shop.php', $link);
287 return '. <a href="' . $link .
'" class="bitrix-footer-link">' .
$text .
'</a>';
290 protected function getPublicComponent(): \LandingPubComponent
295 static $component =
null;
299 $componentClass = \CBitrixComponent::includeComponentClass(
'bitrix:landing.pub');
300 $component =
new $componentClass;
301 $component->setZone($this->
getLang());
309 $reportUrl = $this->getReportUrl();
311 '<a class="bitrix-footer-link" target="_blank" rel="nofollow" href="'
312 . $reportUrl->getUri()
315 $reportText = Loc::getMessage(
'LANDING_HOOK_COPYRIGHT_TEXT_CONTENT_LINK_REPORT_2', [
316 '#a1#' => $reportLinkOpen,
320 $hintText = Loc::getMessage(
'LANDING_HOOK_COPYRIGHT_TEXT_CONTENT_LINK_REPORT_HINT');
323 <div
class=
"bitrix-footer-terms">
324 <span
class=
"bitrix-footer-link bitrix-footer-link-report">$reportText</span>
325 <span
class=
"bitrix-footer-hint" data-hint=
"$hintText"></span>
330 private function getReportUrl():
Uri
334 'report' =>
'https://www.bitrix24.com/abuse/',
337 'report' =>
'https://www.bitrix24.ru/abuse/',
340 'report' =>
'https://www.bitrix24.com.br/abuse/',
343 'report' =>
'https://www.bitrix24.de/abuse/',
346 'report' =>
'https://www.bitrix24.es/abuse/',
349 'report' =>
'https://www.bitrix24.ua/abuse/',
352 'report' =>
'https://www.bitrix24.kz/abuse/',
355 'report' =>
'https://www.bitrix24.by/abuse/',
358 'report' =>
'https://www.bitrix24.uz/abuse/',
363 $reportUrl =
new Uri($links[
$lang][
'report'] ?? $links[
'com'][
'report']);
367 $portalName = \COption::getOptionString(
'main',
'server_name',
'');
368 $senderPage = strtoupper(Landing::getSiteType());
370 $reportUrl->addParams([
371 'sender_page' => urlencode($senderPage),
372 'hostname' => urlencode($portalName),
373 'siteId' => urlencode($this->
getSiteId()),
374 'from_url' => urlencode($fromUrl),
384 protected function getRandomPhraseCollection(
string $type):
array
390 Loc::loadMessages(
Manager::getDocRoot() .
'/bitrix/modules/landing/lib/hook/page/copyright_notranslate.php');
391 if (
$type === self::PAGE_TYPE_STORE)
393 for (
$i = 1;
$i <= self::RANDOM_PHRASE_COUNT;
$i++)
395 $phrases[
$i] = Loc::getMessage(
'LANDING_HOOK_COPYRIGHT_TEXT_STORE_' .
$i,
null,
'ru');
401 for (
$i = 1;
$i <= self::RANDOM_PHRASE_COUNT;
$i++)
403 $phrases[
$i] = Loc::getMessage(
'LANDING_HOOK_COPYRIGHT_TEXT_PAGE_' .
$i,
null,
'ru');
415 public static function getRandomPhraseId(): int
417 return rand(1, self::RANDOM_PHRASE_COUNT);
432 if (
$type !== Hook::ENTITY_TYPE_SITE)
440 if (!isset($newData[
'SHOW']))
442 $newData[
'SHOW'] =
'Y';
445 !isset($newData[
'CODE'])
449 $newData[
'CODE'] = self::getRandomPhraseId();
459 'HOOK' =>
'COPYRIGHT',
461 'ENTITY_TYPE' =>
$type,
464 $existing = HookDataTable::getList([
465 'select' => [
'ID',
'CODE'],
468 while ($row = $existing->fetch())
470 $res = HookDataTable::update($row[
'ID'], [
471 'VALUE' => $newData[$row[
'CODE']],
473 if (
$res->isSuccess())
475 unset($newData[$row[
'CODE']]);
479 if (!empty($newData))
481 foreach($newData as
$code => $value)
484 $fieldsAdd[
'CODE'] =
$code;
485 $fieldsAdd[
'VALUE'] =
$value;
486 HookDataTable::add($fieldsAdd);
const RANDOM_PHRASE_COUNT
if(!defined('SITE_ID')) $lang