<?php
//AUTHOR James Lin
//Version 3.0
 
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_autoincludeindex extends DokuWiki_Action_Plugin
{
	function _indexMenu(&$event, $param)
	{
		if (($_REQUEST['do']=='edit')||($_POST['do']['preview']))return;
		$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');
	}

        function getInfo()
        {
                return  array
                (
                        'name' => 'Sidebar Index Menu',
                        'email' => 'guanfenglin@gmail.com',
                        'date' => '04/12/2008',
                        'author' => 'James GuanFeng Lin',
                        'desc' => 'auto includes index menu to the page',
                        'url' => ''
                );
        }
 
        function register(&$controller)
        {
		$controller->register_hook('TPL_CONTENT_DISPLAY','BEFORE',$this, '_indexMenu', array());
        }
}
?>
