function views_ui_get_wizard

3.x views_ui.module views_ui_get_wizard($wizard_type)

Fetch metadata on a specific views ui wizard plugin.

Parameters

$wizard_type: Name of a wizard, or name of a base table.

Return value

An array with information about the requested wizard type.

1 call to views_ui_get_wizard()
views_ui_wizard_form_validate in includes/admin.inc
Validate the add view form.

File

./views_ui.module, line 556
Provide structure for the administrative interface to Views.

Code

function views_ui_get_wizard($wizard_type) {
  ctools_include('plugins');
  $wizard = ctools_get_plugins('views_ui', 'views_wizard', $wizard_type);
  // @todo - handle this via an alter hook instead.
  if (!$wizard) {
    // Must be a base table using the default wizard plugin.
    $base_tables = views_fetch_base_tables();
    if (!empty($base_tables[$wizard_type])) {
      $wizard = views_ui_views_wizard_defaults();
      $wizard['base_table'] = $wizard_type;
      $wizard['title'] = $base_tables[$wizard_type]['title'];
    }
    // The plugin is neither a base table nor an existing wizard.
    else {
      vpr('Views Wizard: @wizard does not exist. Be sure to implement hook_ctools_plugin_directory.', array('@wizard' => $wizard_type));
    }
  }
  return $wizard;
}