From e4e0bf836669b5419a0e2c86409c46898beef5b4 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Wed, 1 Feb 2012 21:47:40 +0100 Subject: Added on_comment_store event. --- ratatoeskr/sys/plugin_api.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'ratatoeskr/sys') diff --git a/ratatoeskr/sys/plugin_api.php b/ratatoeskr/sys/plugin_api.php index 7a80a5b..c592db3 100644 --- a/ratatoeskr/sys/plugin_api.php +++ b/ratatoeskr/sys/plugin_api.php @@ -15,15 +15,15 @@ require_once(dirname(__FILE__) . "/../frontend.php"); /* * Constant: APIVERSION - * The current API version (4). + * The current API version (5). */ -define("APIVERSION", 4); +define("APIVERSION", 5); /* * Array: $api_compat * Array of API versions, this version is compatible to (including itself). */ -$api_compat = array(3, 4); +$api_compat = array(3, 4, 5); $url_handlers = array(); /* @@ -145,7 +145,20 @@ abstract class RatatoeskrPlugin */ final protected function register_comment_validator($fx) { - register_comment_validator($fx); + global $comment_validators; + $comment_validators[] = $fx; + } + /* + * Function: register_on_comment_store + * Register a function that will be called, after a comment was saved. + * + * Parameters: + * $fx - Function, that accepts one parameter (a object). + */ + final protected function register_on_comment_store($fx) + { + global $on_comment_store; + $on_comment_store[] = $fx; } /* -- cgit v1.2.3-54-g00ecf