To implement plugins, you need to implement a single hook in your module to tell the system where your plugins live, and then you need to implement one or more .inc files that contain the plugin data.
function hook_ctools_plugin_directory($module, $plugin) { if ($module == 'panels' && $plugin == 'content_types') { return 'plugins/content_types'; } }The directory returned should be relative to your module. Another common usage is to simply return that you implement all plugins owned by a given module (or modules):
function hook_ctools_plugin_directory($module, $plugin) { if ($module == 'panels') { return 'plugins/' . $plugin; } }Typically, it is recommended that all plugins be placed into the 'plugins' directory for clarity and maintainability. Inside the directory, any number of subdirectories can be used. For plugins that require extra files, such as templates, css, javascript or image files, this is highly recommended:
mymodule.module mymodule.info plugins/ content_types/ my_content_type.inc layouts/ my_layout.inc my_laout.css my_layout.tpl.php my_layout_image.png
plugins[module][type] = directory
$plugin = array( 'key' => 'value', );Several values will be filled in for you automatically, but you can override them if necessary. They include 'name', 'path', 'file' and 'module'. Additionally, the plugin can owner can provide other defaults as well. After this array, if your plugin needs functions, they can be declared. Different plugin types have different needs here, so exactly what else will be needed will change from type to type.