function views_fetch_plugin_names
Same name in other branches
- 7.x-3.x views.module \views_fetch_plugin_names()
Fetch a list of all base tables available
Parameters
$type: Either 'display', 'style' or 'row'
$key: For style plugins, this is an optional type to restrict to. May be 'normal', 'summary', 'feed' or others based on the neds of the display.
$base: An array of possible base tables.
Return value
A keyed array of in the form of 'base_table' => 'Description'.
4 calls to views_fetch_plugin_names()
- views_plugin_display::options_form in plugins/
views_plugin_display.inc - Provide the default form for setting options.
- views_ui_add_display_form in includes/
admin.inc - Form to add a display to a view.
- views_ui_admin_tools in includes/
admin.inc - Page callback for the tools - other page
- views_ui_change_style_form in includes/
admin.inc - Form to change_style items in the views UI.
File
-
includes/
admin.inc, line 4014
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();
}