/[cvs]/nfo/php/libs/com.newsblob.phphtmllib/form/form_elements/FEText.inc
ViewVC logotype

Diff of /nfo/php/libs/com.newsblob.phphtmllib/form/form_elements/FEText.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by jonen, Thu May 6 16:27:27 2004 UTC revision 1.4 by jonen, Thu Aug 11 14:09:59 2005 UTC
# Line 5  Line 5 
5   *   *
6   * $Id$   * $Id$
7   *   *
8   * @author Walter A. Boring IV <waboring@buildabetterweb.com>   * @author Walter A. Boring IV <waboring@newsblob.com>
9   * @author Suren Markosyan <suren@bcsweb.com>   * @author Suren Markosyan <suren@bcsweb.com>
10   * @package phpHtmlLib   * @package phpHtmlLib
11   * @subpackage FormProcessing   * @subpackage FormProcessing
# Line 19  Line 19 
19   * text input field. It has no validation method.   * text input field. It has no validation method.
20   *   *
21   *   *
22   * @author Walter A. Boring IV <waboring@buildabetterweb.com>   * @author Walter A. Boring IV <waboring@newsblob.com>
23   * @author Suren Markossian <suren@bcsweb.com>   * @author Suren Markossian <suren@bcsweb.com>
24   * @package phpHtmlLib   * @package phpHtmlLib
25   * @subpackage FormProcessing   * @subpackage FormProcessing
# Line 74  class FEText extends FormElement { Line 74  class FEText extends FormElement {
74   * text input field, and validates against the   * text input field, and validates against the
75   * is_name() method.   * is_name() method.
76   *   *
77   * @author Walter A. Boring IV <waboring@buildabetterweb.com>   * @author Walter A. Boring IV <waboring@newsblob.com>
78   * @author Suren Markossian <suren@bcsweb.com>   * @author Suren Markossian <suren@bcsweb.com>
79   * @package phpHtmlLib   * @package phpHtmlLib
80   * @subpackage FormProcessing   * @subpackage FormProcessing
# Line 105  class FEName extends FEText { Line 105  class FEName extends FEText {
105   * It validatest he data as is_email()   * It validatest he data as is_email()
106   *   *
107   *   *
108   * @author Walter A. Boring IV <waboring@buildabetterweb.com>   * @author Walter A. Boring IV <waboring@newsblob.com>
109   * @author Suren Markossian <suren@bcsweb.com>   * @author Suren Markossian <suren@bcsweb.com>
110   * @package phpHtmlLib   * @package phpHtmlLib
111   * @subpackage FormProcessing   * @subpackage FormProcessing
# Line 113  class FEName extends FEText { Line 113  class FEName extends FEText {
113   * @copyright LGPL - See LICENCE   * @copyright LGPL - See LICENCE
114   */   */
115  class FEEmail extends FEText {  class FEEmail extends FEText {
116        
117        /** Holds the flag to indicate
118          * whether we allow email in
119          * the long name format like
120          * Foo Bar <email@email.com>
121          */
122        var $_allow_name = true;    
123    
124      /**      /**
125       * This method validates the data       * This method validates the data
# Line 122  class FEEmail extends FEText { Line 129  class FEEmail extends FEText {
129       * @param FormValidation object.       * @param FormValidation object.
130       */       */
131      function validate($_FormValidation) {      function validate($_FormValidation) {
132          if (!$_FormValidation->is_email($this->get_value())) {          if (!$_FormValidation->is_email($this->get_value(), $this->_allow_name)) {
133              $this->set_error_message( $_FormValidation->get_error_message() );              $this->set_error_message( $_FormValidation->get_error_message() );
134              return FALSE;              return FALSE;
135          }          }
136          return TRUE;          return TRUE;
137      }      }
138    
139        /**
140         * Sets the flag to indicate
141         * whether we allow email in
142         * the long name format like
143         * Foo Bar <email@email.com>
144         *
145         * @param bool
146         */
147        function set_allow_name($flag) {
148            $this->_allow_name = $flag;
149        }    
150  }  }
151    
152  /**  /**
# Line 138  class FEEmail extends FEText { Line 157  class FEEmail extends FEText {
157   * It validatest he data as is_manyemails()   * It validatest he data as is_manyemails()
158   *   *
159   *   *
160   * @author Walter A. Boring IV <waboring@buildabetterweb.com>   * @author Walter A. Boring IV <waboring@newsblob.com>
161   * @author Suren Markossian <suren@bcsweb.com>   * @author Suren Markossian <suren@bcsweb.com>
162   * @package phpHtmlLib   * @package phpHtmlLib
163   * @subpackage FormProcessing   * @subpackage FormProcessing
# Line 169  class FEEmailMany extends FEText { Line 188  class FEEmailMany extends FEText {
188   * It validates as is_domainname().   * It validates as is_domainname().
189   *   *
190   *   *
191   * @author Walter A. Boring IV <waboring@buildabetterweb.com>   * @author Walter A. Boring IV <waboring@newsblob.com>
192   * @author Suren Markossian <suren@bcsweb.com>   * @author Suren Markossian <suren@bcsweb.com>
193   * @package phpHtmlLib   * @package phpHtmlLib
194   * @subpackage FormProcessing   * @subpackage FormProcessing
# Line 200  class FEDomainName extends FEText { Line 219  class FEDomainName extends FEText {
219   * It validates as is_domainname().   * It validates as is_domainname().
220   *   *
221   *   *
222   * @author Walter A. Boring IV <waboring@buildabetterweb.com>   * @author Walter A. Boring IV <waboring@newsblob.com>
223   * @author Suren Markossian <suren@bcsweb.com>   * @author Suren Markossian <suren@bcsweb.com>
224   * @package phpHtmlLib   * @package phpHtmlLib
225   * @subpackage FormProcessing   * @subpackage FormProcessing
# Line 337  class FEHostNameWithPort extends FEText Line 356  class FEHostNameWithPort extends FEText
356   * It validates as is_ip().   * It validates as is_ip().
357   *   *
358   *   *
359   * @author Walter A. Boring IV <waboring@buildabetterweb.com>   * @author Walter A. Boring IV <waboring@newsblob.com>
360   * @author Suren Markossian <suren@bcsweb.com>   * @author Suren Markossian <suren@bcsweb.com>
361   * @package phpHtmlLib   * @package phpHtmlLib
362   * @subpackage FormProcessing   * @subpackage FormProcessing
# Line 368  class FEIPAddress extends FEText { Line 387  class FEIPAddress extends FEText {
387   * It validates as is_ip().   * It validates as is_ip().
388   *   *
389   *   *
390   * @author Walter A. Boring IV <waboring@buildabetterweb.com>   * @author Walter A. Boring IV <waboring@newsblob.com>
391   * @author Suren Markossian <suren@bcsweb.com>   * @author Suren Markossian <suren@bcsweb.com>
392   * @package phpHtmlLib   * @package phpHtmlLib
393   * @subpackage FormProcessing   * @subpackage FormProcessing
# Line 401  class FEIPAddressWithPort extends FEHost Line 420  class FEIPAddressWithPort extends FEHost
420   * It validates as is_url().   * It validates as is_url().
421   *   *
422   *   *
423   * @author Walter A. Boring IV <waboring@buildabetterweb.com>   * @author Walter A. Boring IV <waboring@newsblob.com>
424   * @author Suren Markossian <suren@bcsweb.com>   * @author Suren Markossian <suren@bcsweb.com>
425   * @package phpHtmlLib   * @package phpHtmlLib
426   * @subpackage FormProcessing   * @subpackage FormProcessing
# Line 433  class FEUrl extends FEText { Line 452  class FEUrl extends FEText {
452   * It validates as is_strict_url().   * It validates as is_strict_url().
453   *   *
454   *   *
455   * @author Walter A. Boring IV <waboring@buildabetterweb.com>   * @author Walter A. Boring IV <waboring@newsblob.com>
456   * @author Suren Markossian <suren@bcsweb.com>   * @author Suren Markossian <suren@bcsweb.com>
457   * @package phpHtmlLib   * @package phpHtmlLib
458   * @subpackage FormProcessing   * @subpackage FormProcessing
# Line 461  class FEUrlStrict extends FEText { Line 480  class FEUrlStrict extends FEText {
480  /**  /**
481   * This is the FEZipcode class.   * This is the FEZipcode class.
482   *   *
483   * @author Walter A. Boring IV <waboring@buildabetterweb.com>   * @author Walter A. Boring IV <waboring@newsblob.com>
484   */   */
485  class FEZipcode extends FEText {  class FEZipcode extends FEText {
486      /**      /**
# Line 494  class FEZipcode extends FEText { Line 513  class FEZipcode extends FEText {
513  }  }
514    
515  /**  /**
516   * This is the RegEx FormElement which builds a   * This is the RegEx FormElement which builds a text input field, and validates
517   * text input field, and validates against the   * against the is_regex() method.
518   * is_regex() method.   *
519     * Example as it would appear in FormContent::form_init_elements():
520     * <code>
521     *      $this->add_element( new FERegEx("FERegEx label", false, '200px', 3, '/^pattern to match$/', 'error message when pattern does not match') );
522     * </code>
523   *   *
524   * @author Culley Harrelson <culley@fastmail.fm>   * @author Culley Harrelson <culley@fastmail.fm>
525   * @package phpHtmlLib   * @package phpHtmlLib
# Line 531  class FERegEx extends FEText { Line 554  class FERegEx extends FEText {
554       *       *
555       * It validates as is_regex().       * It validates as is_regex().
556       * @param FormValidation object.       * @param FormValidation object.
557         * @return boolean
558       */       */
559      function validate(&$_FormValidation) {      function validate(&$_FormValidation) {
560          if (!$_FormValidation->is_regex($this->_regex, $this->get_value())) {          if (!$_FormValidation->is_regex($this->_regex, $this->get_value())) {

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed