Allow plugins to specify a module, and check for module_exists().

8.0.x
Tim Plunkett 2012-08-13 20:15:48 -04:00
parent faa795e8d5
commit 587f8d24d2
2 changed files with 8 additions and 1 deletions

View File

@ -29,7 +29,9 @@ class ViewsDiscovery extends AnnotatedClassDiscovery {
$theme_file = "$module.views.inc";
}
$definition['module'] = $module_dir;
if (!isset($definition['module'])) {
$definition['module'] = $module_dir;
}
if (!isset($definition['theme path'])) {
$definition['theme path'] = $theme_path;
}

View File

@ -1336,6 +1336,11 @@ function views_fetch_plugin_names($type, $key = NULL, $base = array()) {
if ($key && (empty($plugin['type']) || $plugin['type'] != $key)) {
continue;
}
// @todo While Views is providing on behalf of core modules, check to see
// if they are enabled or not.
if (isset($plugin['module']) && !module_exists($plugin['module'])) {
continue;
}
if (empty($plugin['no ui']) && (empty($base) || empty($plugin['base']) || array_intersect($base, $plugin['base']))) {
$plugins[$id] = $plugin['title'];