change button and wrapper
This commit is contained in:
@@ -278,14 +278,12 @@ function booking_emails_custom_ajax_form($node, &$form_state) {
|
|||||||
if (!isset($form_state['input']['email-type'])) {
|
if (!isset($form_state['input']['email-type'])) {
|
||||||
$subject_value = "";
|
$subject_value = "";
|
||||||
$body_value = "";
|
$body_value = "";
|
||||||
$submit_button_disabled = FALSE;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
watchdog('booking_debug', 'booking_emails_custom_ajax_form user has selected email type');
|
watchdog('booking_debug', 'booking_emails_custom_ajax_form user has selected email type');
|
||||||
$emailtype = $form_state['input']['email-type'];
|
$emailtype = $form_state['input']['email-type'];
|
||||||
$subject_value = $form_state['input']['booking_email_subjectline_custom'];
|
$subject_value = $form_state['input']['booking_email_subjectline_custom'];
|
||||||
$body_value = $form_state['input']['booking_email_body_custom']['value'];
|
$body_value = $form_state['input']['booking_email_body_custom']['value'];
|
||||||
$submit_button_disabled = TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(variable_get('booking_enable_html_mail', 0) == 1) {
|
if(variable_get('booking_enable_html_mail', 0) == 1) {
|
||||||
@@ -297,6 +295,9 @@ function booking_emails_custom_ajax_form($node, &$form_state) {
|
|||||||
$form_format = NULL;
|
$form_format = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$form['#prefix'] = '<div id="booking_emails_custom_fieldset_wrapper">';
|
||||||
|
$form['#suffix'] = '</div>';
|
||||||
|
|
||||||
//include the token definitions
|
//include the token definitions
|
||||||
$form['tokens'] = array(
|
$form['tokens'] = array(
|
||||||
'#theme' => 'token_tree',
|
'#theme' => 'token_tree',
|
||||||
@@ -319,8 +320,8 @@ function booking_emails_custom_ajax_form($node, &$form_state) {
|
|||||||
$form['email-definition'] = array(
|
$form['email-definition'] = array(
|
||||||
'#type' => 'fieldset',
|
'#type' => 'fieldset',
|
||||||
'#title' => 'Email Definition',
|
'#title' => 'Email Definition',
|
||||||
'#prefix' => '<div id="booking_emails_custom_fieldset_wrapper">',
|
//'#prefix' => '<div id="booking_emails_custom_fieldset_wrapper">',
|
||||||
'#suffix' => '</div>'
|
//'#suffix' => '</div>'
|
||||||
);
|
);
|
||||||
|
|
||||||
$form['email-definition']['booking_email_subjectline_custom'] = array (
|
$form['email-definition']['booking_email_subjectline_custom'] = array (
|
||||||
@@ -340,20 +341,11 @@ function booking_emails_custom_ajax_form($node, &$form_state) {
|
|||||||
'#format' => $form_format,
|
'#format' => $form_format,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!isset($form_state['input']['email-type'])) {
|
$form['email-definition']['submit'] = array(
|
||||||
$form['email-definition']['submit'] = array(
|
'#type' => 'submit',
|
||||||
'#type' => 'submit',
|
'#value' => t('Save'),
|
||||||
'#value' => t('Save'),
|
'#disabled' => TRUE,
|
||||||
'#disabled' => TRUE,
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$form['email-definition']['submit'] = array(
|
|
||||||
'#type' => 'submit',
|
|
||||||
'#value' => t('Save'),
|
|
||||||
'#disabled' => FALSE,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return array (
|
return array (
|
||||||
'form' => $form,
|
'form' => $form,
|
||||||
@@ -381,12 +373,12 @@ function booking_emails_custom_ajax_form_callback($form, &$form_state) {
|
|||||||
//watchdog('booking_debug', 'custom text: <pre>@info</pre>', array('@info' => print_r( $text, true)));
|
//watchdog('booking_debug', 'custom text: <pre>@info</pre>', array('@info' => print_r( $text, true)));
|
||||||
// TODO : Figure out what this should be if HTML emails are NOT enabled
|
// TODO : Figure out what this should be if HTML emails are NOT enabled
|
||||||
$form['form']['email-definition']['booking_email_body_custom']['value']['#value'] = $text;
|
$form['form']['email-definition']['booking_email_body_custom']['value']['#value'] = $text;
|
||||||
//$form['form']['submit']['#disabled'] = FALSE;
|
$form['form']['submit']['#disabled'] = FALSE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$form['form']['email-definition']['booking_email_subjectline_custom']['#value'] = '';
|
$form['form']['email-definition']['booking_email_subjectline_custom']['#value'] = '';
|
||||||
$form['form']['email-definition']['booking_email_body_custom']['value']['#value'] = '';
|
$form['form']['email-definition']['booking_email_body_custom']['value']['#value'] = '';
|
||||||
//$form['form']['submit']['#disabled'] = TRUE;
|
$form['form']['submit']['#disabled'] = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
watchdog('booking_debug', 'booking_emails_custom_ajax_form_callback: <pre>@info</pre>', array('@info' => print_r( $form, true)));
|
watchdog('booking_debug', 'booking_emails_custom_ajax_form_callback: <pre>@info</pre>', array('@info' => print_r( $form, true)));
|
||||||
|
Reference in New Issue
Block a user