Index: trunk/extensions/PageSchemas/PageSchemas.classes.php |
— | — | @@ -144,10 +144,11 @@ |
145 | 145 | $text .= self::tableRowHTML( 'pageSchemaHeader', 'Page schema' ); |
146 | 146 | |
147 | 147 | foreach ( $wgPageSchemasHandlerClasses as $psHandlerClass ) { |
148 | | - list( $elementName, $values ) = call_user_func( array( $psHandlerClass, 'getSchemaDisplayValues' ), $schemaXML ); |
149 | | - if ( is_null( $elementName ) ) { |
| 148 | + $returnVals = call_user_func( array( $psHandlerClass, 'getSchemaDisplayValues' ), $schemaXML ); |
| 149 | + if ( count( $returnVals ) != 2 ) { |
150 | 150 | continue; |
151 | 151 | } |
| 152 | + list( $elementName, $values ) = $returnVals; |
152 | 153 | $label = call_user_func( array( $psHandlerClass, 'getSchemaDisplayString' ) ); |
153 | 154 | $bgColor = call_user_func( array( $psHandlerClass, 'getDisplayColor' ) ); |
154 | 155 | $text .= self::tableRowHTML( 'schemaExtensionRow', $label, $elementName, $bgColor ); |
— | — | @@ -175,10 +176,11 @@ |
176 | 177 | } |
177 | 178 | |
178 | 179 | foreach ( $wgPageSchemasHandlerClasses as $psHandlerClass ) { |
179 | | - list( $elementName, $values ) = call_user_func( array( $psHandlerClass, 'getTemplateDisplayValues' ), $templateXML ); |
180 | | - if ( is_null( $elementName ) ) { |
| 180 | + $returnVals = call_user_func( array( $psHandlerClass, 'getTemplateDisplayValues' ), $templateXML ); |
| 181 | + if ( count( $returnVals ) != 2 ) { |
181 | 182 | continue; |
182 | 183 | } |
| 184 | + list( $elementName, $values ) = $returnVals; |
183 | 185 | $label = call_user_func( array( $psHandlerClass, 'getTemplateDisplayString' ) ); |
184 | 186 | $bgColor = call_user_func( array( $psHandlerClass, 'getDisplayColor' ) ); |
185 | 187 | $text .= self::tableRowHTML( 'fieldExtensionRow', $label, $elementName, $bgColor ); |
— | — | @@ -214,10 +216,11 @@ |
215 | 217 | // Let extensions that store data within the Page Schemas XML |
216 | 218 | // each handle displaying their data, by adding to this array. |
217 | 219 | foreach ( $wgPageSchemasHandlerClasses as $psHandlerClass ) { |
218 | | - list( $elementName, $values ) = call_user_func( array( $psHandlerClass, 'getFieldDisplayValues' ), $fieldXML ); |
219 | | - if ( is_null( $elementName ) ) { |
| 220 | + $returnVals = call_user_func( array( $psHandlerClass, 'getFieldDisplayValues' ), $fieldXML ); |
| 221 | + if ( count( $returnVals ) != 2 ) { |
220 | 222 | continue; |
221 | 223 | } |
| 224 | + list( $elementName, $values ) = $returnVals; |
222 | 225 | $label = call_user_func( array( $psHandlerClass, 'getFieldDisplayString' ) ); |
223 | 226 | $bgColor = call_user_func( array( $psHandlerClass, 'getDisplayColor' ) ); |
224 | 227 | $text .= self::tableRowHTML( 'fieldExtensionRow', $label, $elementName, $bgColor ); |