test meta tokens
This commit is contained in:
@@ -707,15 +707,28 @@ function booking_admin() {
|
||||
'#description' => t('Select database fields to export to CSV. Ensure you hold down control/command when selecting multiple options.'),
|
||||
'#options' => $booking_view_fields,
|
||||
'#default_value' => variable_get('booking_export_include_fields_dynamic', ''),
|
||||
);
|
||||
$form['management']['booking_import_include_fields_dynamic'] = array(
|
||||
);
|
||||
$form['management']['booking_import_include_fields_dynamic'] = array(
|
||||
'#type' => 'select',
|
||||
'#multiple' => TRUE,
|
||||
'#title' => t('Not In Use - Select database fields'),
|
||||
'#description' => t('Select database fields to import from an uploaded CSV file. Ensure you hold down control/command when selecting multiple options.'),
|
||||
'#options' => $booking_view_fields,
|
||||
'#default_value' => variable_get('booking_import_include_fields_dynamic', ''),
|
||||
);
|
||||
);
|
||||
|
||||
$form['meta-tokens'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => 'Meta Token Definitions',
|
||||
'#collapsible' => TRUE,
|
||||
);
|
||||
$form['meta-tokens']['booking_studygroup_summary_li_text'] = array (
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Study Group Summary Format'),
|
||||
'#default_value' => variable_get('booking_studygroup_summary_li_text',
|
||||
'<b>[meta-booking:studygroup-role]</b> for group <b>[meta-booking:studygroup-descrip]</b>, which will occur on <b>[meta-booking:studygroup-weekday]</b>. <b>[meta-booking:studygroup-explan]</b>'),
|
||||
'#description' => 'List element definition (using tokens) for study group summary in emails.',
|
||||
);
|
||||
|
||||
//return system_settings_form($form);
|
||||
//make sure we update our custom sql view every time we change something on the admin page
|
||||
|
@@ -1630,6 +1630,16 @@ function _booking_studygroup_email_summary($node) {
|
||||
if (!empty($node->$sessionid)) {
|
||||
//$rows[] = t($studygroup->booking_studygroup_descrip . ": Group " . $node->$sessionid . ", " . _booking_studygroup_role_lookup($node->$roleid));
|
||||
|
||||
$tokens = array(
|
||||
'studygroup-descrip' => $studygroup->booking_studygroup_descrip,
|
||||
'studygroup-weekday' => $studygroup->booking_studygroup_weekday,
|
||||
'studygroup-explan' => $studygroup->booking_studygroup_explanation,
|
||||
'studygroup-role' => _booking_studygroup_role_lookup($node->$roleid),
|
||||
);
|
||||
|
||||
$li_text = variable_get('booking_studygroup_summary_li_text', '');
|
||||
$rows[] = token_replace($li_text, $tokens);
|
||||
/*
|
||||
// Add some boldness if we're using html email
|
||||
if(variable_get('booking_enable_html_mail', 0) == 1) {
|
||||
$rows[] = t('<b>!role</b> for group <b>!descrip</b>, which will occur on <b>!weekday</b>. <b>!explan</b>', array(
|
||||
@@ -1644,6 +1654,7 @@ function _booking_studygroup_email_summary($node) {
|
||||
'!explan' => $studygroup->booking_studygroup_explanation, '!role' => _booking_studygroup_role_lookup($node->$roleid),
|
||||
));
|
||||
}
|
||||
*/
|
||||
} // End checking for empty studygroup session
|
||||
} // End foreach loop
|
||||
|
||||
|
@@ -510,6 +510,28 @@ function booking_token_info() {
|
||||
'name' => t('Travel form Link'),
|
||||
'description' => t('Link to the person\'s travel form.')
|
||||
);
|
||||
|
||||
$info['types']['meta-booking'] = array(
|
||||
'name' => t('Meta Booking Tokens'),
|
||||
'description' => t('Sub-tokens for the booking module that are used by other booking module tokens. They will only work in a very limited context.'),
|
||||
'needs-data' => 'booking',
|
||||
);
|
||||
$info['tokens']['meta-booking']['studygroup-descrip'] = array(
|
||||
'name' => t('Study Group Description'),
|
||||
'description' => t('Used in the studygroup-summary token.')
|
||||
);
|
||||
$info['tokens']['meta-booking']['studygroup-weekday'] = array(
|
||||
'name' => t('Study Group Weekday'),
|
||||
'description' => t('Used in the studygroup-summary token.')
|
||||
);
|
||||
$info['tokens']['meta-booking']['studygroup-explan'] = array(
|
||||
'name' => t('Study Group Explanation'),
|
||||
'description' => t('Used in the studygroup-summary token.')
|
||||
);
|
||||
$info['tokens']['meta-booking']['studygroup-role'] = array(
|
||||
'name' => t('Study Group Role'),
|
||||
'description' => t('Used in the studygroup-summary token.')
|
||||
);
|
||||
return $info;
|
||||
}
|
||||
|
||||
@@ -542,7 +564,7 @@ function booking_tokens($type, $tokens, array $data = array(), array $options =
|
||||
|
||||
$replacements = array();
|
||||
$sanitize = !empty($options['sanitize']);
|
||||
if ($type == 'booking') {
|
||||
if ($type == 'booking' || $type == 'meta-booking') {
|
||||
foreach ($tokens as $name => $original) {
|
||||
if (array_key_exists($name, $data)) {
|
||||
$replacements[$original] = $data[$name];
|
||||
@@ -646,7 +668,6 @@ function booking_define_personspecific_tokens($node)
|
||||
$tokens['confirm-payment-link'] = url('confirm/' . $tempid, array('absolute' => TRUE));
|
||||
}
|
||||
|
||||
|
||||
//if payment processor is set to manual then don't populate these tokens
|
||||
//if paypal is enabled
|
||||
if ($payment_processor_type == 0) {
|
||||
|
Reference in New Issue
Block a user