[Phpcms-plugins-cvs] admin4phpCMS/modules/phpcms class.phpcms_menu.php,1.1,1.2 layout.phpcms.xml,1.1
Brought to you by:
mjahn
From: Martin J. <mj...@us...> - 2004-09-29 20:10:57
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19438/modules/phpcms Modified Files: class.phpcms_menu.php layout.phpcms.xml class.module_phpcms.php Log Message: completed phpCMS-config-part began the statistic part Index: class.module_phpcms.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms/class.module_phpcms.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- class.module_phpcms.php 25 Aug 2004 21:16:48 -0000 1.3 +++ class.module_phpcms.php 29 Sep 2004 20:10:45 -0000 1.4 @@ -28,8 +28,9 @@ /* * $Log$ -* Revision 1.3 2004/08/25 21:16:48 mjahn -* step 1 is taken +* Revision 1.4 2004/09/29 20:10:45 mjahn +* completed phpCMS-config-part +* began the statistic part * */ /** @@ -59,12 +60,18 @@ class module_phpcms extends module { /** - * @var array $DEFAULTS contains the information of the default.php-file + * @var array $_DEFAULTS contains the information of the default.php-file * @access private **/ var $_DEFAULTS = array (); /** + * @var array $_config contains the information of the default.php-file + * @access private + **/ + var $_config = array (); + + /** * @var array $_CONF contains the information of the config * @access private **/ @@ -108,7 +115,7 @@ $this->configaction = ''; if (isset ($actiondata['request']['configform-submit'])) { $this->configaction = $actiondata['request']['configform-submit']; - $this->_formdata = $actiondata ['request']; + $this->_formdata = $actiondata ['post']; } $this->projectfile = ''; @@ -130,7 +137,7 @@ $this->_registerAction ('doProcess', 'processTags'); break; default: - $this->_registerAction ('doProcess', 'Process'); + $this->_registerAction ('doProcess', 'process'); } $this->_callEvent ('USER_GET_STATUS', $actiondata1); $this->_USER = $actiondata1; @@ -155,6 +162,78 @@ } // function process () + function processTags () { + $this->_registerAction ('doParseContent', 'getContentTags'); + } + + /** + * + **/ + function processCache (&$actiondata) { + $cachedir = $this->docroot.'/cms/phpcms2412/cache/'; + + if (!file_exists ($cachedir)) { + return false; + } + + if (!is_dir ($cachedir)) { + return false; + } + + $this->_registerAction ('doParseContent', 'getContentCache'); + $this->_CACHE = array(); + + $dh = dir ($cachedir); + while ($file = $dh->read ()) { + + if ($file{0} == '.') { + continue; + } + + // get the URL of the contentfile + $fh = fopen ($cachedir.$file, 'rb'); + $temp = fgets ($fh, 1024); + $temp .= fgets ($fh, 1024); + fclose ($fh); + preg_match('/<!--\sPHPCMS\sFILENAME\s(.*?)\s-->\s*/', $temp, $result); + if(isset($result[1])){ + $url = $result[1]; + } else { + $url = basename($file); + } + + // insert entry + $this->_CACHE [$url] = $file; + } + + if (!uksort ($this->_CACHE, array (&$this, '_sortCacheList'))) { + return false; + } + } + + + + function processMenu (&$actiondata) { + $this->_registerAction ('doParseContent', 'getContentMenu'); + } + + function processConfig (&$actiondata) { + + if ($this->configaction == 'save') { + $this->_parseConfigFormdata (); + } + + + + $this->_registerAction ('doParseContent', 'getContentConfig'); + + // load template from file + $_template = new XML_Tree (dirname (__FILE__).'/config.phpcms.xml'); + $this->_TPL = & $_template->getTreeFromFile (); + // load the values in the default.php + $this->_loadDefault (); + } + /** * Get content for mainmenu * @@ -233,7 +312,6 @@ } ob_start (); - print_r($this->_CONF); $content = ob_get_contents (); ob_end_clean (); @@ -255,74 +333,11 @@ // function getContent () /** - * - **/ - function sortCacheList ($a, $b) { - $dira = strpos ($a, '/') !== false; - $dirb = strpos ($b, '/') !== false; - if ($dira && !$dirb) { - return -1; - } - if (!$dira && $dirb) { - return 1; - } - return strcmp ($a, $b); - - } - // function sortCacheList - - /** - * - **/ - function processCache (&$actiondata) { - $cachedir = $this->docroot.'/cms/phpcms2412/cache/'; - - if (!file_exists ($cachedir)) { - return false; - } - - if (!is_dir ($cachedir)) { - return false; - } - - $this->_registerAction ('doParseContent', 'getCacheContent'); - $this->_CACHE = array(); - - $dh = dir ($cachedir); - while ($file = $dh->read ()) { - - if ($file{0} == '.') { - continue; - } - - // get the URL of the contentfile - $fh = fopen ($cachedir.$file, 'rb'); - $temp = fgets ($fh, 1024); - $temp .= fgets ($fh, 1024); - fclose ($fh); - preg_match('/<!--\sPHPCMS\sFILENAME\s(.*?)\s-->\s*/', $temp, $result); - if(isset($result[1])){ - $url = $result[1]; - } else { - $url = basename($file); - } - - // insert entry - $this->_CACHE [$url] = $file; - } - - if (!uksort ($this->_CACHE, array (&$this, 'sortCacheList'))) { - return false; - } - } - - - /** * Get content of the module * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ - function getCacheContent (&$actiondata) { + function getContentCache (&$actiondata) { // check if user-status if (!$this->_USER['isLoggedIn']) { @@ -394,25 +409,12 @@ } // foreach } - function processConfig (&$actiondata) { - if ($this->configaction == 'save') { - $this->checkConfigForm (); - } - $this->_registerAction ('doParseContent', 'getConfigContent'); - - // load template from file - $_template = new XML_Tree (dirname (__FILE__).'/config.phpcms.xml'); - $this->_TPL = & $_template->getTreeFromFile (); - // load the values in the default.php - $this->_loadDefault (); - } - /** * Get content of the module * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ - function getConfigContent (&$actiondata) { + function getContentConfig (&$actiondata) { if (!$this->_USER['isLoggedIn']) { return true; @@ -445,7 +447,6 @@ $actiondata1 = array ('_root'=>'configform', '_id'=>'tabbox', '_type'=>'block', 'extra'=>'class="tabbox"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); - //print_r ($this->_DEFAULTS); $tabs = array ('common'=>'Allgemein', 'pax'=>'PAX & Mail2Crypt', 'cache'=>'Caching', 'server'=>'Servereinstellungen', 'stat'=>'Statistik', 'other'=>'Sonstiges'); foreach ($tabs as $id=>$label) { @@ -467,7 +468,7 @@ $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); - $actiondata1 = $this->_DEFAULTS; + $actiondata1 = $this->_config; $actiondata1 ['_root'] = 'tabbox-'.$id; $actiondata1 ['_id'] = 'config-'.$id; $actiondata1 ['_type'] = 'pc_config_'.$id; @@ -481,17 +482,12 @@ return true; } // function getConfigContent () - - function processMenu (&$actiondata) { - $this->_registerAction ('doParseContent', 'getMenuContent'); - } - /** * Get content of the module * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ - function getMenuContent (&$actiondata) { + function getContentMenu (&$actiondata) { if (!$this->_USER['isLoggedIn']) { return true; } @@ -503,12 +499,10 @@ include_once (dirname (__FILE__).'/class.phpcms_menu.php'); $this->_MENU =& new phpcms_menu (); $this->_MENU->load (); - print_r($this->_CONF); - $projectdir = - $content = 'Durch Auswahl einer Projectdatei ist es m�glich, die Men�datei, das Seitentemplate und die Tagdatei zu bearbeiten. '. - 'Eventuell kann die Software auch alle Projectdateien auslesen, obwohl phpCMS ja keine feste Endung f�r eine Projectdatei vorgibt. '. - 'Damit w�re es m�glich alle Men�dateien, Seitentemplatedateien und Tagdateien getrennt zur Auswahl anzubieten. '; + $content = '<p>Durch Auswahl einer Projectdatei ist es möglich, die Menüdatei, das Seitentemplate und die Tagdatei zu bearbeiten. '. + 'Eventuell kann die Software auch alle Projectdateien auslesen, obwohl phpCMS ja keine feste Endung für eine Projectdatei vorgibt. '. + 'Damit wäre es möglich alle Menüdateien, Seitentemplatedateien und Tagdateien getrennt zur Auswahl anzubieten. </p>'; $actiondata1 = array ('_root'=>$actiondata ['_root'], '_id'=>'user1content', '_type'=>'paragraph', 'content'=>$content); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); @@ -516,16 +510,12 @@ } // function getMenuContent () - function processTags () { - $this->_registerAction ('doParseContent', 'getTagsContent'); - } - /** * Get content of the module * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ - function getTagsContent (&$actiondata) { + function getContentTags (&$actiondata) { if (!$this->_USER['isLoggedIn']) { return true; } @@ -572,42 +562,30 @@ $actiondata1 = array ('_root'=>'form_tags', '_id'=>'tags_status_'.$id, '_type'=>'paragraph', 'content'=>$id.' = '.$value); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata1); } - } - - - - return true; } // function getTagsContent () - function checkConfigForm () { + function _parseConfigFormdata () { + + if (!is_array ($this->_DEFAULTS) || count ($this->_DEFAULTS) == 0) { + $this->_loadDefault (); + } + $o = ''; foreach ($this->_formdata as $id=>$value) { if (substr ($id, 0, 7) != 'config-') { continue; } - //echo '<p>'.$id.' = '.$value.'</p>'; - } - } - // function checkConfigForm () - - function _getDefaultValue (&$actiondata) { - if (is_array ($this->_DEFAULTS) || count ($this->_DEFAULTS) == 0) { - $this->_loadDefault (); - } - - if (!isset ($actiondata ['id'])) { - return false; - } - - if (isset ($this->_DEFAULTS [$actiondata ['id']])) { - $actiondata ['value'] = $this->_DEFAULTS [$actiondata ['id']]; - return true; + + $id = strstr ($id, '-'); + $id{0} = ' '; + $id = trim ($id); + $this->_DEFAULTS [$id] ['value'] = $this->_formdata ['config-'.$id]; } - return false; - + $this->_saveDefault ($actiondata1); } + // function _parseConfigFormdata () function _loadDefault () { $_datafile = $this->docroot.$this->_CONF ['configfile']; @@ -620,7 +598,7 @@ } function _parseDefault ($data = '') { - if (!preg_match_all ('/\$this->(\S*)\s*=\s*([^;]*)/im', $data, $erg)) { + if (!preg_match_all ('/\$this->(\S*)\s*=\s*(.*);\s*$/im', $data, $erg)) { return false; } @@ -628,33 +606,91 @@ for ($i = 0; $i < $num; $i++) { switch (strtoupper ($erg [2] [$i])) { case '\'OFF\'': - $this->_DEFAULTS [$erg [1] [$i]] = (int) 0; - $this->_DEFAULTS [$erg [1] [$i].'_ON'] = ''; - $this->_DEFAULTS [$erg [1] [$i].'_OFF'] = ' checked="checked"'; + $this->_config [$erg [1] [$i]] = (int) 0; + $this->_config [$erg [1] [$i].'_ON'] = ''; + $this->_config [$erg [1] [$i].'_OFF'] = ' checked="checked"'; + $this->_DEFAULTS [$erg [1] [$i]] = array ('type'=>'onoff', 'value'=> 0); break; case '\'ON\'': - $this->_DEFAULTS [$erg [1] [$i]] = (int) 1; - $this->_DEFAULTS [$erg [1] [$i].'_OFF'] = ''; - $this->_DEFAULTS [$erg [1] [$i].'_ON'] = ' checked="checked"'; + $this->_config [$erg [1] [$i]] = (int) 1; + $this->_config [$erg [1] [$i].'_OFF'] = ''; + $this->_config [$erg [1] [$i].'_ON'] = ' checked="checked"'; + $this->_DEFAULTS [$erg [1] [$i]] = array ('type'=>'onoff', 'value'=> 0); break; default: if (substr ($erg [2] [$i], 0, 1) == '\'' && substr ($erg [2] [$i], -1) == '\'') { - $this->_DEFAULTS [$erg [1] [$i]] = (string) substr ($erg [2] [$i], 1, strlen ($erg [2] [$i]) - 2); - } else { - $this->_DEFAULTS [$erg [1] [$i]] = (string) $erg [2] [$i]; + $this->_config [$erg [1] [$i]] = (string) substr ($erg [2] [$i], 1, strlen ($erg [2] [$i]) - 2); + $this->_DEFAULTS [$erg [1] [$i]] = array ('type'=>'string', 'value'=> substr ($erg [2] [$i], 1, strlen ($erg [2] [$i]) - 2)); + break; } + + if (substr (trim ($erg [2] [$i]), 0, 1) == '$') { + $this->_config [$erg [1] [$i]] = (string) $erg [2] [$i]; + $this->_DEFAULTS [$erg [1] [$i]] = array ('type'=>'func', 'value'=> $erg [2] [$i]); + break; + } + + $this->_config [$erg [1] [$i]] = (string) $erg [2] [$i]; + $this->_DEFAULTS [$erg [1] [$i]] = array ('type'=>'string', 'value'=> $erg [2] [$i]); } - } return true; } function _saveDefault (&$actiondata) { + + $search = array (); + $replace = array (); + foreach ($this->_DEFAULTS as $id=>$entry) { + switch ($entry ['type']) { + case 'string': + $search [] = '/(\$this->'.$id.'\s*=\s*)(.*)(;\s*$)/im'; + $replace [] = '$1\''.$entry ['value'].'\'$3'; + break; + case 'num': + $search [] = '/(\$this->'.$id.'\s*=\s*)(.*)(;\s*$)/im'; + $replace [] = '$1'.$entry ['value'].'$3'; + break; + case 'func': + $search [] = '/(\$this->'.$id.'\s*=\s*)(.*)(;\s*$)/im'; + $replace [] = '$1'.$entry ['value'].'$3'; + break; + } + } + + $_datafile = $this->docroot.$this->_CONF ['configfile']; + if (function_exists ('file_get_contents')) { + $_data = file_get_contents ($_datafile); + } else { + $_data = join ('', file ($_datafile)); + } + $_data = preg_replace ($search, $replace, $_data); + + $fh = fopen ($_datafile, 'wb'); + fwrite ($fh, $_data); + fclose ($fh); } + + function _getDefaultValue (&$actiondata) { + if (!is_array ($this->_DEFAULTS) || count ($this->_DEFAULTS) == 0) { + $this->_loadDefault (); + } + + if (!isset ($actiondata ['id'])) { + return false; + } + + if (isset ($this->_DEFAULTS [$actiondata ['id']])) { + $actiondata ['value'] = $this->_DEFAULTS [$actiondata ['id']] ['value']; + return true; + } + return false; + + } function _setDefaultValue (&$actiondata) { - if (is_array ($this->_DEFAULTS) || count ($this->_DEFAULTS) == 0) { + if (!is_array ($this->_DEFAULTS) || count ($this->_DEFAULTS) == 0) { $this->_loadDefault (); } @@ -666,7 +702,7 @@ return false; } - $this->_DEFAULTS [$this->_DEFAULTS [$actiondata ['id']]] = $actiondata ['value']; + $this->_DEFAULTS [$this->_DEFAULTS [$actiondata ['id']]] ['value'] = $actiondata ['value']; return true; } @@ -674,6 +710,11 @@ // dfdsfas } + /** + * parse a projectfile of phpCMS + * + * @param array $data the data of the projectfile (like from a call of file) + **/ function _parseProjectFile ($data) { $_ret = array (); foreach ($data as $line) { @@ -687,5 +728,21 @@ } return $_ret; } + + /** + * Callback function for sorting the array with the cache-entries + **/ + function _sortCacheList ($a, $b) { + $dira = strpos ($a, '/') !== false; + $dirb = strpos ($b, '/') !== false; + if ($dira && !$dirb) { + return -1; + } + if (!$dira && $dirb) { + return 1; + } + return strcmp ($a, $b); + } + // function sortCacheList } ?> \ No newline at end of file Index: class.phpcms_menu.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms/class.phpcms_menu.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- class.phpcms_menu.php 24 Jul 2004 08:58:25 -0000 1.1 +++ class.phpcms_menu.php 29 Sep 2004 20:10:45 -0000 1.2 @@ -27,8 +27,9 @@ **/ /* * $Log$ -* Revision 1.1 2004/07/24 08:58:25 mjahn -* changed some things +* Revision 1.2 2004/09/29 20:10:45 mjahn +* completed phpCMS-config-part +* began the statistic part * */ /** @@ -57,40 +58,40 @@ return false; } $parentclass = substr($class, 0, strrpos ($class, '.')); - if ($parentclass == $this->root) { - $menu =& $this->menu; - } else { - $menu =& $this->quicklink[$parentclass]['_sub_']; - } - for ($i = 0; $i < count ($menu); $i++) { - if ($menu[$i]['CLASS'] != $class) { - continue; - } - break; - } + if ($parentclass == $this->root) { + $menu =& $this->menu; + } else { + $menu =& $this->quicklink[$parentclass]['_sub_']; + } + for ($i = 0; $i < count ($menu); $i++) { + if ($menu[$i]['CLASS'] != $class) { + continue; + } + break; + } - if (isset($this->quicklink[$menuEntry['CLASS']])) { - for ($j = 0; isset($this->quicklink[$menuEntry['CLASS'].$j]); $j++); - $menuEntry['CLASS'] = $menuEntry['CLASS'].$j; - } - if ($after) { - $i = ($i == count($menu)) ? count($menu) : $i + 2; - array_splice($menu, $i, 0, array($menuEntry)); - } else { - $i = ($i == 0) ? 0 : $i; - array_splice($menu, $i, 0, array($menuEntry)); - } - $this->quicklink[$menuEntry['CLASS']] = $menu[$i]; - + if (isset($this->quicklink[$menuEntry['CLASS']])) { + for ($j = 0; isset($this->quicklink[$menuEntry['CLASS'].$j]); $j++); + $menuEntry['CLASS'] = $menuEntry['CLASS'].$j; + } + if ($after) { + $i = ($i == count($menu)) ? count($menu) : $i + 2; + array_splice($menu, $i, 0, array($menuEntry)); + } else { + $i = ($i == 0) ? 0 : $i; + array_splice($menu, $i, 0, array($menuEntry)); + } + $this->quicklink[$menuEntry['CLASS']] = $menu[$i]; + } function delete ($class) { - if (isset($this->quicklink[$class])) { - return false; - } - $parentclass = substr($class, 0, strrpos ($class, '.')); - $menu =& $this->quicklink[$parentclass]; - for ($i = 0; $i < count ($menu); $i++) { + if (isset($this->quicklink[$class])) { + return false; + } + $parentclass = substr($class, 0, strrpos ($class, '.')); + $menu =& $this->quicklink[$parentclass]; + for ($i = 0; $i < count ($menu); $i++) { if ($menu[$i]['CLASS'] != $class) { continue; } @@ -121,7 +122,7 @@ case 'xml': $o = $this->__saveAsXML(); break; - default; + default:; } $fh = fopen ($tofile, 'wb'); fwrite ($fh, $o); @@ -141,103 +142,103 @@ } function __parse () { - // check if the menufile exists - if (!file_exists($this->menufile) || !is_file($this->menufile)) { - return false; - } + // check if the menufile exists + if (!file_exists($this->menufile) || !is_file($this->menufile)) { + return false; + } - // get content from menufile + // get content from menufile $data = file ($this->menufile); + // initialize some variables - $this->menu = array(); + $this->menu = array(); $new = false; $menufields = array(); $menucounter = -1; $entrycounter = 0; - // walk through the lines of the menufile - for ($i = 0; $i < count($data); $i++) { - - // remove trailing and leading whitespace - $line = trim($data[$i]); + // walk through the lines of the menufile + for ($i = 0; $i < count($data); $i++) { + // remove trailing and leading whitespace + $line = trim($data[$i]); + // check for empty line - if (trim($line) == '') { + if (trim($line) == '') { continue; } - - // check for comment-line + + // check for comment-line if ($line[0] == ';') { - countinue; + continue; } - + // check for menu-definition if (substr($line, 0, 5) == 'MENU:') { - - if (substr($line, -1) == ';') { - $line = trim(substr($line, 0, strrpos($line, ';'))); - } - - $menulevel = trim (substr($line, 5)); - - // increase the counter for the menublocks - $menucounter++; - - // initialize the new element in the menuarray - $this->menu[$menucounter] = array(); - $entrycounter = 0; - - // save actual menuposition in pointer - $actual =& $this->menu[$menucounter]; - + + if (substr($line, -1) == ';') { + $line = trim(substr($line, 0, strrpos($line, ';'))); + } + $menulevel = trim (substr($line, 5)); + + // increase the counter for the menublocks + $menucounter++; + + // initialize the new element in the menuarray + $this->menu[$menucounter] = array(); + $entrycounter = 0; + + // save actual menuposition in pointer + $actual =& $this->menu[$menucounter]; + continue; } - + // check for field-definition line if (substr($line, 0, 6) == 'CLASS;') { if (substr($line, -1) == ';') { $line = trim(substr($line, 0, strrpos($line, ';'))); } + // get field definitions - $menufielddata = explode(';',$line); - - // initialize some variables + $menufielddata = explode(';',$line); + + // initialize some variables $k = 0; $menufields = array(); - - // walk throught the array of field definitions + + // walk throught the array of field definitions for ($j = 0; $j < count($menufielddata); $j++) { $l = trim($menufielddata[$j]); - - // save name of field definition + + // save name of field definition $menufields[$k++] = $l; } continue; } - + // now we have a menu entry, explode into field elements $entry = explode(';', $line); for ($j = 0; $j < count($menufields); $j++) { + // put data of menu-entry into menu-structure - $actual[$entrycounter][$menufields[$j]] = trim($entry[$j]); + $actual[$entrycounter][$menufields[$j]] = trim($entry[$j]); } - $actual[$entrycounter]['_level_'] = $menulevel; - - // increase menucounter - $entrycounter++; + $actual[$entrycounter]['_level_'] = $menulevel; + + // increase menucounter + $entrycounter++; $this->menuclasses[$menucounter] = substr($actual[0]['CLASS'], 0, strrpos($actual[0]['CLASS'], '.')); } // sort the array with the menu-classes - $temp = $this->menuclasses; + $temp = $this->menuclasses; sort ($temp); $this->root = $temp[0]; - echo '<!--'; - print_r($this->menu); - echo '-->'; - // complete building of menu-structure - $this->menu = $this->__recurseMenu($this->root); + + // complete building of menu-structure + $this->menu = $this->__recurseMenu($this->root); } /** @@ -247,7 +248,7 @@ if (!in_array ($menuclass, $this->menuclasses)) { return false; } - $rootmenu = $this->__getKeyByValue ($this->menuclasses, $menuclass); + $rootmenu = $this->__getKeyByValue ($this->menuclasses, $menuclass); $menu = array(); $actual = 0; @@ -272,32 +273,32 @@ } function __saveAsPhpCMS () { - $i = 0; - $o = ''; - $menu = array($this->menu); - while (isset($menu[$i])) { - $o .= 'MENU:'.$menu[$i][0]['_level_']."\n"; - $menuline = $menu[$i][0]; - unset ($menuline['_level_']); - if (isset($menuline['_sub_'])) { - unset ($menuline['_sub_']); - } - $o .= join(';', array_keys($menuline))."\n"; - for ($j = 0; $j < count ($menu[$i]); $j++) { - $menuEntry = $menu[$i][$j]; - if (isset($menuEntry['_sub_'])) { - unset($menuEntry['_sub_']); - $menu[] = $menu[$i][$j]['_sub_']; - } - if (isset($menuEntry['_level_'])) { - unset($menuEntry['_level_']); - } - $o .= join (";\t", $menuEntry)."\n"; - } - $o .= "\n"; - $i++; - } - return $o; - } + $i = 0; + $o = ''; + $menu = array($this->menu); + while (isset($menu[$i])) { + $o .= 'MENU:'.$menu[$i][0]['_level_']."\n"; + $menuline = $menu[$i][0]; + unset ($menuline['_level_']); + if (isset($menuline['_sub_'])) { + unset ($menuline['_sub_']); + } + $o .= join(';', array_keys($menuline))."\n"; + for ($j = 0; $j < count ($menu[$i]); $j++) { + $menuEntry = $menu[$i][$j]; + if (isset($menuEntry['_sub_'])) { + unset($menuEntry['_sub_']); + $menu[] = $menu[$i][$j]['_sub_']; + } + if (isset($menuEntry['_level_'])) { + unset($menuEntry['_level_']); + } + $o .= join (";\t", $menuEntry)."\n"; + } + $o .= "\n"; + $i++; + } + return $o; + } } ?> \ No newline at end of file Index: layout.phpcms.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms/layout.phpcms.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- layout.phpcms.xml 25 Aug 2004 21:16:48 -0000 1.1 +++ layout.phpcms.xml 29 Sep 2004 20:10:45 -0000 1.2 @@ -11,16 +11,8 @@ <label><input type="text" name="config-GLOBAL_PROJECT_FILE" value="<layout:replace name="GLOBAL_PROJECT_FILE" />" />Standard Projektdatei </label> </fieldset> <fieldset> - <legend>Erkennung des Document-Root</legend> - <label class="horizontal"><input type="radio" name="autoconfig-PATH" value="1"<layout:replace name="PAX_ON" /> /> Automatisch</label> - <label class="horizontal"><input type="radio" name="autoconfig-PATH" value="0"<layout:replace name="PAX_OFF" /> /> Manuell eingeben</label> - <label><input type="text" name="config-DOCUMENT_ROOT" value="<layout:replace name="DOCUMENT_ROOT" />" />Document_Root </label> - </fieldset> - <fieldset> - <legend>Erkennung des Domainnamens</legend> - <label class="horizontal"><input type="radio" name="autoconfig-DOMAIN" value="1"<layout:replace name="AUTO_DOMAIN_ON" /> /> Automatisch</label> - <label class="horizontal"><input type="radio" name="autoconfig-DOMAIN" value="0"<layout:replace name="AUTO_DOMAIN_OFF" /> /> Manuell eingeben</label> - <label><input type="text" name="config-DOMAIN_NAME" value="<layout:replace name="DOMAIN_NAME" />" />Document_Root </label> + <legend>Sonstiges</legend> + <label><input type="password" name="config-PASS" value="<layout:replace name="PASS" />" />Passwort </label> </fieldset> ]]> </layout:insert> @@ -79,12 +71,16 @@ </fieldset> <fieldset> <legend title="Klau dem Apachen sein Gemachen ;)">Stealth-Mode</legend> - <label class="horizontal"><input type="radio" name="config-STEALTH_MODE" value="1"<layout:replace name="STEALTH_MODE_ON" /> /> An</label> - <label class="horizontal"><input type="radio" name="config-STEALTH_MODE" value="0"<layout:replace name="STEALTH_MODE_OFF" /> /> Aus</label> + <label class="horizontal"><input type="radio" name="config-STEALTH" value="1"<layout:replace name="STEALTH_ON" /> /> An</label> + <label class="horizontal"><input type="radio" name="config-STEALTH" value="0"<layout:replace name="STEALTH_OFF" /> /> Aus</label> <div id="pc_config_server_1"> - <label><input type="text" name="config-CACHE_DIR" value="<layout:replace name="CACHE_DIR" />" />Pfad zum Cacheverzeichnis </label> - <label><input type="text" name="config-CACHE_DIR" value="<layout:replace name="CACHE_DIR" />" />Pfad zum Cacheverzeichnis </label> + <label><input type="text" name="config-NOLINKCHANGE" value="<layout:replace name="NOLINKCHANGE" />" />Links mit folgenden Endungen nicht behandeln</label> </div> + <fieldset id="secure-stealth-mode"> + <legend>Secure Stealth Mode</legend> + <label class="horizontal"><input type="radio" name="config-STEALTH_SECURE" value="1"<layout:replace name="STEALTH_SECURE_ON" /> /> An</label> + <label class="horizontal"><input type="radio" name="config-STEALTH_SECURE" value="0"<layout:replace name="STEALTH_SECURE_OFF" /> /> Aus</label> + </fieldset> </fieldset> <fieldset> <legend title="Fehlerbehandlung">Debug-Modus</legend> @@ -103,8 +99,8 @@ <![CDATA[ <fieldset> <legend>Allgemeine Statistik</legend> - <label class="horizontal"><input type="radio" name="config-STEALTH_MODE" value="1"<layout:replace name="STEALTH_MODE_ON" /> /> An</label> - <label class="horizontal"><input type="radio" name="config-STEALTH_MODE" value="0"<layout:replace name="STEALTH_MODE_OFF" /> /> Aus</label> + <label class="horizontal"><input type="radio" name="config-STATS" value="1"<layout:replace name="STATS_ON" /> /> An</label> + <label class="horizontal"><input type="radio" name="config-STATS" value="0"<layout:replace name="STATS_OFF" /> /> Aus</label> <div id="pc_config_stat_1"> <label><input type="text" name="config-STATS_DIR" value="<layout:replace name="STATS_DIR" />" />Verzeichnis der Statistik </label> <label><input type="text" name="config-STATS_CURRENT" value="<layout:replace name="STATS_CURRENT" />" />aktuelles Verzeichnis der Statistik </label> @@ -133,9 +129,28 @@ <label><input type="text" name="config-TAG_DELIMITER" value="<layout:replace name="TAG_DELIMITER" />" />Tag-Trennzeichen </label> </fieldset> <fieldset> - <legend>Sonstiges</legend> - <label><input type="password" name="config-PASS" value="<layout:replace name="PASS" />" />Passwort </label> - <label><input type="password" name="config-PASS" value="<layout:replace name="PASS" />" />Passwort </label> + <legend>Erkennung von $DOCUMENT_ROOT</legend> + <label class="horizontal"><input type="radio" name="autoconfig-PATH" value="1"<layout:replace name="AUTO_DOCUMENT_ON" /> /> Automatisch</label> + <label class="horizontal"><input type="radio" name="autoconfig-PATH" value="0"<layout:replace name="AUTO_DOCUMENT_ROOT_OFF" /> /> Manuell eingeben</label> + <label><input type="text" name="config-DOCUMENT_ROOT" value="<layout:replace name="DOCUMENT_ROOT" />" />Document_Root </label> + </fieldset> + <fieldset> + <legend>Erkennung von $DOMAIN_NAME</legend> + <label class="horizontal"><input type="radio" name="autoconfig-DOMAIN_NAME" value="1"<layout:replace name="AUTO_DOMAIN_NAME_ON" /> /> Automatisch</label> + <label class="horizontal"><input type="radio" name="autoconfig-DOMAIN_NAME" value="0"<layout:replace name="AUTO_DOMAIN_NAME_OFF" /> /> Manuell eingeben</label> + <label><input type="text" name="config-DOMAIN_NAME" value="<layout:replace name="DOMAIN_NAME" />" />Domainname </label> + </fieldset> + <fieldset> + <legend>Erkennung von $SCRIPT_PATH</legend> + <label class="horizontal"><input type="radio" name="autoconfig-SCRIPT_PATH" value="1"<layout:replace name="AUTO_SCRIPT_PATH_ON" /> /> Automatisch</label> + <label class="horizontal"><input type="radio" name="autoconfig-SCRIPT_PATH" value="0"<layout:replace name="AUTO_SCRIPT_PATH_OFF" /> /> Manuell eingeben</label> + <label><input type="text" name="config-SCRIPT_PATH" value="<layout:replace name="SCRIPT_PATH" />" />Document_Root </label> + </fieldset> + <fieldset> + <legend>Erkennung von $SCRIPT_NAME</legend> + <label class="horizontal"><input type="radio" name="autoconfig-SCRIPT_NAME" value="1"<layout:replace name="AUTO_SCRIPT_NAME_ON" /> /> Automatisch</label> + <label class="horizontal"><input type="radio" name="autoconfig-SCRIPT_NAME" value="0"<layout:replace name="AUTO_SCRIPT_NAME_OFF" /> /> Manuell eingeben</label> + <label><input type="text" name="config-SCRIPT_NAME" value="<layout:replace name="SCRIPT_NAME" />" />Document_Root </label> </fieldset> ]]> </layout:insert> |