diff --git a/config.php b/config.php index adb84af..f4746e2 100644 --- a/config.php +++ b/config.php @@ -3,6 +3,8 @@ @package domframework @author Dominique Fournier */ +require_once ("domframework/form.php"); + /** Manage the configurations of the module done by administrator in a config file It is based on the module configuration defaults @@ -26,6 +28,10 @@ class config { if (defined("CONFIGFILE")) $this->confFile = CONFIGFILE; + if (file_exists ("./datas/configuration.php")) + $this->confFile = "./datas/configuration.php"; + elseif (file_exists ("./data/configuration.php")) + $this->confFile = "./data/configuration.php"; } /** List all the parameters configurable in the software */ @@ -144,4 +150,25 @@ class config return $phpcode; } + + /** Return an array of fields */ + private function configRead ($params) + { + $fields = array (); + foreach ($params as $p1=>$vals1) + { + if (is_array ($vals1)) + { + $fields = array_merge ($fields, $this->configRead ($vals1)); + } + else + { + $field = new formfield ($vals1, $vals1); + $field->group = $p1; + $fields[] = $field; + unset ($field); + } + } + return $fields; + } }