Difference between revisions of "JReviews Joomla event triggers for use in Joomla plugins"
From JReviews Documentation
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | <div class="successbox" style="width: 95%"> | ||
+ | |||
+ | [https://www.jreviews.com/docs/developers/joomla-plugin-events There's a new version of this article] | ||
+ | |||
+ | </div> | ||
+ | |||
== List of available events == | == List of available events == | ||
+ | |||
+ | === Core Joomla plugin events === | ||
+ | |||
+ | *onContentBeforeSave | ||
+ | *onContentAfterSave | ||
+ | *onContentChangeState | ||
+ | |||
+ | |||
+ | ===JReviews plugin events=== | ||
*onBeforeReviewCommentDelete | *onBeforeReviewCommentDelete | ||
Line 7: | Line 22: | ||
*onBeforeListingDelete | *onBeforeListingDelete | ||
*onAfterListingCreate | *onAfterListingCreate | ||
+ | *onAfterListingUpdate | ||
*onAfterMediaLikeYes | *onAfterMediaLikeYes | ||
*onAfterMediaLikeNo | *onAfterMediaLikeNo | ||
Line 30: | Line 46: | ||
</source> | </source> | ||
− | + | ||
− | + | Download an installable Joomla plugin for JReviews with all event methods in place [https://docs.jreviews.com/downloads/joomla/plugins/plg_jreviews_example.zip plg_jreviews_example.zip] |
Latest revision as of 16:38, 29 July 2020
List of available events
Core Joomla plugin events
- onContentBeforeSave
- onContentAfterSave
- onContentChangeState
JReviews plugin events
- onBeforeReviewCommentDelete
- onAfterReviewCommentCreate
- onAfterFavoriteAdd
- onAfterFavoriteRemove
- onBeforeListingDelete
- onAfterListingCreate
- onAfterListingUpdate
- onAfterMediaLikeYes
- onAfterMediaLikeNo
- onAfterMediaUpload
- onBeforeReviewDelete
- onAfterReviewCreate
- onAfterReviewVoteYes
- onAfterReviewVoteNo
The event class method receives an argument that is an array with useful info related to the object. A simple JReviews Joomla plugin that performs an action after a listing is added to favorites would look like this:
class plgJreviewsExample extends JPlugin { /** * After listing added to favorites * @param array $data array('listing_id','listing','url') */ function onAfterFavoriteAdd($data) { // Your event logic goes here. The $data array contains more information about the listing that was just added to favorites. } }
Download an installable Joomla plugin for JReviews with all event methods in place plg_jreviews_example.zip