convert travel page to full html text

This commit is contained in:
2016-05-31 17:44:45 +10:00
parent 4baa283539
commit a7f474ec56
2 changed files with 19 additions and 8 deletions

View File

@@ -274,7 +274,7 @@ $booking_registration_intro_text = variable_get('booking_registration_intro_text
'#format' => 'full_html', '#format' => 'full_html',
); );
$form['travel']['booking_travelform_page_post_text'] = array( $form['travel']['booking_travelform_page_post_text'] = array(
'#title' => t('Text to use at the end of the travel form'), '#title' => t('Text to use at the end of the travel form. This is not displayed on the "travel form completed" page defined below.'),
'#type' => 'textarea', '#type' => 'textarea',
'#description' => t(''), '#description' => t(''),
'#default_value' => isset(variable_get('booking_travelform_page_post_text')['value']) ? variable_get('booking_travelform_page_post_text')['value'] : $defaults, '#default_value' => isset(variable_get('booking_travelform_page_post_text')['value']) ? variable_get('booking_travelform_page_post_text')['value'] : $defaults,

View File

@@ -35,18 +35,18 @@ function booking_travel_page()
if ($person) { if ($person) {
//load this person's data //load this person's data
$node = node_load($person->nid); $node = node_load($person->nid);
$tokens = booking_define_personspecific_tokens($node); $tokens = booking_define_personspecific_tokens($node);
//watchdog('booking', 'Checking for existing travel form for: @info', array('@info' => var_export($person, TRUE))); //watchdog('booking', 'Checking for existing travel form for: @info', array('@info' => var_export($person, TRUE)));
//check for an existing travel form //check for an existing travel form
if (!empty($node->tid)) { if (!empty($node->tid)) {
$output = token_replace(variable_get('booking_travelform_completed_page'), $tokens); $inputtext = variable_get('booking_travelform_completed_page');
//$output = token_replace(variable_get('booking_travelform_completed_page'), $tokens);
$return_array[] = array( $return_array[] = array(
'paragraph' => array( 'paragraph' => array(
'#type' => 'markup', '#type' => 'markup',
'#markup' => $output '#markup' => token_replace($inputtext['value'], $tokens),
) )
); );
} }
@@ -54,20 +54,31 @@ function booking_travel_page()
else { else {
//Output different text if this is for a married couple //Output different text if this is for a married couple
if ((variable_get('booking_enable_combined_pricing', 0) == 1) && $node->booking_partner_id > 0) { if ((variable_get('booking_enable_combined_pricing', 0) == 1) && $node->booking_partner_id > 0) {
$output = token_replace(variable_get('booking_travelform_married_page'), $tokens); $inputtext = variable_get('booking_travelform_married_page');
//$output = token_replace(variable_get('booking_travelform_married_page'), $tokens);
} else { } else {
$output = token_replace(variable_get('booking_travelform_page'), $tokens); $inputtext = variable_get('booking_travelform_page');
//$output = token_replace(variable_get('booking_travelform_page'), $tokens);
} }
//text before form
$return_array[] = array( $return_array[] = array(
'paragraph' => array( 'paragraph' => array(
'#type' => 'markup', '#type' => 'markup',
'#markup' => $output '#markup' => token_replace($inputtext['value'], $tokens),
) )
); );
//actual form
$return_array[] = array( $return_array[] = array(
'form' => drupal_get_form('travel_form', true, $node->nid) 'form' => drupal_get_form('travel_form', true, $node->nid)
); );
//text after form
$afterform_text = variable_get('booking_travelform_page_post_text');
$return_array[] = array(
'paragraph' => array(
'#type' => 'markup',
'#markup' => token_replace($afterform_text['value'], $tokens),
)
);
} }
return $return_array; return $return_array;