[Phpcms-plugins-cvs] admin4phpCMS/modules/config modules.ini,NONE,1.1 class.module_config.php,1.8,1.
Brought to you by:
mjahn
From: Martin J. <mj...@us...> - 2005-04-07 14:09:39
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15012/modules/config Modified Files: class.module_config.php Added Files: modules.ini Log Message: Commit as backup during development Index: class.module_config.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/config/class.module_config.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- class.module_config.php 7 Dec 2004 06:34:47 -0000 1.8 +++ class.module_config.php 7 Apr 2005 14:09:12 -0000 1.9 @@ -30,6 +30,9 @@ /* * $Log$ +* Revision 1.9 2005/04/07 14:09:12 mjahn +* Commit as backup during development +* * Revision 1.8 2004/12/07 06:34:47 mjahn * prepration of first Alpha-Preview * @@ -47,11 +50,6 @@ * */ /** -* include the PEAR::XML_Tree class -**/ -include_once (PATH_TO_PEAR.'XML/Tree.php'); - -/** * The config-class encapsulates the access to the configfile against the framework * * @package admin4phpCMS @@ -100,44 +98,19 @@ $this->_registerAction ('doSetConfigFile', 'setConfigFile'); } - /** - * @param array $actiondata - **/ - function parseParam (&$actiondata) { - - $this->display = (isset ($actiondata['request']['moduleid']) && $actiondata['request']['moduleid'] == 'config'); - - $this->_callEvent ('USER_GET_STATUS', $actiondata1); - $this->_USER = $actiondata1; - - } - /** - * @param array $actiondata - **/ - function getMenuMain (&$actiondata) { - if (!$this->_USER['isLoggedIn']) { - return true; - } - - $root = $actiondata['_root']; - $actiondata1 = array ('_type'=>'menu_main_entry', '_root'=>$root, 'name'=>'Einstellungen', 'module'=>'config', '_id'=>'configmenu', '_root'=>'mainmenu'); - if ($this->display) { - $actiondata1 ['extra'] = 'class="active"'; - } - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata1); - } /** * read and parse the configfile * - * @example /home/martin/devel/admin4phpCMS/modules/config/config.xml sample configfile + * @example /home/martin/devel/admin4phpCMS/modules/config/modules.ini sample + * configfile * @param array $actiondata $actiondata['configfile'] contains the path to the configfile **/ function readConfig (&$actiondata) { if (isset ($actiondata['configfile'])) { $this->_configfile = $actiondata ['configfile']; } else { - $this->_configfile = dirname (__FILE__).'/config.xml'; + $this->_configfile = dirname (__FILE__).'/modules.ini'; } if (!isset ($this->_configfile)) { @@ -153,27 +126,8 @@ return false; } - $XML =& new XML_Tree ($this->_configfile); - - if (PEAR::isError ($XML)) { - echo '<!--'; - print_r ($XML); - echo '-->'; - } - - $configdata =& $XML->getTreeFromFile (); + $this->_config = parse_ini_file ($this->_configfile, true); - if (PEAR::isError ($configdata)) { - echo '<!--'; - print_r ($configdata); - echo '-->'; - } - for ($i = 0; $i < count ($configdata->children); $i++) { - if (!isset ($configdata->children [$i]->attributes ['id'])) { - continue; - } - $this->_config [$configdata->children [$i]->attributes ['id']] =& $configdata->children [$i]; - } return true; } @@ -192,23 +146,7 @@ return true; } - if (!isset ($actiondata ['format']) || $actiondata ['format'] == 'object') { - $actiondata ['config'] =& $this->_config [$actiondata ['module']]; - return true; - } - - if (isset ($actiondata ['format']) && $actiondata ['format']=='array') { - $num = count ($this->_config [$actiondata ['module']]->children); - for ($i = 0; $i < $num; $i++) { - if (count ($this->_config [$actiondata ['module']]->children [$i]->attributes) == 0) { - continue; - } - if (!isset ($this->_config [$actiondata ['module']]->children [$i]->attributes ['name'])) { - continue; - } - $actiondata ['config'] [$this->_config [$actiondata ['module']]->children [$i]->attributes ['name']] = & $this->_config [$actiondata['module']]->children [$i]->attributes ['value']; - } - } + $actiondata ['config'] =& $this->_config [$actiondata ['module']]; return true; } --- NEW FILE: modules.ini --- [user] file = class.module_user.php class = module_user userfile = user.db permfile = perm.db [mail] file = class.module_mail.php class = module_mail admin-email = ma...@ma... from-email = fra...@ma... [log] file = class.module_log.php class = module_log logfile = log/framework.log chmod = 0606 [error] file = class.module_error.php class = module_error [debug] file = class.module_debug.php class = module_debug [layout] file = class.module_layout.php class = module_layout ;[filemanager] ;file = class.module_filemanager.php ;class = module_filemanager ;imagepath = filemanager/img/ ;editor_image = jpg,jpeg,png,bmp,gif ;editor_xml = xml,dtd ;editor_phpcms_content = phpcms ;editor_phpcms_menu =mnu [phpcms] file = class.module_phpcms.php class = module_phpcms parser_root = /cms/parser/ [phpcms-content] file = class.module_phpcms_content.php class = module_phpcms_content [statistic] file = class.module_statistic.php class = module_statistic [pluginmanager] file = class.module_pluginmanager.php class = module_pluginmanager |