You are here

function values_load_all in Values 7

Same name and namespace in other branches
  1. 6 values.module \values_load_all()

Loads all value sets.

Return value

An array of all value sets

5 calls to values_load_all()
values_field_form_alter in modules/values_field/values_field.module
Implements hook_form_alter().
values_i18n_string_list in ./values.module
Implements hook_i18n_string_list().
values_sets_page in ./values.module
Displays a list of existing value sets.
values_update_7101 in ./values.install
Reformat values stored in database
values_webform_webform_select_options_info in modules/values_webform/values_webform.module
Implements hook_webform_select_options_info()
1 string reference to 'values_load_all'
values_schema in ./values.install
Implements hook_schema().

File

./values.module, line 825
API for managing reusable value sets.

Code

function values_load_all($reset = FALSE) {
  if (module_exists('ctools')) {

    // Try using Chaos tools suite for exporting and caching
    ctools_include('export');
    $value_sets = ctools_export_load_object('values_sets');
  }
  else {
    $query = db_query('SELECT name FROM {values_sets} ORDER BY title ASC');
    foreach ($query as $record) {
      $value_sets[$record->name] = values_load($record->name, $reset);
    }
  }
  return $value_sets;
}