Index: trunk/extensions/PageSchemas/PageSchemas.classes.php |
— | — | @@ -177,7 +177,7 @@ |
178 | 178 | $text .= self::parseField($child); |
179 | 179 | } |
180 | 180 | return $text; |
181 | | - } |
| 181 | + } |
182 | 182 | static function parseField ( $field_xml ) { |
183 | 183 | $name = $field_xml->attributes()->name; |
184 | 184 | $text = self::tableRowHTML('paramAttr', 'Field', $name); |
— | — | @@ -228,12 +228,12 @@ |
229 | 229 | }else{ |
230 | 230 | //retrievimg the third attribute which is pp_value |
231 | 231 | $pageXmlstr = $row[2]; |
232 | | - $pageXml = simplexml_load_string ( $pageXmlstr ); |
233 | | - $this->pageName = (string)$pageXml->attributes()->name; |
| 232 | + $this->pageXml = simplexml_load_string ( $pageXmlstr ); |
| 233 | + $this->pageName = (string)$this->pageXml->attributes()->name; |
234 | 234 | /* index for template objects */ |
235 | 235 | $i = 0; |
236 | 236 | $inherited_templates = null ; |
237 | | - foreach ( $pageXml->children() as $tag => $child ) { |
| 237 | + foreach ( $this->pageXml->children() as $tag => $child ) { |
238 | 238 | if ( $tag == 'InheritsFrom ' ) { |
239 | 239 | $schema_to_inherit = (string) $child->attributes()->schema; |
240 | 240 | if( $schema_to_inherit !=null ){ |
— | — | @@ -255,14 +255,7 @@ |
256 | 256 | } |
257 | 257 | } |
258 | 258 | } |
259 | | - } |
260 | | - if ( $tag == 'Form' ) { |
261 | | - $this->formName = (string) $child->attributes()->name; |
262 | | - $this->formArray['name'] = (string) $child->attributes()->name; |
263 | | - foreach ($child->children() as $tag => $formelem) { |
264 | | - $this->formArray[(string)$tag] = (string)$formelem; |
265 | | - } |
266 | | - } |
| 259 | + } |
267 | 260 | } |
268 | 261 | } |
269 | 262 | } |
— | — | @@ -272,7 +265,8 @@ |
273 | 266 | } |
274 | 267 | /*return an array of PSTemplate Objects */ |
275 | 268 | function getFormArray () { |
276 | | - return $this->formArray; |
| 269 | + $obj = $this->getObject('Form'); |
| 270 | + return $obj['sf']; |
277 | 271 | } |
278 | 272 | /*return an array of PSTemplate Objects */ |
279 | 273 | function isPSDefined () { |
— | — | @@ -287,8 +281,14 @@ |
288 | 282 | return $this->pageName; |
289 | 283 | } |
290 | 284 | function getFormName(){ |
291 | | - return $this->formName; |
| 285 | + $form_array = $this->getFormArray(); |
| 286 | + return $form_array['name']; |
292 | 287 | } |
| 288 | + function getObject( $objectName ) { |
| 289 | + $object = array(); |
| 290 | + wfRunHooks( 'PageSchemasGetObject', array( $objectName, $this->pageXml, &$object ) ); |
| 291 | + return $object; |
| 292 | + } |
293 | 293 | function getCategoryName(){ |
294 | 294 | return $this->categoryName; |
295 | 295 | } |