1<?php
2/**
3 * DokuWiki Plugin PreserveFilenames / action.php
4 *
5 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author  Kazutaka Miyasaka <kazmiya@gmail.com>
7 */
8
9// must be run within DokuWiki
10if (!defined('DOKU_INC')) {
11    die();
12}
13
14if (!defined('DOKU_PLUGIN')) {
15    define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');
16}
17
18require_once(DOKU_PLUGIN . 'action.php');
19
20class action_plugin_preservefilenames extends DokuWiki_Action_Plugin
21{
22    /**
23     * Returns some info
24     */
25    function getInfo()
26    {
27        return confToHash(DOKU_PLUGIN . 'preservefilenames/plugin.info.txt');
28    }
29
30    /**
31     * Registers event handlers
32     */
33    function register(&$controller)
34    {
35        if (function_exists('act_validate')) {
36            // DokuWiki Adora Belle
37            require_once(DOKU_PLUGIN . 'preservefilenames/action_adorabelle.php');
38            $handler = new action_plugin_preservefilenames_adorabelle();
39        } elseif (function_exists('tpl_media')) {
40            // DokuWiki Angua
41            require_once(DOKU_PLUGIN . 'preservefilenames/action_angua.php');
42            $handler = new action_plugin_preservefilenames_angua();
43        } elseif (function_exists('utf8_decodeFN')) {
44            // DokuWiki Anteater or Rincewind
45            require_once(DOKU_PLUGIN . 'preservefilenames/action_anteater.php');
46            $handler = new action_plugin_preservefilenames_anteater();
47        } else {
48            return;
49        }
50
51        $handler->register($controller);
52    }
53}
54