You are here

function registration_get_states_options in Entity Registration 7.2

Same name and namespace in other branches
  1. 8.2 registration.module \registration_get_states_options()
  2. 8 registration.module \registration_get_states_options()
  3. 7 registration.module \registration_get_states_options()

Get an array of states structured as options for a form select elements

Parameters

array $conditions:

Return value

array

6 calls to registration_get_states_options()
RegistrationViewsHandlerStateEdit::views_form in modules/registration_views/registration_views.module
Add to and alter the form.
registration_checkin_state_form in modules/registration_checkin/registration_checkin.module
Form builder for the checkin state AJAX form.
registration_form in includes/registration.forms.inc
Form callback: create or edit a registration.
registration_type_form in includes/registration_type.admin.inc
Generates the model type editing form.
registration_views_set_state_action_form in modules/registration_views/registration_views.module
Per-action form for executing a bulk operation.

... See full list

1 string reference to 'registration_get_states_options'
RegistrationMetadataController::entityPropertyInfo in lib/registration.metadata.inc

File

./registration.module, line 1788

Code

function registration_get_states_options($conditions = array()) {
  $options = array();

  // Rules likes to pass an object as the first param in an option list callback. Get rid of it.
  if (!is_array($conditions)) {
    $conditions = array();
  }
  $states = registration_states($conditions);
  foreach ($states as $state) {
    $options[$state
      ->identifier()] = entity_label('registration_state', $state);
  }
  return $options;
}