mlandauer / phplib

Web Application component for Open Australia (phplib module)

This URL has Read+Write access

phplib / admin-configinfo.php
100644 43 lines (35 sloc) 1.115 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/*
* Config info admin page.
*
* Copyright (c) 2004 UK Citizens Online Democracy. All rights reserved.
* Email: francis@mysociety.org. WWW: http://www.mysociety.org
*
* $Id: admin-configinfo.php,v 1.3 2005/02/21 11:37:32 francis Exp $
*
*/
 
class ADMIN_PAGE_CONFIGINFO {
    function ADMIN_PAGE_CONFIGINFO () {
        $this->id = "confinfo";
        $this->navname = "Configuration Values";
    }
 
    function run($command) {
        ob_start();
        passthru($command);
        $ret = ob_get_contents();
        ob_end_clean();
        return "<tr><td><p><pre>$ret</pre></td></tr>";
    }
 
    function display($self_link) {
        $form = new HTML_QuickForm('adminConfigInfoForm', 'get', $self_link);
 
        $consts = get_defined_constants();
 
        $form->addElement('header', '', 'Configuration Settings (from conf/general)');
        foreach ($consts as $const => $value) {
            if (preg_match("/^OPTION_/", $const)) {
                $form->addElement('static', "static$const", null, "$const = $value");
            }
        }
 
        admin_render_form($form);
     }
}
 
?>