Commit 587f8d24 authored by tim.plunkett's avatar tim.plunkett

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

parent faa795e8
......@@ -29,7 +29,9 @@ public function getDefinitions() {
$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'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment