1<?php
2/**
3 * Example Action Plugin:   Example Component.
4 *
5 * @author     Samuele Tognini <samuele@cli.di.unipi.it>
6 */
7
8if(!defined('DOKU_INC')) die();
9if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
10require_once DOKU_PLUGIN.'action.php';
11
12class action_plugin_dwcommits extends DokuWiki_Action_Plugin {
13
14    /**
15     * Register its handlers with the DokuWiki's event controller
16     */
17    function register(Doku_Event_Handler $controller) {
18        $controller->register_hook('PARSER_CACHE_USE', 'BEFORE', $this,
19                                   'touch_cache');
20    }
21
22    /**
23     * Hook js script into page headers.
24     *
25     * @author Myron Turner <turnermm02@shaw.ca>
26     */
27    function touch_cache(&$event, $param) {
28     global $ID;
29     $auto = $this->getConf('auto_id');
30
31     if(preg_match('/' . $auto.'/',$ID)){
32         $event->preventDefault();
33      }
34    }
35
36
37}
38