/plugins/content_types directory for .inc plugin files. if ($owner == 'ctools' && $plugin_type == 'content_types') { return 'plugins/content_types'; } // Form 2 - if your module implements only Panels plugins, and has 'layouts' // and 'styles' plugins but no 'cache' or 'display_renderers', it is OK to be // lazy and return a directory for a plugin you don't actually implement (so // long as that directory doesn't exist). This lets you avoid ugly in_array() // logic in your conditional, and also makes it easy to add plugins of those // types later without having to change this hook implementation. if ($owner == 'panels') { return "plugins/$plugin_type"; } // Form 3 - CTools makes no assumptions about where your plugins are located, // so you still have to implement this hook even for plugins created by your // own module. if ($owner == 'mymodule') { // Yes, this is exactly like Form 2 - just a different reasoning for it. return "plugins/$plugin_type"; } // Finally, if nothing matches, it's safe to return nothing at all (or NULL). } /** * Alter a plugin before it has been processed. * * This hook is useful for altering flags or other information that will be * used or possibly overriden by the process hook if defined. * * @param $plugin * An associative array defining a plugin. * @param $info * An associative array of plugin type info. */ function hook_ctools_plugin_pre_alter(&$plugin, &$info) { // Override a function defined by the plugin. if ($info['type'] == 'my_type') { $plugin['my_flag'] = 'new_value'; } } /** * Alter a plugin after it has been processed. * * This hook is useful for overriding the final values for a plugin after it * has been processed. * * @param $plugin * An associative array defining a plugin. * @param $info * An associative array of plugin type info. */ function hook_ctools_plugin_post_alter(&$plugin, &$info) { // Override a function defined by the plugin. if ($info['type'] == 'my_type') { $plugin['my_function'] = 'new_function'; } } /** * Alter the available functions to be used in ctools math expression api. * * One usecase would be to create your own function in your module and * allow to use it in the math expression api. * * @param $functions * An array which has the functions as value. */ function hook_ctools_math_expression_functions_alter(&$functions) { // Allow to convert from degrees to radiant. $functions[] = 'deg2rad'; } /** * @} End of "addtogroup hooks". */