r99698 MediaWiki - Code Review archive

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

Diff [purge]

Index: trunk/extensions/SemanticDrilldown/includes/SD_PageSchemas.php
@@ -211,13 +211,14 @@
212212 }
213213
214214 /**
215 - * Displays the information about filters contained in the
216 - * Page Schemas XML.
 215+ * Displays the information about the filter (if any exists)
 216+ * for one field in the Page Schemas XML.
217217 */
218 - public static function parseFieldElements( $field_xml, &$text_object ) {
 218+ public static function getFilterDisplayInfo( $field_xml, &$text_object ) {
219219 foreach ( $field_xml->children() as $tag => $child ) {
220220 if ( $tag == "semanticdrilldown_Filter" ) {
221 - $text = PageSchemas::tableMessageRowHTML( "paramAttr", wfMsg( 'specialpages-group-sd_group' ), "Filter" );
 221+ $filterName = $child->attributes()->name;
 222+ $values = array();
222223 foreach ( $child->children() as $prop => $value) {
223224 if ( $prop == "Values" ) {
224225 $filterValues = array();
@@ -225,12 +226,12 @@
226227 $filterValues[] = (string)$valTag;
227228 }
228229 $valuesStr = implode( ', ', $filterValues );
229 - $text .= PageSchemas::tableMessageRowHTML("paramAttrMsg", wfMsg( 'sd-pageschemas-values' ), $valuesStr );
 230+ $values[wfMsg( 'sd-pageschemas-values' )] = $valuesStr;
230231 } else {
231 - $text .= PageSchemas::tableMessageRowHTML("paramAttrMsg", $prop, $value );
 232+ $values[$prop] = $value;
232233 }
233234 }
234 - $text_object['sd'] = $text;
 235+ $text_object['sd'] = array( 'Filter', $filterName, '#FEE', $values );
235236 }
236237 }
237238 return true;
Index: trunk/extensions/SemanticDrilldown/SemanticDrilldown.php
@@ -13,7 +13,7 @@
1414
1515 if ( !defined( 'MEDIAWIKI' ) ) die();
1616
17 -define( 'SD_VERSION', '0.8.4 alpha' );
 17+define( 'SD_VERSION', '0.8.3' );
1818
1919 $wgExtensionCredits[defined( 'SEMANTIC_EXTENSION_TYPE' ) ? 'semantic' : 'specialpage'][] = array(
2020 'path' => __FILE__,
@@ -65,7 +65,7 @@
6666 $wgHooks['MagicWordwgVariableIDs'][] = 'SDUtils::addMagicWordVariableIDs';
6767 $wgHooks['LanguageGetMagic'][] = 'SDUtils::addMagicWordLanguage';
6868 $wgHooks['ParserBeforeTidy'][] = 'SDUtils::handleShowAndHide';
69 -$wgHooks['PSParseFieldElements'][] = 'SDPageSchemas::parseFieldElements';
 69+$wgHooks['PageSchemasGetFieldDisplayInfo'][] = 'SDPageSchemas::getFilterDisplayInfo';
7070 $wgHooks['PageSchemasGetObject'][] = 'SDPageSchemas::createPageSchemasObject';
7171 $wgHooks['PageSchemasGetFieldHTML'][] = 'SDPageSchemas::getFieldHTML';
7272 $wgHooks['PageSchemasGetFieldXML'][] = 'SDPageSchemas::getFieldXML';