You are here

function styles_containers in Styles 6

Same name and namespace in other branches
  1. 7 styles.module \styles_containers()

Get an array of all defined style containers.

6 calls to styles_containers()
styles_ui_containers_overview in contrib/styles_ui/includes/styles_ui.admin.inc
Page callback for various styles preset overview listing pages.
styles_ui_help in contrib/styles_ui/styles_ui.module
Implementation of hook_help().
styles_ui_menu in contrib/styles_ui/styles_ui.module
Implementation of hook_menu().
styles_ui_preset_edit_form in contrib/styles_ui/includes/styles_ui.admin.inc
Callback for the preset edit form.
styles_ui_preview_ajax in contrib/styles_ui/includes/styles_ui.admin.inc
Page callback for styles-ui/preview.

... See full list

File

./styles.module, line 61
Bundles similar display formatters together.

Code

function styles_containers() {
  $containers =& _styles_drupal_static(__FUNCTION__);

  // Grab from cache or build the array.
  if (!isset($containers)) {
    if ($cache = cache_get('styles_containers', 'cache')) {
      $containers = $cache->data;
    }
    else {
      module_load_all_includes('inc', 'styles');
      foreach (module_implements('styles_containers') as $module) {
        $module_containers = module_invoke($module, 'styles_containers');
        foreach ($module_containers as $field_type => $field_container) {
          foreach ($field_container['containers'] as $container_name => $container) {
            $container['name'] = $container_name;
            $container['module'] = $module;
            $container['available styles'] = styles_containers_available_styles($field_type, $container_name);
            $containers[$field_type]['containers'][$container_name] = $container;
          }
        }
      }
      drupal_alter('styles_containers', $containers);
      foreach ($containers as $field_type => $container) {

        // Sort the containers by weight.
        uasort($containers[$field_type]['containers'], 'styles_uasort');
      }
      cache_set('styles_containers', $containers);
    }
  }
  return $containers;
}