Varien_Data_Form_Element_Multiline Class Reference

Inheritance diagram for Varien_Data_Form_Element_Multiline:

Varien_Data_Form_Element_Abstract Varien_Data_Form_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ($attributes=array())
 getHtmlAttributes ()
 getLabelHtml ($suffix=0)
 getElementHtml ()
 getDefaultHtml ()


Detailed Description

Form multiline text elements

Author:
Magento Core Team <core@magentocommerce.com>

Definition at line 32 of file Multiline.php.


Constructor & Destructor Documentation

__construct ( attributes = array()  ) 

Enter description here...

Parameters:
array $attributes

Reimplemented from Varien_Data_Form_Element_Abstract.

Definition at line 34 of file Multiline.php.

00035     {
00036         parent::__construct($attributes);
00037         $this->setType('text');
00038         $this->setLineCount(2);
00039     }


Member Function Documentation

getDefaultHtml (  ) 

Reimplemented from Varien_Data_Form_Element_Abstract.

Definition at line 75 of file Multiline.php.

00076     {
00077         $html = '';
00078         $lineCount = $this->getLineCount();
00079 
00080         for ($i=0; $i<$lineCount; $i++){
00081             $html.= ( $this->getNoSpan() === true ) ? '' : '<span class="field-row">'."\n";
00082             if ($i==0) {
00083                 $html.= '<label for="'.$this->getHtmlId().$i.'">'.$this->getLabel()
00084                     .( $this->getRequired() ? ' <span class="required">*</span>' : '' ).'</label>'."\n";
00085                 if($this->getRequired()){
00086                     $this->setClass('input-text required-entry');
00087                 }
00088             }
00089             else {
00090                 $this->setClass('input-text');
00091                 $html.= '<label>&nbsp;</label>'."\n";
00092             }
00093             $html.= '<input id="'.$this->getHtmlId().$i.'" name="'.$this->getName().'['.$i.']'
00094                 .'" value="'.$this->getEscapedValue($i).'"'.$this->serialize($this->getHtmlAttributes()).' />'."\n";
00095             if ($i==0) {
00096                 $html.= $this->getAfterElementHtml();
00097             }
00098             $html.= ( $this->getNoSpan() === true ) ? '' : '</span>'."\n";
00099         }
00100         return $html;
00101     }

getElementHtml (  ) 

Reimplemented from Varien_Data_Form_Element_Abstract.

Definition at line 51 of file Multiline.php.

00052     {
00053         $html = '';
00054         $lineCount = $this->getLineCount();
00055 
00056         for ($i=0; $i<$lineCount; $i++){
00057             if ($i==0) {
00058                 if($this->getRequired()){
00059                     $this->setClass('input-text required-entry');
00060                 }
00061             }
00062             else {
00063                 $this->setClass('input-text');
00064             }
00065             $html.= '<div class="multi-input"><input id="'.$this->getHtmlId().$i.'" name="'.$this->getName().'['.$i.']'
00066                 .'" value="'.$this->getEscapedValue($i).'"'.$this->serialize($this->getHtmlAttributes()).' />'."\n";
00067             if ($i==0) {
00068                 $html.= $this->getAfterElementHtml();
00069             }
00070             $html.= '</div>';
00071         }
00072         return $html;
00073     }

getHtmlAttributes (  ) 

Reimplemented from Varien_Data_Form_Element_Abstract.

Definition at line 41 of file Multiline.php.

00042     {
00043         return array('type', 'title', 'class', 'style', 'onclick', 'onchange', 'disabled', 'maxlength');
00044     }

getLabelHtml ( suffix = 0  ) 

Reimplemented from Varien_Data_Form_Element_Abstract.

Definition at line 46 of file Multiline.php.

00047     {
00048         return parent::getLabelHtml($suffix);
00049     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:25:00 2009 for Magento by  doxygen 1.5.8