Plugin API contains the plugin base class and other interfaces to Ratatöskr.
This file is part of Ratatöskr. Ratatöskr is licensed unter the MIT / X11 License. See “ratatoeskr/licenses/ratatoeskr” for more information.
ratatoeskr/ | Plugin API contains the plugin base class and other interfaces to Ratatöskr. |
Constants | |
APIVERSION | The current API version (6). |
Variables | |
$api_compat | Array of API versions, this version is compatible to (including itself). |
Functions | |
register_url_handler | Register an URL handler. |
RatatoeskrPlugin | An abstract class to be extended in order to write your own Plugin. |
Variables | |
Protected variables | |
Functions | |
__construct | Performing some neccessary initialisation stuff. |
get_id | get the Plugin-ID |
get_custompriv_dir | Get path to the custompriv directory of your plugin. |
get_custompub_dir | Get path to the custompub directory of your plugin. |
get_custompub_url | Get URL (can be accessed from the web) to the custompub directory of your plugin. |
get_template_dir | Get path to your template directory to be used with STE. |
register_url_handler | Register a URL handler |
register_ste_tag | Register a custom STE tag. |
register_textprocessor | Register a textprocessor. |
register_comment_validator | Register a comment validator. |
register_on_comment_store | Register a function that will be called, after a comment was saved. |
register_backend_pluginpage | Register a backend subpage for your plugin. |
register_articleeditor_plugin | Register a plugin for the article editor in the backend. |
get_backend_pluginpage_url | Get the URL to your backend plugin page. |
get_article_extradata | Get the ArticleExtradata object for this plugin and the given article. |
prepare_backend_pluginpage | Automatically sets the page title and highlights the menu-entry of your backend subpage. |
init | Will be called after plugin is loaded. |
atexit | Will be called, when Ratatöskr will exit. |
install | Will be called after installation. |
uninstall | Will be called during uninstallation. |
update | Will be called after your plugin was updated to a new version. |
function register_url_handler( $name, $callback )
Register an URL handler. See ratatoeskr/sys/urlprocess.php for more details.
$name | The name of the new URL |
$callback | The Function to be called (see url_process). |
An abstract class to be extended in order to write your own Plugin.
Variables | |
Protected variables | |
Functions | |
__construct | Performing some neccessary initialisation stuff. |
get_id | get the Plugin-ID |
get_custompriv_dir | Get path to the custompriv directory of your plugin. |
get_custompub_dir | Get path to the custompub directory of your plugin. |
get_custompub_url | Get URL (can be accessed from the web) to the custompub directory of your plugin. |
get_template_dir | Get path to your template directory to be used with STE. |
register_url_handler | Register a URL handler |
register_ste_tag | Register a custom STE tag. |
register_textprocessor | Register a textprocessor. |
register_comment_validator | Register a comment validator. |
register_on_comment_store | Register a function that will be called, after a comment was saved. |
register_backend_pluginpage | Register a backend subpage for your plugin. |
register_articleeditor_plugin | Register a plugin for the article editor in the backend. |
get_backend_pluginpage_url | Get the URL to your backend plugin page. |
get_article_extradata | Get the ArticleExtradata object for this plugin and the given article. |
prepare_backend_pluginpage | Automatically sets the page title and highlights the menu-entry of your backend subpage. |
init | Will be called after plugin is loaded. |
atexit | Will be called, when Ratatöskr will exit. |
install | Will be called after installation. |
uninstall | Will be called during uninstallation. |
update | Will be called after your plugin was updated to a new version. |
final protected function register_textprocessor( $name, $fx, $visible_in_backend = True )
Register a textprocessor.
$name | The name of the textprocessor- |
$fx | Function to register (function($input), returns HTML). |
$visible_in_backend | Should this textprocessor be visible in the backend? Defaults to True. |
final protected function register_comment_validator( $fx )
Register a comment validator.
A comment validator is a function, that checks the $_POST fields and decides whether a comment should be stored or not (throws an CommentRejected exception with the rejection reason as the message).
$fx | Validator function. |
final protected function register_on_comment_store( $fx )
Register a function that will be called, after a comment was saved.
$fx | Function, that accepts one parameter (a Comment object). |
final protected function register_backend_pluginpage( $label, $fx )
Register a backend subpage for your plugin.
$label | The label for the page. |
$fx | A function for url_process. |
Your $fx should output output the result of a STE template, which should load “/systemtemplates/master.html” and overwrite the “content” section.
If you need a URL to your pluginpage, you can use get_backend_pluginpage_url and the STE variable $rel_path_to_pluginpage.
final protected function register_articleeditor_plugin( $label, $fx, $template )
Register a plugin for the article editor in the backend.
$label | The label for the plugin. |
$fx | A function that will be called during the articleeditor. This function must accept these parameters: |
$template | The name of the template to display in the editor, relative to your template directory. If you do not want to display anything, you can set ths to NULL. |
final protected function get_article_extradata( $article )
Get the ArticleExtradata object for this plugin and the given article.
$article | An Article object. |
An ArticleExtradata object for this plugin and the given article.
Array of API versions, this version is compatible to (including itself).
$api_compat
Register an URL handler.
function register_url_handler( $name, $callback )
Performing some neccessary initialisation stuff.
public function __construct( $id )
Register a URL handler
final protected function register_url_handler( $name, $fx )
Register a custom STE tag.
final protected function register_ste_tag( $name, $fx )
Register a textprocessor.
final protected function register_textprocessor( $name, $fx, $visible_in_backend = True )
Register a comment validator.
final protected function register_comment_validator( $fx )
Register a function that will be called, after a comment was saved.
final protected function register_on_comment_store( $fx )
Register a backend subpage for your plugin.
final protected function register_backend_pluginpage( $label, $fx )
Register a plugin for the article editor in the backend.
final protected function register_articleeditor_plugin( $label, $fx, $template )
Get the URL to your backend plugin page.
final protected function get_backend_pluginpage_url()
Get the ArticleExtradata object for this plugin and the given article.
final protected function get_article_extradata( $article )
Automatically sets the page title and highlights the menu-entry of your backend subpage.
final protected function prepare_backend_pluginpage()
Choose an appropiate action for the given URL.
function url_process( $url, $actions, & $data )