id = $id; $this->kvstorage = new PluginKVStorage($id); $this->smarty = $smarty; } /* * Functions: Some getters * * get_id - get the Plugin-ID * get_additional_files_dir - Path to directory with the additional files * get_template_dir - Path to template directory */ final public function get_id() { return $this->id; } final protected function get_additional_files_dir() { return dirname(dirname(__FILE__)) . "/plugin_extradata/" . $this->id; } final protected function get_template_dir() { return dirname(dirname(__FILE__)) . "/templates/plugintemplates/" . $this->id; } /* * Function: register_url_handler * Easy way for register a URL handler * * Parameters: * $name - Name of URL * $objfunction - Name of object function. */ final protected function register_url_handler($name, $objfunction) { register_url_handler($name, array($this, $objfunction)); } final protected function register_settings_page($get, $validate, $set, $structure) /* * Functions: Functions that are called at special events * * init - Will be called after plugin is loaded. You should register your stuff here. * install - Will be called after installation. If your plugin needs to initialize some database stuff or generate files, this is the right function. * uninstall - Will be called during uninstallation. If you used the install function you should undo your custom installation stuff. */ public function init() {} public function install() {} public function uninstall() {} } $url_handlers = array(); /* * Function: register_url_handler * Register an URL handler. See for more details. * * Parameters: * $name - The name of the new URL * $callback - The Function to be called (see ). */ function register_url_handler($name, $callback) { global $url_handlers; $url_handlers[$name] = $callback; } ?>