You are here

function _views_get_style_plugins in Views (for Drupal 7) 5

Return the style plugins; construct one if we haven't already. The array is cached in a static variable so that arguments are only constructed once per run.

6 calls to _views_get_style_plugins()
theme_views_view in ./views.module
Display a view.
views_edit_view in ./views_ui.module
Display all the guts of a view in a form for editing.
views_edit_view_validate in ./views_ui.module
Validate that a view sent via form is OK.
_views_build_query in ./views_query.inc
_views_get_query in ./views_cache.inc

... See full list

File

./views_cache.inc, line 312

Code

function _views_get_style_plugins($titles = false) {
  static $views_style_plugins;
  global $locale;
  if (!$views_style_plugins) {
    $data = cache_get("views_style_plugins:{$locale}", 'cache_views');
    $cache = unserialize($data->data);
    if (is_array($cache)) {
      $views_style_plugins = $cache;
    }
    else {
      $arguments = module_invoke_all('views_style_plugins');
      uasort($arguments, '_views_sort_arrays');
      foreach ($arguments as $name => $arg) {
        if (!isset($arg['summary_theme'])) {
          $arg['summary_theme'] = 'views_summary';
        }
        $views_style_plugins['title'][$name] = $arg['name'];
        $views_style_plugins['base'][$name] = $arg;
      }
      $cache = $views_style_plugins;
      cache_set("views_style_plugins:{$locale}", 'cache_views', serialize($cache));
    }
  }
  return $titles ? $views_style_plugins['title'] : $views_style_plugins['base'];
}