r96911 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96910‎ | r96911 | r96912 >
Date:21:40, 12 September 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
added admin links hook
Modified paths:
  • /trunk/extensions/Survey/Survey.hooks.php (modified) (history)
  • /trunk/extensions/Survey/Survey.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Survey/Survey.php
@@ -91,6 +91,7 @@
9292 $wgHooks['UnitTestsList'][] = 'SurveyHooks::registerUnitTests';
9393 $wgHooks['ParserFirstCallInit'][] = 'SurveyHooks::onParserFirstCallInit';
9494 $wgHooks['ArticleViewHeader'][] = 'SurveyHooks::onArticleViewHeader';
 95+$wgHooks['AdminLinks'][] = 'SurveyHooks::addToAdminLinks';
9596
9697 $wgAvailableRights[] = 'surveyadmin';
9798 $wgAvailableRights[] = 'surveysubmit';
Index: trunk/extensions/Survey/Survey.hooks.php
@@ -169,4 +169,20 @@
170170 return true;
171171 }
172172
 173+ /**
 174+ * Adds a link to Admin Links page.
 175+ *
 176+ * @since 0.1
 177+ *
 178+ * @return true
 179+ */
 180+ public static function addToAdminLinks( &$admin_links_tree ) {
 181+ $section = new ALSection( 'Survey' );
 182+ $row = new ALRow( 'smw' );
 183+ $row->addItem( AlItem::newFromSpecialPage( 'Surveys' ) );
 184+ $section->addRow( $row );
 185+ $admin_links_tree->addSection( $section, 'Survey' );
 186+ return true;
 187+ }
 188+
173189 }

Status & tagging log