You are here

function registration_get_states_options in Entity Registration 7

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.2 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

5 calls to registration_get_states_options()
RegistrationViewsHandlerStateEdit::views_form in modules/registration_views/registration_views.module
Add to and alter the 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.
registration_views_set_state_action_views_bulk_operations_form in modules/registration_views/registration_views.module
Implements hook_views_bulk_operation_form().
1 string reference to 'registration_get_states_options'
RegistrationMetadataController::entityPropertyInfo in lib/registration.metadata.inc

File

./registration.module, line 1721

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()] = t('@state', array(
      '@state' => entity_label('registration_state', $state),
    ));
  }
  return $options;
}