You are here

function rules_condition_user_hasrole_form in Rules 6

Condition User: form to select roles to check for

Related topics

File

rules/modules/user.rules_forms.inc, line 14
Rules configuration forms for the user module

Code

function rules_condition_user_hasrole_form($settings, &$form) {
  $form['settings'] += _rules_user_form_roles($settings, FALSE);
  $form['settings']['operation'] = array(
    '#type' => 'select',
    '#title' => t('Match against any or all of the selected roles'),
    '#options' => array(
      'OR' => t('any'),
      'AND' => t('all'),
    ),
    '#description' => t('If matching against all selected roles the user must have <em>all</em> the roles checked in the list above.'),
    '#default_value' => isset($settings['operation']) ? $settings['operation'] : 'OR',
  );
}