function ctools_plugin_get_directories
Get a list of directories to search for plugins of the given type.
This utilizes hook_ctools_plugin_directory() to determine a complete list of directories. Only modules that implement this hook and return a string value will have their directories included.
Parameters
$info: The $info array for the plugin as returned by ctools_plugin_get_info().
Return value
array An array of directories to search.
1 call to ctools_plugin_get_directories()
- ctools_plugin_load_includes in includes/
plugins.inc - Load plugins from a directory.
File
-
includes/
plugins.inc, line 521
Code
function ctools_plugin_get_directories($info) {
$directories = array();
foreach (module_implements('ctools_plugin_directory') as $module) {
$function = $module . '_ctools_plugin_directory';
$result = $function($info['module'], $info['type']);
if ($result && is_string($result)) {
$directories[$module] = drupal_get_path('module', $module) . '/' . $result;
}
}
if (!empty($info['load themes'])) {
$themes = _ctools_list_themes();
foreach ($themes as $name => $theme) {
if (!empty($theme->info['plugins'][$info['module']][$info['type']])) {
$directories[$name] = drupal_get_path('theme', $name) . '/' . $theme->info['plugins'][$info['module']][$info['type']];
}
}
}
return $directories;
}