1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
instagramcta.php
См. документацию.
1<?php
2
3namespace Bitrix\Seo\BusinessSuite\Configuration\Facebook\Fields\Config;
4
6{
7
8 const BUTTON_TEXT_RESERVE = 'Reserve';
9 const BUTTON_TEXT_BOOK = 'Book Now';
10 const BUTTON_TEXT_BUY = 'Buy Now';
11
12 private static function checkButtonText($value) : bool
13 {
14 return array_key_exists('cta_button_text',$value) && in_array($value['cta_button_text'],[
15 static::BUTTON_TEXT_BOOK,
16 static::BUTTON_TEXT_RESERVE,
17 static::BUTTON_TEXT_BUY
18 ]);
19
20 }
21 private static function checkUrl($value) : bool
22 {
23 return array_key_exists('cta_button_url',$value) &&
24 is_string($value['cta_button_url']) &&
25 preg_match('%^((https://)|(www\.)|(http://))([a-z0-9-].?)+(:[0-9]+)?(/.*)?$%i',$value['cta_button_url']);
26 }
27
28 protected static function checkValueFields($value) : bool
29 {
30 return static::checkButtonText($value) && static::checkUrl($value);
31 }
32
36 static function available(): bool
37 {
38 return true;
39 }
40
44 static function required(): bool
45 {
46 return false;
47 }
48
49 protected static function getFields() : array
50 {
51 return array_merge(parent::getFields(),['cta_button_url','cta_button_text']);
52 }
53
54}
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804