*/ 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_googleplusone extends DokuWiki_Action_Plugin { /** * return some info */ function getInfo() { return confToHash( dirname(__FILE__).'/INFO.txt' ); } /* * plugin should use this method to register its handlers with the dokuwiki's event controller */ function register(&$controller) { $controller->register_hook( 'JQUERY_READY', 'BEFORE', $this, '_addjs' ); $controller->register_hook( 'TPL_METAHEADER_OUTPUT', 'BEFORE', $this, '_addscript' ); } function _addjs(&$event, $param) { global $ID; $event->data[] = 'jQuery( \'DIV.pagename\' ).append( \'
\' );'; } function _addscript( &$event, $param ) { $event->data['script'][] = array( 'type' => 'text/javascript', 'charset' => 'utf-8', '_data' => '{lang: \'en\'}', 'src' => 'https://apis.google.com/js/plusone.js', ); } }