[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/ctools/ -> ctools.api.php (summary)

(no description)

File Size: 87 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 function

  hook_ctools_plugin_directory()

Functions
Functions that are not part of a class:

hook_ctools_plugin_directory($owner, $plugin_type)   X-Ref
This hook is used to inform the CTools plugin system about the location of a
directory that should be searched for files containing plugins of a
particular type. CTools invokes this same hook for all plugins, using the
two passed parameters to indicate the specific type of plugin for which it
is searching.

The $plugin_type parameter is self-explanatory - it is the string name of the
plugin type (e.g., Panels' 'layouts' or 'styles'). The $owner parameter is
necessary because CTools internally namespaces plugins by the module that
owns them. This is an extension of Drupal best practices on avoiding global
namespace pollution by prepending your module name to all its functions.
Consequently, it is possible for two different modules to create a plugin
type with exactly the same name and have them operate in harmony. In fact,
this system renders it impossible for modules to encroach on other modules'
plugin namespaces.

Given this namespacing, it is important that implementations of this hook
check BOTH the $owner and $plugin_type parameters before returning a path.
If your module does not implement plugins for the requested module/plugin
combination, it is safe to return nothing at all (or NULL). As a convenience,
it is also safe to return a path that does not exist for plugins your module
does not implement - see form 2 for a use case.

Note that modules implementing a plugin also must implement this hook to
instruct CTools as to the location of the plugins. See form 3 for a use case.

The conventional structure to return is "plugins/$plugin_type" - that is, a
'plugins' subdirectory in your main module directory, with individual
directories contained therein named for the plugin type they contain.

param: string $owner
param: string $plugin_type
return: string



Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7