Inputarea.class.php (1084B)
1 <?php 2 3 namespace template_engine\components; 4 5 class InputareaComponent extends FieldComponent 6 { 7 8 public $rows = 10; 9 10 public $cols = 40; 11 12 public $value; 13 14 public $index; 15 16 public $onchange; 17 18 public $prefix; 19 20 public $class = 'inputarea'; 21 22 public $default; 23 24 public $maxlength = 0; 25 26 public $label; 27 28 public function begin() 29 { 30 if ( $this->label ) 31 { 32 echo '<label class="or-form-row"><span class="or-form-label">'.lang($this->label).'</span><span class="or-form-input">'; 33 } 34 35 echo '<div class="inputholder">'; 36 echo '<textarea'; 37 echo ' class="'.$this->htmlvalue($this->class).'"'; 38 39 echo $this->outputNameAttribute(); 40 41 if (!empty($this->maxlength)) 42 echo ' maxlength="'.intval($this->maxlength).'"'; 43 44 echo '>'; 45 echo '<?php echo Text::encodeHtml('; 46 if (isset($this->default)) 47 echo $this->value($this->default); 48 else 49 echo '$'.$this->varname($this->name).''; 50 echo ') ?>'; 51 echo '</textarea>'; 52 echo '</div>'; 53 54 if ( $this->label ) 55 { 56 echo '</span></label>'; 57 } 58 } 59 } 60 61 ?>