You are here

function environment_indicator_get_all in Environment Indicator 7.2

Same name and namespace in other branches
  1. 8.2 environment_indicator.module \environment_indicator_get_all()

Helper function to get all environments.

Parameters

bool $fixed: (optional) If TRUE it will only return fixed environments. Fixed environments are those that do not use a regular expression for detection.

Return value

array Returns all the environments.

5 calls to environment_indicator_get_all()
EnvironmentVariableRealmController::getAllKeys in environment_indicator_variable/class/EnvironmentVariableRealmController.php
Implementation of VariableRealmControllerInterface::getAllKeys().
environment_indicator_get_active in ./environment_indicator.module
Helper function to get the active indicator.
environment_indicator_permission in ./environment_indicator.module
Implements hook_permission().
theme_environment_indicator_indicator_name in ./environment_indicator.theme.inc
Theme function for the indicator name.
_environment_indicator_switcher_menu in ./environment_indicator.module
Helper function to generate a menu with the environments to switch to.

File

./environment_indicator.module, line 483
Module implementation file.

Code

function environment_indicator_get_all($fixed = FALSE) {
  module_load_include('inc', 'ctools', 'includes/export');
  $environments = ctools_export_crud_load_all('environment_indicator_environment');
  $environments = array_filter($environments, '_environment_indicator_active');
  uasort($environments, '_environment_indicator_sort');

  // Check if the regular expression is a environment name.
  return $fixed ? array_filter($environments, '_environment_indicator_regex_filter') : $environments;
}