1<?php 2//AUTHOR James Lin 3//Version 3.0 4 5if (!defined('DOKU_INC')) die(); 6if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/'); 7 8require_once (DOKU_PLUGIN . 'action.php'); 9 10class action_plugin_autoincludeindex extends DokuWiki_Action_Plugin 11{ 12 function _indexMenu(&$event, $param) 13 { 14 if (($_REQUEST['do']=='edit')||($_POST['do']['preview']))return; 15 $event->data = '<div id="autoincludeindex">'.p_render('xhtml',p_get_instructions(file_get_contents(DOKU_PLUGIN.'autoincludeindex/template.tpl')), $info).'</div>'.$event->data.file_get_contents(DOKU_PLUGIN.'autoincludeindex/icondiv.tpl'); 16 } 17 18 function getInfo() 19 { 20 return array 21 ( 22 'name' => 'Sidebar Index Menu', 23 'email' => 'guanfenglin@gmail.com', 24 'date' => '04/12/2008', 25 'author' => 'James GuanFeng Lin', 26 'desc' => 'auto includes index menu to the page', 27 'url' => '' 28 ); 29 } 30 31 function register(&$controller) 32 { 33 $controller->register_hook('TPL_CONTENT_DISPLAY','BEFORE',$this, '_indexMenu', array()); 34 } 35} 36?> 37