From e518dafb19a0bb7dc3b1a1e4eea3326dd59806d9 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sun, 7 Dec 2008 21:24:50 +0000 Subject: 1) Revert the changes to Form_Upload and Form_Textarea, so we don't have to change third party code. 2) Change drawForm to check for a non empty $input->class in order to determime if the element should be wrapped in
  • ...
  • . If $input->class is empty then treat as a hidden field. --- modules/forge/libraries/Form_Textarea.php | 1 - modules/forge/libraries/Form_Upload.php | 1 - themes/default/views/form.html.php | 6 +++--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/forge/libraries/Form_Textarea.php b/modules/forge/libraries/Form_Textarea.php index 3f7b6f72..f6d28fd0 100644 --- a/modules/forge/libraries/Form_Textarea.php +++ b/modules/forge/libraries/Form_Textarea.php @@ -13,7 +13,6 @@ class Form_Textarea_Core extends Form_Input { protected $data = array ( - 'type' => 'textarea', 'class' => 'textarea', 'value' => '', ); diff --git a/modules/forge/libraries/Form_Upload.php b/modules/forge/libraries/Form_Upload.php index 86ac3c59..dce8816e 100644 --- a/modules/forge/libraries/Form_Upload.php +++ b/modules/forge/libraries/Form_Upload.php @@ -13,7 +13,6 @@ class Form_Upload_Core extends Form_Input { protected $data = array ( - 'type' => 'file', 'class' => 'upload', 'value' => '', ); diff --git a/themes/default/views/form.html.php b/themes/default/views/form.html.php index 41bdc0f9..6d527aed 100644 --- a/themes/default/views/form.html.php +++ b/themes/default/views/form.html.php @@ -27,10 +27,10 @@ if (!function_exists("DrawForm")) { } else { if ($input->error_messages()) { print "$prefix
  • \n"; - } else if ($input->type) { + } else if ($input->class) { print "$prefix
  • \n"; } else { - // no type means its a "hidden" so don't wrap it in
  • + // no class means its a "hidden" so don't wrap it in
  • } if ($input->label()) { print "$prefix {$input->label()}\n"; @@ -46,7 +46,7 @@ if (!function_exists("DrawForm")) { print "$prefix

    \n"; } } - if ($input->type) { + if ($input->class) { print "$prefix
  • \n"; } } -- cgit v1.2.3