Changeset 5988


Ignore:
Timestamp:
02/01/12 21:54:48 (4 months ago)
Author:
vain
Message:
  • comparison operator fixed on maxlength (removed equal sign)
Location:
trunk/core/viewhelper/form
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/viewhelper/form/form.php

    r5936 r5988  
    16331633     * 
    16341634     * The method iterates (loops over) all formelement objects and calls the validation on each object. 
    1635      * In other words: a form is valid, if all formelement are valid. Suprise, suprise. 
     1635     * In other words: a form is valid, if all formelement are valid. Surprise, surprise. 
    16361636     * 
    16371637     * @return boolean Returns true if form validates, false if validation fails, because errors exist. 
     
    16471647 
    16481648                # and transfer errormessages from formelement to form errormessages stack 
    1649                 #$this->addErrorMessage($formelement->getErrorMessages()); 
     1649                $this->addErrorMessage($formelement->getErrorMessages()); 
    16501650            } 
    16511651        } 
  • trunk/core/viewhelper/form/formelement.php

    r5949 r5988  
    7676 
    7777    /** 
     78     * Error status (flag variable) of the formelement. 
     79     * 
     80     * @var boolean 
     81     */ 
     82    protected $error = false; 
     83 
     84    /** 
    7885     * Set id of this form. 
    7986     * 
     
    618625        } 
    619626 
    620         # no rules / validators 
     627        # return early, if we have a value, but no rules / validators 
    621628        if(null === $this->validators) 
    622629        { 
  • trunk/core/viewhelper/form/validators/maxlength.php

    r5985 r5988  
    8989    protected function processValidationLogic($value) 
    9090    { 
    91         if (self::getStringLength($value) >= $this->getMaxlength()) 
     91        if (self::getStringLength($value) > $this->getMaxlength()) 
    9292        { 
    9393            return false; 
  • trunk/core/viewhelper/form/validators/maxvalue.php

    r5986 r5988  
    4343    public $maxvalue; 
    4444 
    45     public function getMaxvalue() 
     45    public function getMaxValue() 
    4646    { 
    4747        return $this->maxvalue; 
     
    5353     * @param integer $maxvalue 
    5454     */ 
    55     public function setMaxvalue($maxvalue) 
     55    public function setMaxValue($maxvalue) 
    5656    { 
    5757        $this->maxvalue = (int) $maxvalue; 
     
    6060    public function getErrorMessage() 
    6161    { 
    62         return _('The value exceeds the maxvalue of ' . $this->getMaxvalue() . ' chars.'); 
     62        return _('The value exceeds the maxvalue of ' . $this->getMaxValue() . ' chars.'); 
    6363    } 
    6464 
    6565    protected function processValidationLogic($value) 
    6666    { 
    67         if($value > $this->getMaxvalue()) 
     67        if($value > $this->getMaxValue()) 
    6868        { 
    6969            return false; 
  • trunk/core/viewhelper/form/validators/minlength.php

    r5985 r5988  
    8989    protected function processValidationLogic($value) 
    9090    { 
    91         if (self::getStringLength($value) <= $this->getMinlength()) 
     91        if (self::getStringLength($value) < $this->getMinlength()) 
    9292        { 
    9393            return false; 
  • trunk/core/viewhelper/form/validators/minvalue.php

    r5986 r5988  
    4343    public $minvalue; 
    4444 
    45     public function getMinvalue() 
     45    public function getMinValue() 
    4646    { 
    4747        return $this->minvalue; 
     
    5353     * @param integer $minvalue 
    5454     */ 
    55     public function setMinvalue($minvalue) 
     55    public function setMinValue($minvalue) 
    5656    { 
    5757        $this->minvalue = (int) $minvalue; 
     
    6060    public function getErrorMessage() 
    6161    { 
    62         return _('The value deceeds (is less than) the minvalue of ' . $this->getMinvalue() . ' chars.'); 
     62        return _('The value deceeds (is less than) the minvalue of ' . $this->getMinValue() . ' chars.'); 
    6363    } 
    6464 
    6565    protected function processValidationLogic($value) 
    6666    { 
    67         if($value <= $this->getMinvalue()) 
     67        if($value < $this->getMinValue()) 
    6868        { 
    6969            return false; 
Note: See TracChangeset for help on using the changeset viewer.