From acf77801d4066055cfc3c20e5b634722923f865f Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 13 Feb 2006 03:19:48 +0000 Subject: Anonymous modules are allowed now. --- .../protected/pages/Controls/NewControl.page | 3 --- framework/TApplication.php | 18 +++++++-------- framework/Web/Services/TPageService.php | 26 +++++----------------- 3 files changed, 14 insertions(+), 33 deletions(-) diff --git a/demos/quickstart/protected/pages/Controls/NewControl.page b/demos/quickstart/protected/pages/Controls/NewControl.page index 15b42d13..1e934409 100644 --- a/demos/quickstart/protected/pages/Controls/NewControl.page +++ b/demos/quickstart/protected/pages/Controls/NewControl.page @@ -148,7 +148,4 @@ If a control wants to be able to load post data, such as TTextBox, it h

If a control wants to get data from some external data source, it can extend TDataBoundControl. TDataBoundControl implements the basic properties and methods that are needed for populating data via databinding. In fact, controls like TListControl, TRepeater are TDataGrid are all derived from it.

-PostBackHandler -PostBackEvnetHandler -DataBoundControl \ No newline at end of file diff --git a/framework/TApplication.php b/framework/TApplication.php index 2f25925d..8c4f65f0 100644 --- a/framework/TApplication.php +++ b/framework/TApplication.php @@ -824,7 +824,8 @@ class TApplication extends TComponent Prado::trace("Loading module $id ({$moduleConfig[0]})",'System.TApplication'); $module=Prado::createComponent($moduleConfig[0]); - $this->setModule($id,$module); + if(is_string($id)) + $this->setModule($id,$module); foreach($moduleConfig[1] as $name=>$value) $module->setSubProperty($name,$value); $module->init($moduleConfig[2]); @@ -1087,14 +1088,15 @@ class TApplicationConfiguration extends TComponent foreach($modulesNode->getElementsByTagName('module') as $node) { $properties=$node->getAttributes(); - if(($id=$properties->itemAt('id'))===null) - throw new TConfigurationException('appconfig_moduleid_required'); - if(($type=$properties->remove('class'))===null && isset($this->_modules[$id]) && $this->_modules[$id][2]===null) - $type=$this->_modules[$id][0]; + $id=$properties->itemAt('id'); + $type=$properties->remove('class'); if($type===null) throw new TConfigurationException('appconfig_moduletype_required',$id); $node->setParent(null); - $this->_modules[$id]=array($type,$properties->toArray(),$node); + if($id===null) + $this->_modules[]=array($type,$properties->toArray(),$node); + else + $this->_modules[$id]=array($type,$properties->toArray(),$node); } } @@ -1106,9 +1108,7 @@ class TApplicationConfiguration extends TComponent $properties=$node->getAttributes(); if(($id=$properties->itemAt('id'))===null) throw new TConfigurationException('appconfig_serviceid_required'); - if(($type=$properties->remove('class'))===null && isset($this->_services[$id]) && $this->_services[$id][2]===null) - $type=$this->_services[$id][0]; - if($type===null) + if(($type=$properties->remove('class'))===null) throw new TConfigurationException('appconfig_servicetype_required',$id); $node->setParent(null); $this->_services[$id]=array($type,$properties->toArray(),$node); diff --git a/framework/Web/Services/TPageService.php b/framework/Web/Services/TPageService.php index ad1320b3..988f665a 100644 --- a/framework/Web/Services/TPageService.php +++ b/framework/Web/Services/TPageService.php @@ -696,30 +696,14 @@ class TPageConfiguration extends TComponent { $properties=$node->getAttributes(); $type=$properties->remove('class'); - if(($id=$properties->itemAt('id'))===null) - throw new TConfigurationException('pageserviceconf_module_invalid',$configPath); - if(isset($this->_modules[$id])) - { - if($type===null || $type===$this->_modules[$id][0]) - { - $this->_modules[$id][1]=array_merge($this->_modules[$id][1],$properties->toArray()); - $elements=$this->_modules[$id][2]->getElements(); - foreach($node->getElements() as $element) - $elements->add($element); - } - else - { - $node->setParent(null); - $this->_modules[$id]=array($type,$properties->toArray(),$node); - } - } - else if($type===null) + $id=$properties->itemAt('id'); + if($type===null) throw new TConfigurationException('pageserviceconf_moduletype_required',$id,$configPath); + $node->setParent(null); + if($id===null) + $this->_modules[]=array($type,$properties->toArray(),$node); else - { - $node->setParent(null); $this->_modules[$id]=array($type,$properties->toArray(),$node); - } } } -- cgit v1.2.3