r80135 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80134‎ | r80135 | r80136 >
Date:00:08, 13 January 2011
Author:kaldari
Status:deferred
Tags:
Comment:
adding HideBanners Special Page
Modified paths:
  • /trunk/extensions/CentralNotice/1x1.png (added) (history)
  • /trunk/extensions/CentralNotice/CentralNotice.php (modified) (history)
  • /trunk/extensions/CentralNotice/SpecialHideBanners.php (added) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/CentralNotice.php
@@ -91,16 +91,19 @@
9292 $wgHooks['SiteNoticeAfter'][] = 'efCentralNoticeDisplay';
9393 $wgHooks['SkinAfterBottomScripts'][] = 'efCentralNoticeGeoLoader';
9494 }
95 -
 95+
9696 $wgSpecialPages['BannerLoader'] = 'SpecialBannerLoader';
9797 $wgAutoloadClasses['SpecialBannerLoader'] = $dir . 'SpecialBannerLoader.php';
98 -
 98+
9999 $wgSpecialPages['BannerListLoader'] = 'SpecialBannerListLoader';
100100 $wgAutoloadClasses['SpecialBannerListLoader'] = $dir . 'SpecialBannerListLoader.php';
101 -
 101+
102102 $wgSpecialPages['BannerController'] = 'SpecialBannerController';
103103 $wgAutoloadClasses['SpecialBannerController'] = $dir . 'SpecialBannerController.php';
104 -
 104+
 105+ $wgSpecialPages['HideBanners'] = 'SpecialHideBanners';
 106+ $wgAutoloadClasses['SpecialHideBanners'] = $dir . 'SpecialHideBanners.php';
 107+
105108 $wgAutoloadClasses['CentralNotice'] = $dir . 'SpecialCentralNotice.php';
106109 $wgAutoloadClasses['CentralNoticeDB'] = $dir . 'CentralNotice.db.php';
107110 $wgAutoloadClasses['TemplatePager'] = $dir . 'TemplatePager.php';
Index: trunk/extensions/CentralNotice/1x1.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/CentralNotice/1x1.png
___________________________________________________________________
Added: svn:mime-type
108111 + application/octet-stream
Index: trunk/extensions/CentralNotice/SpecialHideBanners.php
@@ -0,0 +1,33 @@
 2+<?php
 3+if ( !defined( 'MEDIAWIKI' ) ) {
 4+ echo "CentralNotice extension\n";
 5+ exit( 1 );
 6+}
 7+
 8+/**
 9+ * Unlisted Special page to set cookies for hiding banners across all wikis.
 10+ */
 11+class SpecialHideBanners extends UnlistedSpecialPage {
 12+ function __construct() {
 13+ parent::__construct( 'HideBanners' );
 14+ }
 15+
 16+ function execute( $par ) {
 17+ global $wgRequest, $wgOut;
 18+
 19+ $this->setGlobalCookie();
 20+
 21+ $wgOut->disable();
 22+ wfResetOutputBuffers();
 23+
 24+ header( 'Content-Type: image/png' );
 25+ header( 'Cache-Control: no-cache' );
 26+
 27+ readfile( dirname( __FILE__ ) . '/1x1.png' );
 28+ }
 29+
 30+ function setGlobalCookie() {
 31+ $exp = time() + 86400 * 14; // cookie expires after 2 weeks
 32+ setcookie( 'hidesnmessage', '0', $exp, '/' );
 33+ }
 34+}

Follow-up revisions

RevisionCommit summaryAuthorDate
r80136Followup r80135, svn:eol-style nativereedy00:10, 13 January 2011

Status & tagging log