function legal_configuration in Legal 7
Same name and namespace in other branches
- 7.2 legal.admin.inc \legal_configuration()
Module configuration options form.
1 string reference to 'legal_configuration'
- legal_menu in ./
legal.module - Implements hook_menu().
File
- ./
legal.admin.inc, line 11 - Administration UI for the Legal module.
Code
function legal_configuration($form_state) {
$form = array();
$form['description'] = array(
'#markup' => '<p>' . t('Configuration options for display of Terms & Conditions.') . '</p>',
);
$form['user_profile_display'] = array(
'#type' => 'checkbox',
'#title' => t('Show T&Cs on user profile edit pages'),
'#default_value' => variable_get('legal_user_profile_display', 1),
);
$form['legal_accept_every_login'] = array(
'#type' => 'checkbox',
'#title' => t('Ask to accept T&Cs on every login'),
'#default_value' => variable_get('legal_accept_every_login', '0'),
);
$form['except_legal'] = array(
'#type' => 'fieldset',
'#title' => t('Exempt User Roles'),
'#description' => t('Users with the selected roles will never be shown T&C.'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$all_roles = array_map('check_plain', user_roles());
$irrelevant_roles = array(
'anonymous user',
'authenticated user',
);
$role_options = array_diff($all_roles, $irrelevant_roles);
$except_roles = variable_get('legal_except_roles', array());
$form['except_legal']['except_roles'] = array(
'#type' => 'checkboxes',
'#title' => t('Exempt user roles'),
'#options' => $role_options,
'#default_value' => $except_roles,
'#description' => t('Do not display Terms and Conditions check box for the selected user roles.'),
);
legal_display_form_element($form);
$form['save'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);
return $form;
}