You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?php
- /**
- * Class helper_plugin_bureaucracy_fieldemail
- *
- * Creates a single line input field where the input is validated to be a valid email address
- */
- class helper_plugin_bureaucracy_fieldemail extends helper_plugin_bureaucracy_fieldtextbox {
-
- /**
- * Arguments:
- * - cmd
- * - label
- * - @@ (optional)
- * - ^ (optional)
- */
-
- /**
- * Validate field value
- *
- * @throws Exception when empty or not valid email address
- */
- function _validate() {
- parent::_validate();
-
- $value = $this->getParam('value');
- if(!is_null($value) && $value !== '@MAIL@' && !mail_isvalid($value)){
- throw new Exception(sprintf($this->getLang('e_email'),hsc($this->getParam('display'))));
- }
- }
- }
|