- Fix: when From field is a first object in compose template form's hidden fields aren't added to the output

release-0.6
alecpl 15 years ago
parent ce06d32dd8
commit 8958d01311

@ -204,7 +204,7 @@ function rcmail_compose_headers($attrib)
switch ($part) switch ($part)
{ {
case 'from': case 'from':
return rcmail_compose_header_from($attrib); return $form_start . rcmail_compose_header_from($attrib);
case 'to': case 'to':
$fname = '_to'; $fname = '_to';
@ -412,9 +412,6 @@ function rcmail_compose_header_from($attrib)
$out = $input_from->show($_POST['_from']); $out = $input_from->show($_POST['_from']);
} }
if ($form_start)
$out = $form_start.$out;
return $out; return $out;
} }
@ -1100,7 +1097,7 @@ function get_form_tags($attrib)
global $RCMAIL, $MESSAGE_FORM; global $RCMAIL, $MESSAGE_FORM;
$form_start = ''; $form_start = '';
if (!strlen($MESSAGE_FORM)) if (!$MESSAGE_FORM)
{ {
$hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $RCMAIL->task)); $hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $RCMAIL->task));
$hiddenfields->add(array('name' => '_action', 'value' => 'send')); $hiddenfields->add(array('name' => '_action', 'value' => 'send'));
@ -1109,10 +1106,10 @@ function get_form_tags($attrib)
$form_start .= $hiddenfields->show(); $form_start .= $hiddenfields->show();
} }
$form_end = (strlen($MESSAGE_FORM) && !strlen($attrib['form'])) ? '</form>' : ''; $form_end = ($MESSAGE_FORM && !strlen($attrib['form'])) ? '</form>' : '';
$form_name = !empty($attrib['form']) ? $attrib['form'] : 'form'; $form_name = !empty($attrib['form']) ? $attrib['form'] : 'form';
if (!strlen($MESSAGE_FORM)) if (!$MESSAGE_FORM)
$RCMAIL->output->add_gui_object('messageform', $form_name); $RCMAIL->output->add_gui_object('messageform', $form_name);
$MESSAGE_FORM = $form_name; $MESSAGE_FORM = $form_name;

Loading…
Cancel
Save