Source of file CustomizableInputFieldPart.php
Size: 2,165 Bytes - Last Modified: 2021-12-23T10:06:00+00:00
/var/www/docs.ssmods.com/process/src/code/forms/CustomizableInputFieldPart.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 | <?php /** * Color field */ class CustomizableInputFieldPart extends TextField { /** * @var string */ protected $before = ''; /** * @var string */ protected $after = ''; /** * @var string */ protected $beforeVal = ''; /** * @var string */ protected $afterVal = ''; /** * @var string */ protected $whitespaces = 1; /** * @var string */ protected $allowedSigns = ''; public function __construct($name = '', $title = null, $value = '', $maxLength = null, $form = null) { parent::__construct($name, $title, $value, $maxLength, $form); $this->setAttribute('class', 'text'); $this->setAttribute('type', 'text'); $this->setAttribute('data-type', 'input'); } /** * @return string */ public function getBefore() { return $this->before; } /** * @param $before * @param bool|false $beforeVal * @return CustomizableInputField */ public function setBefore($before, $beforeVal = false) { $this->before = strval($before); if ($beforeVal !== false) { $this->beforeVal = strval($beforeVal); } else { $this->beforeVal = $this->before; } return $this; } /** * @return string */ public function getAfter() { return $this->after; } /** * @param $after * @param bool|false $afterVal * @return CustomizableInputField */ public function setAfter($after, $afterVal = false) { $this->after = strval($after); if ($afterVal !== false) { $this->afterVal = strval($afterVal); } else { $this->afterVal = $this->after; } return $this; } /** * removes whitespaces between input, before and after */ public function setNoWithespaces() { $this->whitespaces = 0; } /** * @param string $allowedSigns */ public function setAllowedSigns($allowedSigns) { $this->allowedSigns = $allowedSigns; } } |