r44889 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44888‎ | r44889 | r44890 >
Date:06:43, 22 December 2008
Author:aaron
Status:deferred
Tags:
Comment:
Enable hook only as needed
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -395,9 +395,6 @@
396396 # Backlog notice
397397 $wgHooks['SiteNoticeAfter'][] = 'FlaggedRevsHooks::addBacklogNotice';
398398
399 -# Visibility - experimental
400 -$wgHooks['userCan'][] = 'FlaggedRevsHooks::userCanView';
401 -
402399 # Override current revision, add patrol links, set cache...
403400 $wgHooks['ArticleViewHeader'][] = 'FlaggedRevsHooks::onArticleViewHeader';
404401 $wgHooks['ImagePageFindFile'][] = 'FlaggedRevsHooks::imagePageFindFile';
@@ -450,7 +447,7 @@
451448 #########
452449
453450 function efLoadFlaggedRevs() {
454 - global $wgUseRCPatrol, $wgFlaggedRevsNamespaces;
 451+ global $wgUseRCPatrol, $wgFlaggedRevsNamespaces, $wgFlaggedRevsVisible;
455452 # If patrolling is already on, then we know that it
456453 # was intended to have all namespaces patrollable.
457454 if( $wgUseRCPatrol ) {
@@ -462,6 +459,11 @@
463460 if( !empty($wgFlaggedRevsNamespaces) ) {
464461 $wgUseRCPatrol = true;
465462 }
 463+ # Visibility - experimental
 464+ if( !empty($wgFlaggedRevsVisible) ) {
 465+ global $wgHooks;
 466+ $wgHooks['userCan'][] = 'FlaggedRevsHooks::userCanView';
 467+ }
466468 }
467469
468470 /*

Status & tagging log