Index: trunk/extensions/SemanticMediaWiki/includes/SMW_PageSchemas.php |
— | — | @@ -12,17 +12,20 @@ |
13 | 13 | |
14 | 14 | class SMWPageSchemas { |
15 | 15 | |
16 | | - function parseFieldElements( $field_xml, &$text_object ) { |
| 16 | + /** |
| 17 | + * Returns the display info for the property (if any is defined) |
| 18 | + * for a single field in the Page Schemas XML. |
| 19 | + */ |
| 20 | + function getPropertyDisplayInfo( $field_xml, &$text_object ) { |
17 | 21 | foreach ( $field_xml->children() as $tag => $child ) { |
18 | 22 | if ( $tag == "semanticmediawiki_Property" ) { |
19 | | - $text = PageSchemas::tableMessageRowHTML( "paramAttr", wfMsg( 'specialpages-group-smw_group' ), wfMsg( 'smw_pp_type' ) ); |
20 | 23 | $propName = $child->attributes()->name; |
21 | | - // this means object has already been initialized by some other extension. |
22 | | - $text .= PageSchemas::tableMessageRowHTML( "paramAttrMsg", "name", (string)$propName ); |
| 24 | + $values = array(); |
23 | 25 | foreach ( $child->children() as $prop => $value ) { |
24 | | - $text .= PageSchemas::tableMessageRowHTML("paramAttrMsg", $prop, (string)$value ); |
| 26 | + $values[$prop] = (string)$value; |
25 | 27 | } |
26 | | - $text_object['smw'] = $text; |
| 28 | + $text_object['smw'] = array( 'Semantic property', $propName, '#DEF', $values ); |
| 29 | + break; |
27 | 30 | } |
28 | 31 | } |
29 | 32 | return true; |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php |
— | — | @@ -98,7 +98,7 @@ |
99 | 99 | $wgHooks['PageSchemasGeneratePages'][] = 'SMWPageSchemas::generatePages'; |
100 | 100 | $wgHooks['PageSchemasGetFieldHTML'][] = 'SMWPageSchemas::getFieldHTML'; |
101 | 101 | $wgHooks['PageSchemasGetFieldXML'][] = 'SMWPageSchemas::getFieldXML'; |
102 | | - $wgHooks['PSParseFieldElements'][] = 'SMWPageSchemas::parseFieldElements'; |
| 102 | + $wgHooks['PageSchemasGetFieldDisplayInfo'][] = 'SMWPageSchemas::getPropertyDisplayInfo'; |
103 | 103 | $wgHooks['PageSchemasGetPageList'][] = 'SMWPageSchemas::getPageList'; |
104 | 104 | } |
105 | 105 | |