function views_fetch_plugin_names in Views (for Drupal 7) 7.3
Same name and namespace in other branches
- 8.3 views.module \views_fetch_plugin_names()
- 6.3 includes/admin.inc \views_fetch_plugin_names()
- 6.2 includes/admin.inc \views_fetch_plugin_names()
Fetch a list of all base tables available.
Parameters
string $type: Either 'display', 'style' or 'row'.
string $key: For style plugins, this is an optional type to restrict to. May be 'normal', 'summary', 'feed' or others based on the needs of the display.
array $base: An array of possible base tables.
Return value
array A keyed array of in the form of 'base_table' => 'Description'.
8 calls to views_fetch_plugin_names()
- ViewsUiBaseViewsWizard::build_form in plugins/
views_wizard/ views_ui_base_views_wizard.class.php - For AJAX callbacks to build other elements in the "show" form.
- ViewsUiBaseViewsWizard::row_style_options in plugins/
views_wizard/ views_ui_base_views_wizard.class.php - Add possible row style options.
- views_get_enabled_display_extenders in includes/
plugins.inc - Get enabled display extenders.
- views_plugin_display::options_form in plugins/
views_plugin_display.inc - Provide the default form for setting options.
- views_plugin_display_feed::init in plugins/
views_plugin_display_feed.inc
File
- ./
views.module, line 1448 - Primarily Drupal hooks and global API functions to manipulate views.
Code
function views_fetch_plugin_names($type, $key = NULL, $base = array()) {
$data = views_fetch_plugin_data();
$plugins[$type] = array();
foreach ($data[$type] as $id => $plugin) {
// Skip plugins that don't conform to our key.
if ($key && (empty($plugin['type']) || $plugin['type'] != $key)) {
continue;
}
if (empty($plugin['no ui']) && (empty($base) || empty($plugin['base']) || array_intersect($base, $plugin['base']))) {
$plugins[$type][$id] = $plugin['title'];
}
}
if (!empty($plugins[$type])) {
asort($plugins[$type]);
return $plugins[$type];
}
// Fall-through.
return array();
}