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        global $INPUT;
39        if (!$INPUT->has('configFile')) {
40            $this->adminAction = new ConfigManagerAdminOverview();
41            return;
42        }
43        $this->adminAction = new ConfigManagerAdminShowConfig();
44    }
45
46    /**
47     * Output html of the admin page
48     */
49    public function html() {
50        echo '<div id="confmanager">';
51        $this->adminAction->html();
52        echo '</div>';
53    }
54}
55