From e6191197dbebab3ebee0a53ca2757c22e5b684c3 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 3 Mar 2007 23:00:56 +0000 Subject: Fixed #551. --- framework/Web/Services/TPageService.php | 36 +++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'framework/Web') diff --git a/framework/Web/Services/TPageService.php b/framework/Web/Services/TPageService.php index 7d434523..e53d796f 100644 --- a/framework/Web/Services/TPageService.php +++ b/framework/Web/Services/TPageService.php @@ -189,7 +189,7 @@ class TPageService extends TService { $pageConfig=new TPageConfiguration; if($config!==null) - $pageConfig->loadFromXml($config,$application->getBasePath()); + $pageConfig->loadPageConfigurationFromXml($config,$application->getBasePath()); $pageConfig->loadFromFiles($pagePath,$this->getBasePath()); } else @@ -545,19 +545,39 @@ class TPageConfiguration extends TComponent } /** - * Loads a specific configuration xml element. + * Loads a page configuration. + * The configuration includes information for both application + * and page service. * @param TXmlElement config xml element * @param string base path corresponding to this xml element * @param string page name, null if page is not required */ public function loadFromXml($dom,$configPath,$page=null) { - if($page!==null) // config.xml - { - $appConfig=new TApplicationConfiguration; - $appConfig->loadFromXml($dom,$configPath); - $this->_appConfigs[]=$appConfig; - } + $this->loadApplicationConfigurationFromXml($dom,$configPath); + $this->loadPageConfigurationFromXml($dom,$configPath,$page); + } + + /** + * Loads the configuration specific for application part + * @param TXmlElement config xml element + * @param string base path corresponding to this xml element + */ + public function loadApplicationConfigurationFromXml($dom,$configPath) + { + $appConfig=new TApplicationConfiguration; + $appConfig->loadFromXml($dom,$configPath); + $this->_appConfigs[]=$appConfig; + } + + /** + * Loads the configuration specific for page service. + * @param TXmlElement config xml element + * @param string base path corresponding to this xml element + * @param string page name, null if page is not required + */ + public function loadPageConfigurationFromXml($dom,$configPath,$page=null) + { // authorization if(($authorizationNode=$dom->getElementByTagName('authorization'))!==null) { -- cgit v1.2.3