Add support for textarea elements
authorJoey Schulze <joey@infodrom.org>
Fri, 5 Mar 2010 08:03:49 +0000 (09:03 +0100)
committerJoey Schulze <joey@infodrom.org>
Fri, 5 Mar 2010 08:03:49 +0000 (09:03 +0100)
lib/mask.php

index beb7d5e..6791c47 100644 (file)
@@ -61,6 +61,13 @@ function build_form($name, $mask)
       foreach ($options as $row)
        $ret[] = sprintf('<option value="%s">%s</option>', $row['id'], $row['text']);
       $ret[] = '</select>';
+    } elseif ($info['type'] == 'textarea') {
+      $ret[] = sprintf('<label for="edit_%s">%s</label><br>', $id, $info['name']);
+      $v = array('id="edit_'.$id.'"',
+                'name="'.$id.'"');
+      $v[] = sprintf('cols="%d"', empty($info['columns'])?'25':$info['columns']);
+      $v[] = sprintf('rows="%d"', empty($info['rows'])?'5':$info['columns']);
+      $ret[] = sprintf('<textarea %s></textarea>', implode(' ', $v));
     }
     if (array_key_exists('comment',$info))
       $ret[] = sprintf('<span class="comment">%s</span>', $info['comment']);