[quote="ef"] ... IMHO (off-topic, it should be a feature request), it would be better to add those settings in the Admin - Config page also (i.e. to move every customization to include_config.php).
I quite agree, I simply haven't had time to add pages to the admin tab for the inkscape and dia configs. I was intending refining this area, but too much "real" work and not enough time I'm afraid.
The way I intended doing this was to read the config page in to an array, create the admin_x_config form page from the array, and post back to the config page from the dynamically created form page. Doing this dynamically would allow me to change the config.php pages without having to re-code the admin page too much.
Feel free to add this to the Feature Requests. (Better still have a look at coding this ).
This is about as far as I managed to progress... (save this as show_include_inkscape_config.php)
I want to be able to create the table with only those lines which have a valid $variable, and perhaps use the comments to set the acceptable variable type and permitted values, and maybe even the text to appear on the (untranslated) form, if that makes sense..
[code]
<?php // /** * * @version $Id: show_include_inkscape_config.php 6th November 2007 * * @author The Open Audit Developer Team (Andrew Hull) * @objective Configuration File for inkscape inkscapegram Creator Page for Open Audit. * @package open-audit (www.open-audit.org) * @copyright Copyright (C) open-audit.org All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see ../gpl.txt * Open-Audit is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See www.open-audit.org for further copyright notices and details. * */ // // Quick and dirty hack to read a config file to an array and output the array to a table.. // Not pretty, but hey.. it works.
echo '<html> <body>';
$file = 'include_dia_config.php'; $file_contents = array_map('rtrim',file($file));
html_show_array($file_contents);
function do_offset($level){ $offset = ""; // offset for subarry for ($i=1; $i<$level;$i++){ $offset = $offset . "<td></td>"; } return $offset; } echo '</html> </body>';
function show_array($array, $level, $sub){ if (is_array($array) == 1){ // check if input is an array foreach($array as $key_val => $value) { $offset = ""; if (is_array($value) == 1){ // array is multidimensional echo "<tr>"; $offset = do_offset($level); echo $offset . "<td>" . $key_val . "</td>"; show_array($value, $level+1, 1); } else{ // (sub)array is not multidim if ($sub != 1){ // first entry for subarray echo "<tr nosub>"; $offset = do_offset($level); } $sub = 0; echo $offset . "<td main ".$sub." width=\"120\">" . $key_val . "</td><td width=\"120\">" . $value . "</td>"; echo "</tr>\n"; } } //foreach $array } else{ // argument $array is not an array return; } }
function html_show_array($array){ echo "<table cellspacing=\"0\" border=\"2\">\n"; show_array($array, 1, 0); echo "</table>\n"; }
?>
[/code]
_________________ Andrew
[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home) LDAP: Active Directory[/size]
|