function ca_condition_user_roles_form in Ubercart 6.2
See also
1 call to ca_condition_user_roles_form()
- uc_roles_condition_role_form in uc_roles/
uc_roles.ca.inc - Settings form for checking the role being granted.
File
- ca/
ca.ca.inc, line 428 - This file includes some generic conditions and actions.
Code
function ca_condition_user_roles_form($form_state, $settings = array()) {
$form['operator'] = array(
'#type' => 'radios',
'#title' => t('Operator'),
'#description' => t('If you specify <em>AND</em> and want to check a custom role, remember to specify <em>authenticated user</em> where applicable.'),
'#options' => array(
'OR' => t('OR: If the user has any of these roles.'),
'AND' => t('AND: If the user has all of these roles.'),
),
'#default_value' => isset($settings['operator']) ? $settings['operator'] : 'OR',
);
$form['roles'] = array(
'#type' => 'checkboxes',
'#title' => t('Roles'),
'#options' => user_roles(),
'#default_value' => isset($settings['roles']) ? $settings['roles'] : array(),
);
return $form;
}