1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
text.php
См. документацию.
1<?php
2namespace Bitrix\Landing\Field;
3
5{
10 protected $maxlength;
11
16 protected $placeholder;
17
23 public function __construct($code, array $params = array())
24 {
25 $this->code = mb_strtoupper($code);
26 $this->value = null;
27 $this->id = isset($params['id']) ? $params['id'] : '';
28 $this->title = isset($params['title']) ? $params['title'] : '';
29 $this->default = isset($params['default']) ? $params['default'] : null;
30 $this->help = isset($params['help']) ? $params['help'] : '';
31 $this->searchable = isset($params['searchable']) && $params['searchable'] === true;
32 $this->placeholder = isset($params['placeholder']) ? $params['placeholder'] : '';
33 $this->maxlength = isset($params['maxlength']) ? (int)$params['maxlength'] : 0;
34 }
35
40 public function isEmptyValue()
41 {
42 return $this->value === '';
43 }
44
53 public function viewForm(array $params = array())
54 {
55 ?>
56 <input type="text" <?
57 ?><?= isset($params['autocomplete']) ? 'autocomplete="'. $params['autocomplete'] . '" ' : ''?><?
58 ?><?= isset($params['additional']) ? $params['additional'] . ' ' : ''?><?
59 ?><?= isset($params['id']) ? 'id="' . \htmlspecialcharsbx($params['id']) . '" ' : ''?><?
60 ?><?= $this->maxlength > 0 ? 'maxlength="'. $this->maxlength . '" ' : ''?><?
61 ?><?= $this->placeholder != '' ? 'placeholder="'. \htmlspecialcharsbx($this->placeholder) . '" ' : ''?><?
62 ?>class="<?= isset($params['class']) ? \htmlspecialcharsbx($params['class']) : ''?>" <?
63 ?>data-code="<?= \htmlspecialcharsbx($this->code)?>" <?
64 ?>name="<?= \htmlspecialcharsbx(isset($params['name_format'])
65 ? str_replace('#field_code#', $this->code, $params['name_format'])
66 : $this->code)?>" <?
67 ?><?= (isset($params['disabled']) && $params['disabled']) ? ' disabled ' : ''?><?
68 ?><?= (isset($params['readonly']) && $params['readonly']) ? ' readonly ' : ''?><?
69 ?>value="<?= \htmlspecialcharsbx($this->value ? $this->value : $this->default)?>" <?
70 ?> />
71 <?
72 }
73
79 public function setValue($value)
80 {
81 if ($this->maxlength > 0)
82 {
83 $this->value = mb_substr($value, 0, $this->maxlength);
84 }
85 else
86 {
87 $this->value = $value;
88 }
89 }
90}
__construct($code, array $params=array())
Определения text.php:23
setValue($value)
Определения text.php:79
isEmptyValue()
Определения text.php:40
viewForm(array $params=array())
Определения text.php:53
$placeholder
Определения text.php:16
$maxlength
Определения text.php:10
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
Определения tools.php:2701
Определения checkbox.php:2
<? endif;?> window document title
Определения prolog_main_admin.php:76
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799