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')));
36 echo "<h2>".sprintf (_('Configuration from the config API (*.ini files)'))."</h2>" ;
38 $title_arr = array(_('Variable'),_('Configured value'),_('Result (possibly after interpolation)'));
39 echo $HTML->listTableTop($title_arr);
41 $c = FusionForgeConfig::get_instance () ;
43 $sections = $c->get_sections () ;
45 array_unshift ($sections, 'core') ;
47 foreach ($sections as $section) {
48 if ($section == 'core') {
54 echo '<tr><th colspan="3"><strong>'.sprintf (_('Section %s'), $section)."</strong></th></tr>\n" ;
56 $variables = $c->get_variables ($section) ;
58 foreach ($variables as $var) {
59 echo '<tr '. $HTML->boxGetAltRowStyle($counter++) .'><td>'.$var ;
60 if ($c->is_bool ($section, $var)) {
64 print htmlspecialchars($c->get_raw_value ($section, $var)) ;
66 $v = $c->get_value ($section, $var) ;
67 if ($c->is_bool ($section, $var)) {
74 print htmlspecialchars($v);
80 echo $HTML->listTableBottom();
82 site_admin_footer(array());
84 function get_absolute_filename($filename) {
85 // Check for absolute path
86 if (realpath($filename) == $filename) {
90 // Otherwise, treat as relative path
91 $paths = explode(':', get_include_path());
92 foreach ($paths as $path) {
93 if (substr($path, -1) == '/') {
94 $fullpath = $path.$filename;
96 $fullpath = $path.'/'.$filename;
98 if (file_exists($fullpath)) {
108 // c-file-style: "bsd"