3 * FusionForge Config File edit page
8 * Copyright 2005 GForge, LLC
9 * http://fusionforge.org/
11 * Daniel A. PĂ©rez danielperez.arg@gmail.com
13 * This file is part of FusionForge.
15 * FusionForge is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
20 * FusionForge is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with FusionForge; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 require_once('../env.inc.php');
31 require_once $gfcommon.'include/pre.php';
32 require_once $gfwww.'admin/admin_utils.php';
34 site_admin_header(array('title'=>_('Configuration Manager')));
35 echo '<h1>' . _('Configuration Manager') . '</h1>';
37 echo "<h2>".sprintf (_('Configuration from the config API (*.ini files)'))."</h2>" ;
39 $title_arr = array(_('Variable'),_('Configured value'),_('Result (possibly after interpolation)'));
40 echo $HTML->listTableTop($title_arr);
42 $c = FusionForgeConfig::get_instance () ;
44 $sections = $c->get_sections () ;
46 array_unshift ($sections, 'core') ;
48 foreach ($sections as $section) {
49 if ($section == 'core') {
55 echo '<tr><th colspan="3"><strong>'.sprintf (_('Section %s'), $section)."</strong></th></tr>\n" ;
57 $variables = $c->get_variables ($section) ;
59 foreach ($variables as $var) {
60 echo '<tr '. $HTML->boxGetAltRowStyle($counter++) .'><td>'.$var ;
61 if ($c->is_bool ($section, $var)) {
65 print htmlspecialchars($c->get_raw_value ($section, $var)) ;
67 $v = $c->get_value ($section, $var) ;
68 if ($c->is_bool ($section, $var)) {
75 print htmlspecialchars($v);
81 echo $HTML->listTableBottom();
83 site_admin_footer(array());
85 function get_absolute_filename($filename) {
86 // Check for absolute path
87 if (realpath($filename) == $filename) {
91 // Otherwise, treat as relative path
92 $paths = explode(':', get_include_path());
93 foreach ($paths as $path) {
94 if (substr($path, -1) == '/') {
95 $fullpath = $path.$filename;
97 $fullpath = $path.'/'.$filename;
99 if (file_exists($fullpath)) {
109 // c-file-style: "bsd"