function _simple_cookie_compliance_settings_form in Simple Cookie Compliance 7
Same name and namespace in other branches
- 6 simple_cookie_compliance.module \_simple_cookie_compliance_settings_form()
Custom form function.
1 string reference to '_simple_cookie_compliance_settings_form'
- simple_cookie_compliance_menu in ./
simple_cookie_compliance.module - Implements hook_menu().
File
- ./
simple_cookie_compliance.module, line 140 - All the necessary functions for configuring and output.
Code
function _simple_cookie_compliance_settings_form() {
$languages = language_list();
// Cookie expiration.
$form = array();
$default_expiration_time = _simple_cookie_compliance_default_expiration_time();
$form['simple_cookie_compliance_expiration_time'] = array(
'#type' => 'textfield',
'#title' => t('Expiration time'),
'#description' => t('The time it will take to expire the cookie in seconds. Default value is equal to three months.'),
'#default_value' => variable_get('simple_cookie_compliance_expiration_time', $default_expiration_time),
'#required' => TRUE,
);
foreach ($languages as $language) {
if ($language->enabled) {
// Field group per language.
$form['language_' . $language->language] = array(
'#type' => 'fieldset',
'#title' => check_plain($language->name),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
// Text setting for message.
$message = variable_get('simple_cookie_compliance_content_' . $language->language);
if (empty($message)) {
$message['value'] = t('This website uses cookies to help us give you the best experience when you visit our website. By continuing to use this website, you consent to our use of these cookies.');
}
$form['language_' . $language->language]['simple_cookie_compliance_content_' . $language->language] = array(
'#type' => 'text_format',
'#format' => 'full_html',
'#title' => t('Message'),
'#default_value' => $message['value'],
'#required' => TRUE,
);
// Text setting for agree button.
$form['language_' . $language->language]['simple_cookie_compliance_button_agree_' . $language->language] = array(
'#type' => 'textfield',
'#title' => t('Agree button'),
'#default_value' => variable_get('simple_cookie_compliance_button_agree_' . $language->language, t('OK')),
'#required' => TRUE,
);
}
}
return system_settings_form($form);
}