r80078 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80077‎ | r80078 | r80079 >
Date:02:26, 12 January 2011
Author:kaldari
Status:deferred
Tags:
Comment:
new hidden banners stuff
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/SpecialHideBanners.php (added) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/includes/1x1.png (added) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/includes/1x1.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/DonationInterface/payflowpro_gateway/includes/1x1.png
___________________________________________________________________
Added: svn:mime-type
11 + application/octet-stream
Index: trunk/extensions/DonationInterface/payflowpro_gateway/SpecialHideBanners.php
@@ -0,0 +1,36 @@
 2+<?php
 3+if ( !defined( 'MEDIAWIKI' ) ) {
 4+ die( 'DonationInterface' );
 5+}
 6+
 7+/**
 8+ * Unlisted Special page to set cookies for hiding banners across all wikis.
 9+ *
 10+ * @ingroup Extensions
 11+ */
 12+class SpecialHideBanners extends UnlistedSpecialPage {
 13+ function __construct() {
 14+ parent::__construct( 'HideBanners' );
 15+ }
 16+
 17+ function execute( $par ) {
 18+ global $wgRequest, $wgOut;
 19+
 20+ $this->setGlobalCookies();
 21+
 22+ $wgOut->disable();
 23+
 24+ wfResetOutputBuffers();
 25+ //header( "Content-type: text/html; charset=utf-8" );
 26+ header( 'Content-Type: image/png' );
 27+ header( 'Cache-Control: no-cache' );
 28+
 29+ readfile( dirname( __FILE__ ) . '/includes/1x1.png' );
 30+ }
 31+
 32+ function setGlobalCookies() {
 33+ global $wgRequest;
 34+ $exp = time() + 86400 * 14; // 2 weeks
 35+ setcookie( 'hidesnmessage', '0', $exp, '/' );
 36+ }
 37+}
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php
@@ -45,6 +45,8 @@
4646 $wgExtensionMessagesFiles['PayflowProGatewayUSStates'] = $dir . 'payflowpro_gateway.us-states.i18n.php';
4747 $wgExtensionAliasesFiles['PayflowProGateway'] = $dir . 'payflowpro_gateway.alias.php';
4848 $wgSpecialPages['PayflowProGateway'] = 'PayflowProGateway';
 49+$wgSpecialPages['HideBanners'] = 'SpecialHideBanners';
 50+$wgAutoloadClasses['SpecialHideBanners'] = $dir . 'SpecialHideBanners.php';
4951 $wgAjaxExportList[] = "fnPayflowProofofWork";
5052
5153

Status & tagging log