You are here

function ctools_plugin_get_info in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 includes/plugins.inc \ctools_plugin_get_info()

Ask a module for info about a particular plugin type.

3 calls to ctools_plugin_get_info()
ctools_get_plugins in includes/plugins.inc
Fetch a group of plugins by name.
ctools_plugin_get_class in includes/plugins.inc
Get a class from a plugin, if it exists. If the plugin is not already loaded, try ctools_plugin_load_class() instead.
ctools_plugin_get_function in includes/plugins.inc
Get a function from a plugin, if it exists. If the plugin is not already loaded, try ctools_plugin_load_function() instead.

File

includes/plugins.inc, line 630
Contains routines to organize and load plugins. It allows a special variation of the hook system so that plugins can be kept in separate .inc files, and can be either loaded all at once or loaded only when necessary.

Code

function ctools_plugin_get_info($module, $type) {
  $info = array();
  $function = $module . '_ctools_plugin_' . $type;
  if (function_exists($function)) {
    $info = $function();
  }

  // Apply defaults. Array addition will not overwrite pre-existing keys.
  $info += array(
    'module' => $module,
    'type' => $type,
    'cache' => FALSE,
    'cache table' => 'cache',
    'use hooks' => TRUE,
    // TODO will default to FALSE in next major version
    'defaults' => array(),
    'process' => '',
    'extension' => 'inc',
    'info file' => FALSE,
    'hook' => $module . '_' . $type,
    'load themes' => FALSE,
  );
  return $info;
}