| @@ 24-42 (lines=19) @@ | ||
| 21 | * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) |
|
| 22 | * @link http://xoops.org |
|
| 23 | */ |
|
| 24 | class Mail extends Text |
|
| 25 | { |
|
| 26 | /** |
|
| 27 | * Constructor |
|
| 28 | * |
|
| 29 | * @param string $caption Caption |
|
| 30 | * @param string $name name attribute |
|
| 31 | * @param integer $size Size |
|
| 32 | * @param integer $maxlength Maximum length of text |
|
| 33 | * @param string $value Initial text |
|
| 34 | * @param string $placeholder placeholder for this element. |
|
| 35 | */ |
|
| 36 | public function __construct($caption, $name, $size, $maxlength, $value = '', $placeholder = '') |
|
| 37 | { |
|
| 38 | parent::__construct($caption, $name, $size, $maxlength, $value, $placeholder); |
|
| 39 | $this->set('type', 'email'); |
|
| 40 | $this->setPattern('[^@]+@[^@]+\.[a-zA-Z]{2,6}', \XoopsLocale::ENTER_VALID_EMAIL); |
|
| 41 | } |
|
| 42 | } |
|
| 43 | ||
| @@ 24-42 (lines=19) @@ | ||
| 21 | * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) |
|
| 22 | * @link http://xoops.org |
|
| 23 | */ |
|
| 24 | class Url extends Text |
|
| 25 | { |
|
| 26 | /** |
|
| 27 | * __construct |
|
| 28 | * |
|
| 29 | * @param string $caption Caption |
|
| 30 | * @param string $name name attribute |
|
| 31 | * @param integer $size Size |
|
| 32 | * @param integer $maxlength Maximum length of text |
|
| 33 | * @param string $value Initial text |
|
| 34 | * @param string $placeholder placeholder for this element. |
|
| 35 | */ |
|
| 36 | public function __construct($caption, $name, $size, $maxlength, $value = '', $placeholder = '') |
|
| 37 | { |
|
| 38 | parent::__construct($caption, $name, $size, $maxlength, $value, $placeholder); |
|
| 39 | $this->set('type', 'url'); |
|
| 40 | $this->setPattern('https?://.+', \XoopsLocale::STARTING_WITH_HTTP_OR_HTTPS); |
|
| 41 | } |
|
| 42 | } |
|
| 43 | ||