Changeset 1447
- Timestamp:
- 12/31/06 00:11:26 (2 years ago)
- Location:
- branches/0.11/src/config
- Files:
-
- 3 modified
-
AgaviConfigValueHolder.class.php (modified) (2 diffs)
-
AgaviSettingConfigHandler.class.php (modified) (1 diff)
-
xsd/settings.xsd (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.11/src/config/AgaviConfigValueHolder.class.php
r1384 r1447 180 180 * Returns the children of this value. 181 181 * 182 * @param string Return only the childs matching this node (tag) name. 183 * 182 184 * @return array An array with the childs of this value. 183 185 * … … 185 187 * @since 0.11.0 186 188 */ 187 public function getChildren() 188 { 189 return $this->_childs; 189 public function getChildren($nodename = null) 190 { 191 if($nodename === null) { 192 return $this->_childs; 193 } else { 194 $childs = array(); 195 foreach($this->_childs as $child) { 196 if($child->getName() == $nodename) { 197 $childs[] = $child; 198 } 199 } 200 201 return $childs; 202 } 190 203 } 191 204 -
branches/0.11/src/config/AgaviSettingConfigHandler.class.php
r1391 r1447 66 66 67 67 if(isset($cfg->settings)) { 68 foreach($cfg->settings as $setting) 69 { 70 $data['core.' . $setting->getAttribute('name')] = $this->literalize($setting->getValue()); 68 $multiSettings = $cfg->getChildren('settings'); 69 foreach($multiSettings as $settings) { 70 $prefix = $settings->getAttribute('prefix', 'core.'); 71 foreach($settings as $setting) 72 { 73 $data[$prefix . $setting->getAttribute('name')] = $this->literalize($setting->getValue()); 74 } 71 75 } 72 76 } -
branches/0.11/src/config/xsd/settings.xsd
r908 r1447 6 6 <xs:element name="configuration" minOccurs="0" maxOccurs="unbounded"> 7 7 <xs:complexType> 8 <xs: all>9 <xs: element name="system_actions" type="system_actions" minOccurs="0" />10 <xs: element name="settings" type="settings" minOccurs="0" />11 <xs: element name="exception_templates" type="exception_templates" minOccurs="0" />12 </xs: all>8 <xs:sequence minOccurs="0" maxOccurs="unbounded" > 9 <xs:group ref="system_actions" minOccurs="0" /> 10 <xs:group ref="settings" minOccurs="0" maxOccurs="unbounded" /> 11 <xs:group ref="exception_templates" minOccurs="0" /> 12 </xs:sequence> 13 13 <xs:attribute name="environment" type="xs:string" /> 14 14 </xs:complexType> … … 17 17 <xs:attribute name="parent" type="xs:string" /> 18 18 </xs:complexType> 19 20 <xs:group name="system_actions"> 21 <xs:choice> 22 <xs:element name="system_actions" type="system_actions" minOccurs="0" /> 23 <xs:element name="system_action" type="system_action" minOccurs="0" maxOccurs="unbounded" /> 24 </xs:choice> 25 </xs:group> 19 26 20 27 <xs:complexType name="system_actions"> … … 31 38 </xs:complexType> 32 39 40 <xs:group name="settings"> 41 <xs:choice> 42 <xs:element name="settings" type="settings" minOccurs="0" /> 43 <xs:element name="setting" type="setting" minOccurs="0" maxOccurs="unbounded" /> 44 </xs:choice> 45 </xs:group> 46 33 47 <xs:complexType name="settings"> 34 48 <xs:sequence> 35 49 <xs:element name="setting" type="setting" maxOccurs="unbounded" /> 36 50 </xs:sequence> 51 <xs:attribute name="prefix" type="xs:string" /> 37 52 </xs:complexType> 38 53 <xs:complexType name="setting"> … … 43 58 </xs:simpleContent> 44 59 </xs:complexType> 60 61 <xs:group name="exception_templates"> 62 <xs:choice> 63 <xs:element name="exception_templates" type="exception_templates" minOccurs="0" /> 64 <xs:element name="exception_template" type="exception_template" minOccurs="0" maxOccurs="unbounded" /> 65 </xs:choice> 66 </xs:group> 45 67 46 68 <xs:complexType name="exception_templates">

