Allow plugins to specify a module, and check for module_exists().
parent
faa795e8d5
commit
587f8d24d2
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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'];
|
||||
|
|
|
|||
Loading…
Reference in New Issue