You are here

function _environment_state_options_all in Environment 7

Same name and namespace in other branches
  1. 6 environment.module \_environment_state_options_all()

Build an options widget with all workflows.

Options do not need namespacing because environment machine name is unique. If the same environment needs to come up in multiple places, that should be handled by duplicating the definition and changing the machine name.

Parameters

bool $reset: Optional; reset the static cache.

Return value

array Options widget.

See also

hook_environment

1 call to _environment_state_options_all()
environment_context_condition::condition_values in modules/environment_context/plugins/environment_context_condition.inc
Override for context_condition::condition_values().

File

./environment.module, line 322
Module for handling changes in server environments

Code

function _environment_state_options_all($reset = FALSE) {
  $options = array();
  $workflows = environment_load_workflow();
  foreach ($workflows as $name => $workflow) {
    $options[$name] = $workflow['label'];
    $w_opts = _environment_state_options($name, TRUE, '-- ', $reset);
    $options = array_merge($options, $w_opts);
  }
  return $options;
}