Esempio n. 1
0
 public static function Factory($name, $value, $label = '', $required = false, $wysiwyg = false, $cols = 80, $rows = 20, $attrList = array())
 {
     $element = new TextArea($name);
     $element->setValue($value);
     $element->setLabel($label);
     $element->setRequired($required);
     $element->setOptionList($attrList);
     $element->useWysiwyg($wysiwyg);
     $element->setRows($rows);
     $element->setCols($cols);
     return $element;
 }
Esempio n. 2
0
 /**
  * FormHandler::textArea()
  *
  * Create a textarea on the form
  *
  * @param string $title: The title of the field
  * @param string $name: The name of the field
  * @param string $validator: The validator which should be used to validate the value of the field
  * @param int $cols: How many cols (the width of the field)
  * @param int $rows: How many rows (the height of the field)
  * @param string $extra: CSS, Javascript or other which are inserted into the HTML tag
  * @return void
  * @access public
  * @author Teye Heimans
  */
 function textArea($title, $name, $validator = null, $cols = null, $rows = null, $extra = null)
 {
     require_once FH_INCLUDE_DIR . 'fields/class.TextArea.php';
     // create new textarea
     $fld = new TextArea($this, $name);
     if (!empty($validator)) {
         $fld->setValidator($validator);
     }
     if (!empty($cols)) {
         $fld->setCols($cols);
     }
     if (!empty($rows)) {
         $fld->setRows($rows);
     }
     if (!empty($extra)) {
         $fld->setExtra($extra);
     }
     // register the field
     $this->_registerField($name, $fld, $title);
 }