r99699 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99698‎ | r99699 | r99700 >
Date:16:46, 13 October 2011
Author:yaron
Status:deferred
Tags:
Comment:
hanged display of Page Schemas information to reflect changes in PS 0.2
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_PageSchemas.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_PageSchemas.php
@@ -12,17 +12,20 @@
1313
1414 class SMWPageSchemas {
1515
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 ) {
1721 foreach ( $field_xml->children() as $tag => $child ) {
1822 if ( $tag == "semanticmediawiki_Property" ) {
19 - $text = PageSchemas::tableMessageRowHTML( "paramAttr", wfMsg( 'specialpages-group-smw_group' ), wfMsg( 'smw_pp_type' ) );
2023 $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();
2325 foreach ( $child->children() as $prop => $value ) {
24 - $text .= PageSchemas::tableMessageRowHTML("paramAttrMsg", $prop, (string)$value );
 26+ $values[$prop] = (string)$value;
2527 }
26 - $text_object['smw'] = $text;
 28+ $text_object['smw'] = array( 'Semantic property', $propName, '#DEF', $values );
 29+ break;
2730 }
2831 }
2932 return true;
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php
@@ -98,7 +98,7 @@
9999 $wgHooks['PageSchemasGeneratePages'][] = 'SMWPageSchemas::generatePages';
100100 $wgHooks['PageSchemasGetFieldHTML'][] = 'SMWPageSchemas::getFieldHTML';
101101 $wgHooks['PageSchemasGetFieldXML'][] = 'SMWPageSchemas::getFieldXML';
102 - $wgHooks['PSParseFieldElements'][] = 'SMWPageSchemas::parseFieldElements';
 102+ $wgHooks['PageSchemasGetFieldDisplayInfo'][] = 'SMWPageSchemas::getPropertyDisplayInfo';
103103 $wgHooks['PageSchemasGetPageList'][] = 'SMWPageSchemas::getPageList';
104104 }
105105