*/ if(!defined('DOKU_INC')) die(); if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); require_once(DOKU_PLUGIN.'action.php'); class action_plugin_example extends DokuWiki_Action_Plugin { /** * return some info */ function getInfo(){ return array( 'author' => 'Me name', 'email' => 'myname@example.org', 'date' => '2006-12-17', 'name' => 'Example (action plugin component)', 'desc' => 'Example action functions.', 'url' => 'http://www.example.org', ); } /** * Register its handlers with the dokuwiki's event controller */ function register(Doku_Event_Handler $controller) { $controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, '_hookjs'); } /** * Hook js script into page headers. * * @author Samuele Tognini */ function _hookjs(&$event, $param) { $event->data["script"][] = array ("type" => "text/javascript", "charset" => "utf-8", "_data" => "", "src" => DOKU_BASE."lib/plugins/example/example.js" ); } }