Dodelana textarea do formularu
authorThomas Mudrunka <tomas@mudrunka.cz>
Fri, 9 Dec 2011 14:05:42 +0000 (15:05 +0100)
committerThomas Mudrunka <tomas@mudrunka.cz>
Fri, 9 Dec 2011 14:05:42 +0000 (15:05 +0100)
index.php

index 02cdfe5d4607c1bc4bb380dd32639a3e4ffdce2e..88b7f1380c0a9930500b05941660549f944540ca 100755 (executable)
--- a/index.php
+++ b/index.php
@@ -91,6 +91,7 @@ class HTML {
        }
 
        function input($name=false, $value=false, $type='text', $placeholder=false, $options=false, $prefix='') {
+               if($type == 'textarea') return $this->textarea($name, $value, $placeholder, $options, $prefix);
                $html = T($prefix)."<input type='$type' ";
                if($name) $html.= "name='$name' ";
                if(!is_bool($value)) {
@@ -399,6 +400,10 @@ EOF;
        }
 
        function render_insert_inputs($class,$columns,$selectbox,$current,$hidecols,$update) {
+               $textarea = array(
+                       'item' => array('item_note'),
+                       'model' => array('model_descript')
+               );
                $html = '';
                foreach($columns as $column)    {
                        $html.=T($class).':<b>'.T($column['Field']).'</b>: ';
@@ -413,9 +418,11 @@ EOF;
                                case isset($selectbox[$column['Field']]):
                                        $html.=$this->select($name,$selectbox[$column['Field']],$val);
                                        break;
-                               default: //TODO: textarea
+                               case isset($textarea[$class]) && in_array($column['Field'],$textarea[$class]):
+                                       $html.=$this->input($name, $val, 'textarea');
+                                       break;
+                               default:
                                        $html.=$this->input($name, $val);
-                                       //$html.=$this->textarea($name, $val);
                                        break;
                        }
                        $html.='<br />';
This page took 0.254765 seconds and 4 git commands to generate.