From 58c7f4bf610d5245bf367b00f78c7f258072622c Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 12 Jul 2007 08:03:37 +0000 Subject: [PATCH] fixed double displayed label --- .../inc/class.customfields_widget.inc.php | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/etemplate/inc/class.customfields_widget.inc.php b/etemplate/inc/class.customfields_widget.inc.php index 8b1dd61574..db4060b43b 100644 --- a/etemplate/inc/class.customfields_widget.inc.php +++ b/etemplate/inc/class.customfields_widget.inc.php @@ -122,7 +122,8 @@ $row_class = 'row'; etemplate::add_child($cell,$label =& etemplate::empty_cell('label','',array( 'label' => $field['label'], - 'no_lang' => substr(lang($field['label']),-1) == '*' ? 2 : 0 + 'no_lang' => substr(lang($field['label']),-1) == '*' ? 2 : 0, + 'span' => $field['type'] === 'label' ? '2' : '', ))); } switch ((string)$field['type']) @@ -154,7 +155,6 @@ } break; case 'label' : - $label['span'] = 'all'; $row_class = 'th'; break; case 'checkbox' : @@ -208,16 +208,20 @@ 'size' => $field['type'] == 'link-entry' ? '' : $field['type'], )); } - if ($readonly) $input['readonly'] = true; - - if (!empty($field['help']) && $row_class != 'th') - { - $input['help'] = $field['help']; - $input['no_lang'] = substr(lang($help),-1) == '*' ? 2 : 0; - } $cell['data'][0]['c'.$n++] = $row_class.',top'; - etemplate::add_child($cell,$input); - unset($input); + + if (!is_null($input)) + { + if ($readonly) $input['readonly'] = true; + + if (!empty($field['help']) && $row_class != 'th') + { + $input['help'] = $field['help']; + $input['no_lang'] = substr(lang($help),-1) == '*' ? 2 : 0; + } + etemplate::add_child($cell,$input); + unset($input); + } unset($label); } if ($type != 'customfields-list')