3namespace Bitrix\UI\Buttons;
5use Bitrix\Main\Type\Contract\Arrayable;
6use Bitrix\Main\Web\Json;
13 private $attributes = [];
15 private $dataAttributes = [];
69 return $this->dataAttributes;
74 if (!isset($this[self::JSON_OPTIONS_DATA_ATTR]))
76 $this[self::JSON_OPTIONS_DATA_ATTR] = [];
79 $this[self::JSON_OPTIONS_DATA_ATTR][
$key] = $value;
86 unset($this[self::JSON_OPTIONS_DATA_ATTR][
$key]);
93 $this[self::JSON_OPTIONS_DATA_ATTR] =
$options;
100 return isset($this[self::JSON_OPTIONS_DATA_ATTR])? $this[self::JSON_OPTIONS_DATA_ATTR] :
null;
110 if (!isset($this[
'class']))
115 if (!in_array($className, $this[
'class'],
true))
117 $this[
'class'][] = $className;
130 return isset($this[
'class']) && in_array($className, $this[
'class'],
true);
135 $this[
'class'] = $classList;
147 if (!isset($this[
'class']))
152 $index = array_search($className, $this[
'class'],
true);
153 if ($index !==
false)
155 unset($this[
'class'][$index]);
170 return new \ArrayIterator($this->
toArray());
189 $offset = mb_strtolower($offset);
191 $asAttribute = isset($this->attributes[$offset]) || array_key_exists($offset, $this->attributes);
197 if (!self::hasDataPrefix($offset))
204 return isset($this->dataAttributes[$offset]) || array_key_exists($offset, $this->dataAttributes);
220 $offset = mb_strtolower($offset);
221 if (isset($this->attributes[$offset]) || array_key_exists($offset, $this->attributes))
223 return $this->attributes[$offset];
226 if (!self::hasDataPrefix($offset))
232 if (isset($this->dataAttributes[$offset]) || array_key_exists($offset, $this->dataAttributes))
234 return $this->dataAttributes[$offset];
258 $this->attributes[] = $value;
262 $offset = mb_strtolower($offset);
263 if (self::hasDataPrefix($offset))
269 $this->attributes[$offset] = $value;
287 $offset = mb_strtolower($offset);
288 if (isset($this->attributes[$offset]) || array_key_exists($offset, $this->attributes))
290 unset($this->attributes[$offset]);
295 if (!self::hasDataPrefix($offset))
301 if (isset($this->dataAttributes[$offset]) || array_key_exists($offset, $this->dataAttributes))
303 unset($this->dataAttributes[$offset]);
318 return count($this->dataAttributes) +
count($this->attributes);
326 return (
string)$this;
335 foreach ($this as
$key => $value)
339 $string .=
"{$value} ";
343 if (
$key ===
'class')
351 elseif (
$key === self::JSON_OPTIONS_DATA_ATTR)
357 $string .=
"{$key}=\"{$value}\" ";
366 if (is_string($classes))
371 return implode(
' ', $classes);
376 if (is_string($styles))
382 foreach ($styles as
$name => $value)
384 $string .=
"{$name}:{$value};";
397 self::convertDataAttributesToAttributes($this->dataAttributes)
403 return "data-{$name}";
408 return is_string(
$name) && mb_substr(
$name, 0, 5) ===
'data-';
413 if (self::hasDataPrefix(
$name))
415 return mb_substr(
$name, 5);
424 foreach ($dataAttributes as
$name => $attribute)
434 $anotherAttributes = $dataAttributes = [];
435 foreach ($attributes as
$name => $attribute)
438 if (self::hasDataPrefix(
$name))
440 $dataAttributes[mb_substr(
$name, 5)] = $attribute;
444 $anotherAttributes[
$name] = $attribute;
448 return [$dataAttributes, $anotherAttributes];
if($_SERVER $defaultValue['REQUEST_METHOD']==="GET" &&!empty($RestoreDefaults) && $bizprocPerms==="W" &&check_bitrix_sessid())
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
if(empty($signedUserToken)) $key