Changeset 741

Show
Ignore:
Timestamp:
08/25/08 14:37:12 (3 months ago)
Author:
zak
Message:

- Added separator in form_field_dropdown

Zak

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/Form/Field.php

    r740 r741  
    452452                ); 
    453453        foreach($this->getValueList() as $value=>$descr){ 
    454             $output.= 
    455                 $this->getTag('option',array( 
    456                         'value'=>$value, 
    457                         'selected'=>$value == $this->value 
    458                     )) 
    459                 .htmlspecialchars($descr) 
    460                 .$this->getTag('/option'); 
     454            // Check if a separator is not needed identified with _separator< 
     455            if ($value != '_separator') { 
     456                $output.= 
     457                    $this->getTag('option',array( 
     458                            'value'=>$value, 
     459                            'selected'=>$value == $this->value 
     460                        )) 
     461                    .htmlspecialchars($descr) 
     462                    .$this->getTag('/option'); 
     463            } else { 
     464                $output.= 
     465                    $this->getTag('option',array( 
     466                            'disabled'=>'disabled', 
     467                        )) 
     468                    .htmlspecialchars($descr) 
     469                    .$this->getTag('/option');                 
     470            } 
    461471        } 
    462472        $output.=$this->getTag('/select');