Skip to content
Snippets Groups Projects
Commit 6ae99788 authored by Alex Barth's avatar Alex Barth
Browse files

Document the plugin API, separate api.php into sections.

parent d182bfe6
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,76 @@
* Doxygen API documentation for hooks invoked by Feeds.
*/
/**
* @defgroup pluginapi Plugin API hooks
* @{
*/
/**
* Example of a CTools plugin hook that needs to be implemented to make
* hook_feeds_plugins() discoverable by CTools and Feeds. The hook specifies
* that the hook_feeds_plugins() returns Feeds Plugin API version 1 style
* plugins.
*/
function hook_ctools_plugin_api($owner, $api) {
if ($owner == 'feeds' && $api == 'plugins') {
return array('version' => 1);
}
}
/**
* A hook_feeds_plugins() declares available Fetcher, Parser or Processor
* plugins to Feeds. For an example look at feeds_feeds_plugin().
*
* @see feeds_feeds_plugin()
*/
function hook_feeds_plugins() {
$info = array();
$info['MyFetcher'] = array(
'name' => 'My Fetcher',
'description' => 'Fetches my stuff.',
'help' => 'More verbose description here. Will be displayed on fetcher selection menu.',
'handler' => array(
'parent' => 'FeedsFetcher',
'class' => 'MyFetcher',
'file' => 'MyFetcher.inc',
'path' => drupal_get_path('module', 'my_module'), // Feeds will look for MyFetcher.inc in the my_module directory.
),
);
$info['MyParser'] = array(
'name' => 'ODK parser',
'description' => 'Parse my stuff.',
'help' => 'More verbose description here. Will be displayed on parser selection menu.',
'handler' => array(
'parent' => 'FeedsParser', // Being directly or indirectly an extension of FeedsParser makes a plugin a parser plugin.
'class' => 'MyParser',
'file' => 'MyParser.inc',
'path' => drupal_get_path('module', 'my_module'),
),
);
$info['MyProcessor'] = array(
'name' => 'ODK parser',
'description' => 'Process my stuff.',
'help' => 'More verbose description here. Will be displayed on processor selection menu.',
'handler' => array(
'parent' => 'FeedsProcessor',
'class' => 'MyProcessor',
'file' => 'MyProcessor.inc',
'path' => drupal_get_path('module', 'my_module'),
),
);
return $info;
}
/**
* @} End of "defgroup pluginapi".
*/
/**
* @defgroup import Import hooks
* @{
*/
/**
* Invoked after a feed source has been imported.
*
......@@ -18,6 +88,15 @@ function hook_feeds_after_import(FeedsImporter $importer, FeedsSource $source) {
// See geotaxonomy module's implementation for an example.
}
/**
* @} End of "defgroup import".
*/
/**
* @defgroup mappingapi Mapping API hooks
* @{
*/
/**
* Alter mapping targets for nodes. Use this hook to add additional target
* options to the mapping form of Node processors.
......@@ -77,4 +156,8 @@ function hook_feeds_data_processor_targets_alter(&$fields, $data_table) {
'description' => t('One or more category terms.'),
);
}
}
\ No newline at end of file
}
/**
* @} End of "defgroup mappingapi".
*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment