You are here

function uc_order_condition_user_roles_form in Ubercart 6.2

See also

uc_order_condition_user_roles()

File

uc_order/uc_order.ca.inc, line 1102
This file contains the Conditional Actions hooks and functions necessary to make the order related entity, conditions, events, and actions work.

Code

function uc_order_condition_user_roles_form($form_state, $settings = array()) {
  $form['operator'] = array(
    '#type' => 'radios',
    '#title' => t('Operator'),
    '#description' => t('If you use an <em>AND</em> case and want to check a custom role, make sure <em>authenticated user</em> is checked too or the condition will return FALSE.'),
    '#options' => array(
      'AND' => t('AND: If the user has all of these roles.'),
      'OR' => t('OR: If the user has any of these roles.'),
    ),
    '#default_value' => isset($settings['operator']) ? $settings['operator'] : 'AND',
  );
  $form['roles'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Roles'),
    '#options' => user_roles(),
    '#default_value' => isset($settings['roles']) ? $settings['roles'] : array(),
  );
  return $form;
}