1<?php
2
3if(!defined('DOKU_PLUGIN_ICONS')) define('DOKU_PLUGIN_ICONS',DOKU_BASE.'lib/plugins/confmanager/icons/');
4
5require_once DOKU_PLUGIN . 'confmanager/adminActions/ConfigManagerAdminAction.php';
6require_once DOKU_PLUGIN . 'confmanager/adminActions/ConfigManagerAdminOverview.php';
7require_once DOKU_PLUGIN . 'confmanager/adminActions/ConfigManagerAdminShowConfig.php';
8
9/**
10 * Class admin_plugin_confmanager
11 */
12class admin_plugin_confmanager extends DokuWiki_Admin_Plugin {
13
14    /**
15     * @var ConfigManagerAdminAction action to run
16     */
17    private $adminAction;
18
19    /**
20     * Determine position in list in admin window
21     * Lower values are sorted up
22     *
23     * @return int
24     */
25    public function getMenuSort() {
26        return 101;
27    }
28
29    /**
30     * Carry out required processing
31     */
32    public function handle() {
33        $this->determineAction();
34        $this->adminAction->handle();
35    }
36
37    private function determineAction() {
38        if (!isset($_REQUEST['configFile'])) {
39            $this->adminAction = new ConfigManagerAdminOverview();
40            return;
41        }
42        $this->adminAction = new ConfigManagerAdminShowConfig();
43    }
44
45    /**
46     * Output html of the admin page
47     */
48    public function html() {
49        echo '<div id="confmanager">';
50        $this->adminAction->html();
51        echo '</div>';
52    }
53}
54