Documentation about the Chaos Tools plugin system:
Currently some scribbled notes to provide a framework for fleshing this out.
ctools_load_include('plugins');
hook_ctools_plugin_plugintype
'defaults'
'cache'
ctools_get_plugins($module, $type, [$id])
best practice: provide a wrapper to make it easier. ex: panels_get_content_type() and panels_get_content_types()
Plugins are primarily just an array of data that describes the plugin. This can be used
to provide printable data as well as function callbacks. Never make assumptions about
hook names.
Document your plugins!
You really need to document what the data returned in the hook in the .inc file
will be or nobody will figure it out. Use advanced help and document it there.
Automatically filled in data:
name
module
path
file
Use of hook_ctools_plugin_TYPE to define info about your plugin.
$info += array(
'module' => $module,
'type' => $type,
'cache' => FALSE,
'defaults' => array(),
'hook' => $module . '_' . $type,
);
General feature for callbacks:
either 'function_name' or
array(
'file' => 'filename',
'path' => 'filepath', // optional
'function' => 'function_name'
),
Using ctools_plugin_get_function() or ctools_plugin_load_function() will take advantage.