Index: trunk/extensions/CentralNotice/CentralNotice.php |
— | — | @@ -91,16 +91,19 @@ |
92 | 92 | $wgHooks['SiteNoticeAfter'][] = 'efCentralNoticeDisplay'; |
93 | 93 | $wgHooks['SkinAfterBottomScripts'][] = 'efCentralNoticeGeoLoader'; |
94 | 94 | } |
95 | | - |
| 95 | + |
96 | 96 | $wgSpecialPages['BannerLoader'] = 'SpecialBannerLoader'; |
97 | 97 | $wgAutoloadClasses['SpecialBannerLoader'] = $dir . 'SpecialBannerLoader.php'; |
98 | | - |
| 98 | + |
99 | 99 | $wgSpecialPages['BannerListLoader'] = 'SpecialBannerListLoader'; |
100 | 100 | $wgAutoloadClasses['SpecialBannerListLoader'] = $dir . 'SpecialBannerListLoader.php'; |
101 | | - |
| 101 | + |
102 | 102 | $wgSpecialPages['BannerController'] = 'SpecialBannerController'; |
103 | 103 | $wgAutoloadClasses['SpecialBannerController'] = $dir . 'SpecialBannerController.php'; |
104 | | - |
| 104 | + |
| 105 | + $wgSpecialPages['HideBanners'] = 'SpecialHideBanners'; |
| 106 | + $wgAutoloadClasses['SpecialHideBanners'] = $dir . 'SpecialHideBanners.php'; |
| 107 | + |
105 | 108 | $wgAutoloadClasses['CentralNotice'] = $dir . 'SpecialCentralNotice.php'; |
106 | 109 | $wgAutoloadClasses['CentralNoticeDB'] = $dir . 'CentralNotice.db.php'; |
107 | 110 | $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 |
108 | 111 | + 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 | +} |