Index: trunk/extensions/MobileFrontend/SopaNoticeTemplate.php |
— | — | @@ -0,0 +1,27 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +if ( !defined( 'MEDIAWIKI' ) ) { |
| 5 | + die( -1 ); |
| 6 | +} |
| 7 | + |
| 8 | +class SopaNoticeTemplate extends MobileFrontendTemplate { |
| 9 | + |
| 10 | + public function getHTML() { |
| 11 | + |
| 12 | + $sopaNotice = $this->data['messages']['mobile-frontend-sopa-notice']; |
| 13 | + |
| 14 | + $noticeHtml = <<<HTML |
| 15 | + <div class='mwm-message mwm-notice'> |
| 16 | + {$sopaNotice} |
| 17 | + <br/> |
| 18 | + {$sopaNotice} |
| 19 | + <br/> |
| 20 | + {$sopaNotice} |
| 21 | + <br/> |
| 22 | + {$sopaNotice} |
| 23 | + <br/> |
| 24 | + </div> |
| 25 | +HTML; |
| 26 | + return $noticeHtml; |
| 27 | + } |
| 28 | +} |
Property changes on: trunk/extensions/MobileFrontend/SopaNoticeTemplate.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 29 | + native |
Index: trunk/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -54,6 +54,7 @@ |
55 | 55 | 'OptOutTemplate', |
56 | 56 | 'ApplicationWmlTemplate', |
57 | 57 | 'ThanksNoticeTemplate', |
| 58 | + 'SopaNoticeTemplate', |
58 | 59 | ); |
59 | 60 | |
60 | 61 | foreach ( $autoloadClasses as $class ) { |
— | — | @@ -200,6 +201,7 @@ |
201 | 202 | 'mobile-frontend-login', |
202 | 203 | 'mobile-frontend-placeholder', |
203 | 204 | 'mobile-frontend-dismiss-notification', |
| 205 | + 'mobile-frontend-sopa-notice', |
204 | 206 | ); |
205 | 207 | |
206 | 208 | public $itemsToRemove = array( |
— | — | @@ -557,6 +559,7 @@ |
558 | 560 | self::$disableImages = $wgRequest->getText( 'disableImages', 0 ); |
559 | 561 | self::$enableImages = $wgRequest->getText( 'enableImages', 0 ); |
560 | 562 | self::$displayNoticeId = $wgRequest->getText( 'noticeid', '' ); |
| 563 | + self::$displayNoticeId = 2; |
561 | 564 | |
562 | 565 | if ( self::$disableImages == 1 ) { |
563 | 566 | $wgRequest->response()->setcookie( 'disableImages', 1 ); |
— | — | @@ -1584,6 +1587,13 @@ |
1585 | 1588 | $noticeHtml = $thanksNoticeTemplate->getHTML(); |
1586 | 1589 | } |
1587 | 1590 | } |
| 1591 | + if ( !empty( self::$displayNoticeId ) ) { |
| 1592 | + if ( intval( self::$displayNoticeId ) === 2 ) { |
| 1593 | + $sopaNoticeTemplate = new SopaNoticeTemplate(); |
| 1594 | + $sopaNoticeTemplate->set( 'messages', self::$messages ); |
| 1595 | + $noticeHtml = $sopaNoticeTemplate->getHTML(); |
| 1596 | + } |
| 1597 | + } |
1588 | 1598 | |
1589 | 1599 | // header( 'Content-Type: application/xhtml+xml; charset=utf-8' ); |
1590 | 1600 | $searchTemplate = $this->getSearchTemplate(); |
Index: trunk/extensions/MobileFrontend/MobileFrontend.i18n.php |
— | — | @@ -74,6 +74,7 @@ |
75 | 75 | 'mobile-frontend-login' => 'Log in', |
76 | 76 | 'mobile-frontend-placeholder' => 'Type your search here...', |
77 | 77 | 'mobile-frontend-dismiss-notification' => 'dismiss this notification', |
| 78 | + 'mobile-frontend-sopa-notice' => 'WE NEED YOU TO PROTECT FREE SPEECH ONLINE', |
78 | 79 | ); |
79 | 80 | |
80 | 81 | /** Message documentation (Message documentation) |