update
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
$header_links = json_decode(variable_get('booking_mailtemplate_header_links'), TRUE);
|
||||
$social_links = json_decode(variable_get('booking_mailtemplate_social_links'), TRUE);
|
||||
|
||||
watchdog('booking_debug', "<pre>Mail template navigation links\n@info</pre>", array('@info' => print_r($header_links, true)));
|
||||
|
||||
/*
|
||||
//query for existing header links
|
||||
$query = db_select('booking_mailtemplate_fields', 'm');
|
||||
@@ -62,6 +64,14 @@
|
||||
'#maxlength' => 50,
|
||||
'#default_value' => empty($colors['booking_mailtemplate_header_background_color']) ? '#FFFFFF' : $colors['booking_mailtemplate_header_background_color'],
|
||||
);
|
||||
$form['colors']['booking_mailtemplate_navigation_background_color'] = array (
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Navigation links area Background Colour'),
|
||||
'#description' => t('Specify CSS compatible value'),
|
||||
'#size' => 10,
|
||||
'#maxlength' => 50,
|
||||
'#default_value' => empty($colors['booking_mailtemplate_navigation_background_color']) ? '#FFFFFF' : $colors['booking_mailtemplate_navigation_background_color'],
|
||||
);
|
||||
$form['colors']['booking_mailtemplate_text_color'] = array (
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Text Colour'),
|
||||
@@ -98,7 +108,7 @@
|
||||
|
||||
$form['header-links'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => 'Header Links',
|
||||
'#title' => 'Navigation Header Links',
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
@@ -109,14 +119,14 @@
|
||||
$header_link_url = 'booking_mailtemplate_headerlink_url' . $i;
|
||||
$form['header-links'][$header_link_text] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Display text for header link ' . $i),
|
||||
'#title' => t('Display text for navigation header link ' . $i),
|
||||
'#size' => 150,
|
||||
'#maxlength' => 300,
|
||||
'#default_value' => variable_get($header_link_text,'Link Title'),
|
||||
);
|
||||
$form['header-links'][$header_link_url] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('URL for header link ' . $i),
|
||||
'#title' => t('URL for navigation header link ' . $i),
|
||||
'#size' => 150,
|
||||
'#maxlength' => 500,
|
||||
'#default_value' => variable_get($header_link_url, $GLOBALS['base_url']),
|
||||
@@ -177,6 +187,7 @@ function booking_mailtemplate_form_submit($form, &$form_state)
|
||||
global $event;
|
||||
$values = $form_state['input'];
|
||||
$colors_variable_list = array('booking_mailtemplate_background_color', 'booking_mailtemplate_content_background_color',
|
||||
'booking_mailtemplate_navigation_background_color',
|
||||
'booking_mailtemplate_header_background_color', 'booking_mailtemplate_text_color', 'booking_mailtemplate_link_color',
|
||||
);
|
||||
$header_links_variable_list = array();
|
||||
@@ -192,10 +203,22 @@ function booking_mailtemplate_form_submit($form, &$form_state)
|
||||
if (in_array($key, $colors_variable_list, FALSE)) {
|
||||
//variable_set($key, $value);
|
||||
$color_data[$key] = $value;
|
||||
}
|
||||
}
|
||||
elseif (strpos($key, "booking_mailtemplate_headerlink") === 0) {
|
||||
//get the ID for this header navigation link
|
||||
preg_match("/.*(\d+)$/", $key, $matches);
|
||||
$id = $matches[1];
|
||||
$header_data[$id] = array(
|
||||
'text' => $values['booking_mailtemplate_headerlink_text' . $id],
|
||||
'link' => $values['booking_mailtemplate_headerlink_url' . $id],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
watchdog('booking_debug', "<pre>Mail template navigation links\n@info</pre>", array('@info' => print_r($header_data, true)));
|
||||
|
||||
variable_set('booking_mailtemplate_colors', json_encode($color_data));
|
||||
//variable_set('booking_mailtemplate_header_links', json_encode($header_data));
|
||||
|
||||
//update header links
|
||||
|
||||
|
Reference in New Issue
Block a user