Index: trunk/extensions/PageSchemas/specials/PS_EditSchema.php |
— | — | @@ -195,7 +195,11 @@ |
196 | 196 | $Xmltext .= $ps_add_xml; |
197 | 197 | $fieldName = ""; |
198 | 198 | $fieldNum= -1; |
199 | | - $templateNum = -1; |
| 199 | + $templateNum = -1; |
| 200 | + $xml_text_extensions = array(); //This var. will save the xml text returned by the extensions |
| 201 | + $js_extensions = array(); |
| 202 | + wfRunHooks( 'getXmlTextForFieldInputs', array( $wgRequest, &$xml_text_extensions )); |
| 203 | + $indexGlobalField = 0 ; //this variable is use to index the array returned by extensions for XML. |
200 | 204 | foreach ( $wgRequest->getValues() as $var => $val ) { |
201 | 205 | if(substr($var,0,7) == 't_name_'){ |
202 | 206 | $templateNum = substr($var,7,1); |
— | — | @@ -219,13 +223,11 @@ |
220 | 224 | } |
221 | 225 | }else if(substr($var,0,8) == 'f_label_'){ |
222 | 226 | $Xmltext .= '<Label>'.$val.'</Label>'; |
223 | | - //Get Xml parsed from extensions, |
224 | | - $text_extensions = array(); //This var. will save the html text returned by the extensions |
225 | | - $js_extensions = array(); |
226 | | - wfRunHooks( 'getXmlTextForFieldInputs', array( $wgRequest, &$text_extensions )); |
227 | | - foreach( $text_extensions as $text_ex ){ |
228 | | - $Xmltext .= $text_ex ; |
| 227 | + //Get Xml parsed from extensions, |
| 228 | + foreach( $xml_text_extensions as $xml_ex_array ){ |
| 229 | + $Xmltext .= $xml_ex_array[$indexGlobalField] ; |
229 | 230 | } |
| 231 | + $indexGlobalField++ ; |
230 | 232 | }else if(substr($var,0,10) == 'f_add_xml_'){ |
231 | 233 | $Xmltext .= $val; |
232 | 234 | $Xmltext .= '</Field>'; |
— | — | @@ -278,7 +280,9 @@ |
279 | 281 | if( ($row[1] == 'PageSchema') && ($row[2] != null )){ |
280 | 282 | //Populate the form here with autocompleted values |
281 | 283 | $pageXmlstr = $row[2]; |
282 | | - $pageXml = simplexml_load_string ( $pageXmlstr ); |
| 284 | + wfDebugLog( 'myextension', 'Something is not right: ' . print_r( $pageXmlstr, true ) ); |
| 285 | + $pageXml = simplexml_load_string ( $pageXmlstr ); |
| 286 | + |
283 | 287 | $pageName = (string)$pageXml->attributes()->name; |
284 | 288 | $text_4 .= ''; |
285 | 289 | $text_4 .= '<form id="editPageSchemaForm" action="" method="post">' . "\n"; |