Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feeds
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
feeds
Commits
6ae99788
Commit
6ae99788
authored
15 years ago
by
Alex Barth
Browse files
Options
Downloads
Patches
Plain Diff
Document the plugin API, separate api.php into sections.
parent
d182bfe6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
feeds.api.php
+84
-1
84 additions, 1 deletion
feeds.api.php
with
84 additions
and
1 deletion
feeds.api.php
+
84
−
1
View file @
6ae99788
...
...
@@ -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".
*/
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment