r93201 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93200‎ | r93201 | r93202 >
Date:16:19, 26 July 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
added al hook
Modified paths:
  • /trunk/extensions/SemanticWatchlist/SemanticWatchlist.hooks.php (modified) (history)
  • /trunk/extensions/SemanticWatchlist/SemanticWatchlist.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticWatchlist/SemanticWatchlist.php
@@ -92,7 +92,9 @@
9393
9494 $wgHooks['UserSaveOptions'][] = 'SWLHooks::onUserSaveOptions';
9595
 96+$wgHooks['AdminLinks'][] = 'SWLHooks::addToAdminLinks';
9697
 98+
9799 $moduleTemplate = array(
98100 'localBasePath' => dirname( __FILE__ ),
99101 'remoteBasePath' => $egSWLScriptPath
Index: trunk/extensions/SemanticWatchlist/SemanticWatchlist.hooks.php
@@ -259,4 +259,23 @@
260260 return true;
261261 }
262262
 263+ /**
 264+ * Adds a link to Admin Links page.
 265+ *
 266+ * @since 0.1
 267+ *
 268+ * @return true
 269+ */
 270+ public static function addToAdminLinks( &$admin_links_tree ) {
 271+ $displaying_data_section = $admin_links_tree->getSection( wfMsg( 'adminlinks_browsesearch' ) );
 272+
 273+ // Escape if SMW hasn't added links.
 274+ if ( is_null( $displaying_data_section ) ) return true;
 275+ $smw_docu_row = $displaying_data_section->getRow( 'smw' );
 276+
 277+ $smw_docu_row->addItem( AlItem::newFromSpecialPage( 'WatchlistConditions' ) );
 278+
 279+ return true;
 280+ }
 281+
263282 }
\ No newline at end of file