r108113 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108112‎ | r108113 | r108114 >
Date:02:29, 5 January 2012
Author:jeroendedauw
Status:ok
Tags:
Comment:
added bug nr in rel notes and moved some hooks
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/SemanticMediaWiki.hooks.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/RELEASE-NOTES
@@ -8,8 +8,8 @@
99 Semantic MediaWiki 1.7.1 is currently in beta-quality and is not recommended for use in
1010 production until the actual release.
1111
12 -* Fixed bug in "further results" links causing the main column to be displayed twice on Special:Ask.
13 -* Fixed #ask and #show 'format' parameter which now is case-insensitive again (bug 31138).
 12+* Fixed bug in "further results" links causing the main column to be displayed twice on Special:Ask (bug 33473).
 13+* Fixed incorrect case-sensitivity of the format parameter (bug 31138).
1414
1515 == SMW 1.7 ==
1616
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php
@@ -78,7 +78,7 @@
7979 // FIXME: The following can be removed when new style magic words are used (introduced in r52503)
8080 $wgHooks['LanguageGetMagic'][] = 'smwfAddMagicWords'; // setup names for parser functions (needed here)
8181
82 - $wgHooks['ParserTestTables'][] = 'smwfOnParserTestTables';
 82+ $wgHooks['ParserTestTables'][] = 'SMWHooks::onParserTestTables';
8383 $wgHooks['AdminLinks'][] = 'SMWHooks::addToAdminLinks';
8484 $wgHooks['PageSchemasRegisterHandlers'][] = 'SMWHooks::onPageSchemasRegistration';
8585
@@ -98,7 +98,7 @@
9999 $wgHooks['ParserFirstCallInit'][] = 'SMWHooks::onParserFirstCallInit';
100100
101101 if ( $GLOBALS['smwgToolboxBrowseLink'] ) {
102 - $wgHooks['SkinTemplateToolboxEnd'][] = 'smwfShowBrowseLink';
 102+ $wgHooks['SkinTemplateToolboxEnd'][] = 'SMWHooks::showBrowseLink';
103103 }
104104
105105 $wgHooks['SkinAfterContent'][] = 'SMWFactbox::onSkinAfterContent'; // draw Factbox below categories
@@ -106,10 +106,10 @@
107107
108108 if ( version_compare( $wgVersion, '1.17alpha', '>=' ) ) {
109109 // For MediaWiki 1.17 alpha and later.
110 - $wgHooks['ExtensionTypes'][] = 'smwfAddSemanticExtensionType';
 110+ $wgHooks['ExtensionTypes'][] = 'SMWHooks::addSemanticExtensionType';
111111 } else {
112112 // For pre-MediaWiki 1.17 alpha.
113 - $wgHooks['SpecialVersionExtensionTypes'][] = 'smwfOldAddSemanticExtensionType';
 113+ $wgHooks['SpecialVersionExtensionTypes'][] = 'SMWHooks::oldAddSemanticExtensionType';
114114 }
115115 }
116116
@@ -434,67 +434,6 @@
435435 return true;
436436 }
437437
438 -/**
439 - * Adds the 'semantic' extension type to the type list.
440 - *
441 - * @since 1.5.2
442 - *
443 - * @param $aExtensionTypes Array
444 - *
445 - * @return true
446 - */
447 -function smwfAddSemanticExtensionType( array &$aExtensionTypes ) {
448 - $aExtensionTypes = array_merge( array( 'semantic' => wfMsg( 'version-semantic' ) ), $aExtensionTypes );
449 - return true;
450 -}
451 -
452 -/**
453 - * @see smwfAddSemanticExtensionType
454 - *
455 - * @since 1.5.2
456 - *
457 - * @param $oSpecialVersion SpecialVersion
458 - * @param $aExtensionTypes Array
459 - *
460 - * @return true
461 - */
462 -function smwfOldAddSemanticExtensionType( SpecialVersion &$oSpecialVersion, array &$aExtensionTypes ) {
463 - return smwfAddSemanticExtensionType( $aExtensionTypes );
464 -}
465 -
466 -/**
467 - * Register tables to be added to temporary tables for parser tests.
468 - * @todo Hard-coding this thwarts the modularity/exchangability of the SMW
469 - * storage backend. The actual list of required tables depends on the backend
470 - * implementation and cannot really be fixed here.
471 - */
472 -function smwfOnParserTestTables( &$tables ) {
473 - $tables[] = 'smw_ids';
474 - $tables[] = 'smw_redi2';
475 - $tables[] = 'smw_atts2';
476 - $tables[] = 'smw_rels2';
477 - $tables[] = 'smw_text2';
478 - $tables[] = 'smw_spec2';
479 - $tables[] = 'smw_inst2';
480 - $tables[] = 'smw_subs2';
481 - return true;
482 -}
483 -
484 -/**
485 - * Add a link to the toolbox to view the properties of the current page in
486 - * Special:Browse. The links has the CSS id "t-smwbrowselink" so that it can be
487 - * skinned or hidden with all standard mechanisms (also by individual users
488 - * with custom CSS).
489 - */
490 -function smwfShowBrowseLink( $skintemplate ) {
491 - if ( $skintemplate->data['isarticle'] ) {
492 - $browselink = SMWInfolink::newBrowsingLink( wfMsg( 'smw_browselink' ),
493 - $skintemplate->data['titleprefixeddbkey'], false );
494 - echo '<li id="t-smwbrowselink">' . $browselink->getHTML() . '</li>';
495 - }
496 - return true;
497 -}
498 -
499438 /**********************************************/
500439 /***** namespace settings *****/
501440 /**********************************************/
Index: trunk/extensions/SemanticMediaWiki/SemanticMediaWiki.hooks.php
@@ -161,4 +161,77 @@
162162 return true;
163163 }
164164
 165+ /**
 166+ * Adds the 'semantic' extension type to the type list.
 167+ *
 168+ * @since 1.7.1
 169+ *
 170+ * @param $aExtensionTypes Array
 171+ *
 172+ * @return true
 173+ */
 174+ public static function addSemanticExtensionType( array &$aExtensionTypes ) {
 175+ $aExtensionTypes = array_merge( array( 'semantic' => wfMsg( 'version-semantic' ) ), $aExtensionTypes );
 176+ return true;
 177+ }
 178+
 179+ /**
 180+ * @see SMWHooks::addSemanticExtensionType
 181+ *
 182+ * @since 1.7.1
 183+ *
 184+ * @param $oSpecialVersion SpecialVersion
 185+ * @param $aExtensionTypes Array
 186+ *
 187+ * @return true
 188+ */
 189+ public static function oldAddSemanticExtensionType( SpecialVersion &$oSpecialVersion, array &$aExtensionTypes ) {
 190+ return self::addSemanticExtensionType( $aExtensionTypes );
 191+ }
 192+
 193+ /**
 194+ * Register tables to be added to temporary tables for parser tests.
 195+ * @todo Hard-coding this thwarts the modularity/exchangability of the SMW
 196+ * storage backend. The actual list of required tables depends on the backend
 197+ * implementation and cannot really be fixed here.
 198+ *
 199+ * @since 1.7.1
 200+ *
 201+ * @param array $tables
 202+ *
 203+ * @return true
 204+ */
 205+ public static function onParserTestTables( array &$tables ) {
 206+ $tables[] = 'smw_ids';
 207+ $tables[] = 'smw_redi2';
 208+ $tables[] = 'smw_atts2';
 209+ $tables[] = 'smw_rels2';
 210+ $tables[] = 'smw_text2';
 211+ $tables[] = 'smw_spec2';
 212+ $tables[] = 'smw_inst2';
 213+ $tables[] = 'smw_subs2';
 214+ return true;
 215+ }
 216+
 217+ /**
 218+ * Add a link to the toolbox to view the properties of the current page in
 219+ * Special:Browse. The links has the CSS id "t-smwbrowselink" so that it can be
 220+ * skinned or hidden with all standard mechanisms (also by individual users
 221+ * with custom CSS).
 222+ *
 223+ * @since 1.7.1
 224+ *
 225+ * @param $skintemplate
 226+ *
 227+ * @return true
 228+ */
 229+ public static function showBrowseLink( $skintemplate ) {
 230+ if ( $skintemplate->data['isarticle'] ) {
 231+ $browselink = SMWInfolink::newBrowsingLink( wfMsg( 'smw_browselink' ),
 232+ $skintemplate->data['titleprefixeddbkey'], false );
 233+ echo '<li id="t-smwbrowselink">' . $browselink->getHTML() . '</li>';
 234+ }
 235+ return true;
 236+ }
 237+
165238 }

Status & tagging log