Plugin Hooks

From GregariusWiki

Jump to: navigation, search

Contents

[edit] rss.plugins.admin.activate

Input parameter
null
Returned parameter
null
Description
Called by the admin interface when the plugin is activated. (This hook will be provided in 0.5.3 soon)
Sample plugins using this hook

[edit] rss.plugins.admin.deactivate

Input parameter
null
Returned parameter
null
Description
Called by the admin interface when the plugin is deactivated. (this hook will be provided in 0.5.3 soon)
Sample plugins using this hook

[edit] rss.plugins.afternav

Input parameter
null
Returned parameter
String
Description
Called right after the top navigation links. Prints out the returned string.
Sample plugins using this hook

[edit] rss.plugins.ajax.admindlg

Input parameter
null
Returned parameter
String
Description
Allows the plugin author to extend the item properties editing dialog. Prints out the returned string.
Sample plugins using this hook

[edit] rss.plugins.ajax.admindlg.oncancel

Input parameter
null
Returned parameter
String (javascript code)
Description
Allows the plugin author to override the javascript function to be called when the user cancels the item editing action.


[edit] rss.plugins.ajax.admindlg.onok

Input parameter
null
Returned parameter
String (javascript code)
Description
Allows the plugin author to override the javascript function to be called when the user submits the item editing action.
Sample plugins using this hook


[edit] rss.plugins.ajax.exports

Input parameter
array (exported function names)
Returned parameter
array (exported function names)
Description
Extends the list of PHP functions whose interfaces are to be exported as AJAX functions. The input parameter must be returned.

[edit] rss.plugins.ajax.extrajs.edittag

Input parameter
null
Returned parameter
null
Description
Called when the user clicks the 'edit tag' link. Allows to inject extra Javascript.
Sample plugins using this hook

  • del.icio.us Tags


[edit] rss.plugins.ajax.extrajs.private

Input parameter
null
Returned parameter
String (javascript code)
Description
AJAX-related javascript functions. Prints out the returned javascript code in ajax.php?js if the Administrator cookie is set.

[edit] rss.plugins.ajax.extrajs.public

Input parameter
null
Returned parameter
String (javascript code)
Description
AJAX-related javascript functions. Prints out the returned javascript code in ajax.php?js regardless of the Administrator cookie.

[edit] rss.plugins.before.mainobject

Input parameter
null
Returned parameter
null
Description
Called immediately the mainobject is rendered.
Sample plugins using this hook

  • Slider

[edit] rss.plugins.bodyend

Input parameter
null
Returned parameter
String (html code)
Description
Prints out the returned html code right before the closing </body> tag. Can be used to inject generic javascript code.
Sample plugins using this hook


[edit] rss.plugins.bodystart

Input parameter
null
Returned parameter
null
Description
Called before any HTML content is sent to the browser. If your plugins requires to set any HTTP headers, it should do so here.
Sample plugins using this hook

[edit] rss.plugins.feed.new

Input parameter
array($title,$urlDB,$siteurl,$folderid,$descr,$icon)
Returned parameter
array($title,$urlDB,$siteurl,$folderid,$descr,$icon)
Description
Array containing a new Feed, right before it is inserted into the database

[edit] rss.plugins.feeds.after

Input parameter
null
Returned parameter
null
Description
Called right after the Feeds in the sidecolumn have been rendered

[edit] rss.plugins.footer.span

Input parameter
null
Returned parameter
String (to be printed)
Description
Allows plugin authors to insert text into the page footer. Note: the returned markup should be enclosed in "span" tags.
Sample plugins using this hook

[edit] rss.plugins.import.description

Input parameter
String (item content)
Returned parameter
String (item content)
Description
This hook allows plugin authors to edit the description of items as they were extracted from the RSS feeds.
Sample plugins using this hook

  • Url filter
  • Tidy HTML filter
  • HTML filter

[edit] rss.plugins.items.afteritems

Input parameter
null
Returned parameter
null
Description
Called immediately after all items are displayed in the browser.
Sample plugins using this hook

  • Extra Button

[edit] rss.plugins.items.beforeitems

Input parameter
null
Returned parameter
null
Description
Called immediately before all items are displayed in the browser.

[edit] rss.plugins.items.beforeitemsimmediate

Input parameter
null
Returned parameter
null
Description
Use this hook to add your own code on the top of every item's list, right after the 'mark items as read' buttons.
Sample plugins using this hook

[edit] rss.plugins.items.beforerender

Input parameter
Item
Returned parameter
Item
Description
Called before items are rendered. Can slow down page rendering significantly.
Sample plugins using this hook

See Also
Ticket #43 (plugin display hooks)

[edit] rss.plugins.items.beforetitle

Input parameter
rss_item_id
Returned parameter
null
Description
Called just before the title of each item is rendered. Can slow down page rendering significantly.

[edit] rss.plugins.items.enclosure

Input parameter
null
Returned parameter
null
Description
Undefined
Sample plugins using this hook

[edit] rss.plugins.items.new

Input parameter
array ($cid, $title, $url, $description)
Returned parameter
array ($cid, $title, $url, $description)
Description
Called when a new item is found in a feed, right before it is inserted into the database. The plugin author can edit the data before the insertion and must return the data as it was passed to the plugin

[edit] rss.plugins.items.newiid

Input parameter
array($newIid,$item,$channelId)
Returned parameter
null
Description
Called right after an item was inserted into the database. The passed parameters are

  • The new item's database id (iid)
  • MagpieRSS item object
  • Gregarius' feed ID this item belongs to

[edit] rss.plugins.items.order

Input parameter
String $sqlOrder
Returned parameter
String $sqlOrder
Description
Allows to override the order (sql-wise) which items as displayed in. (see ItemList::populate())

[edit] rss.plugins.items.updated

Input parameter
array($cid, $iid, $description)
Returned parameter
array($cid, $iid, $description)
Description
Same as #rss.plugins.items.new but called when an item is updated

[edit] rss.plugins.javascript

Input parameter
Array (of URLs of javascript files to include)
Returned parameter
Array (of URLs of javascript files to include)
Description
This plugin hook can be used to append additional javascript resources in the rendered header. The passed array must be returned after the plugin has appended its own javascript resource.
Sample plugins using this hook

  • del.icio.us Tags

[edit] rss.plugins.navelements

Input parameter
null
Returned parameter
null
Description
This plugin hook can be used to append additional buttons to the main navigation section.
Sample plugins using this hook

  • Sticky Button

[edit] rss.plugins.rating.rated

To be completed

[edit] rss.plugins.rssitem

Input parameter
MagpieRSS array $item
Returned parameter
MagpieRSS array $item
Description
Allows to manipulate items as they are being added

[edit] rss.plugins.sidemenu

Input parameter
null
Returned parameter
null
Description
Called right before the sidemenu is rendered

[edit] rss.plugins.stylesheets

Input parameter
null
Returned parameter
null
Description
Called right before the CSS stylesheets are output
Sample plugins using this hook

  • roundedcorners
  • slider

[edit] rss.plugins.updates.before

Input parameter
null
Returned parameter
null
Description
Called right before an update starts
Sample plugins using this hook

[edit] rss.plugins.updates.after

Input parameter
null
Returned parameter
null
Description
Called right after an update ends
Sample plugins using this hook


[edit] Plugin Configuration Hook

Unlike most hooks, this is defined in the Meta-information section. Please see the section entitled "Providing Configuration Options" for more information.

Personal tools
Advertisement