Index: trunk/extensions/MobileFrontend/SopaNoticeTemplate.php |
— | — | @@ -0,0 +1,22 @@ |
| 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 | + <br/> |
| 19 | + </div> |
| 20 | +HTML; |
| 21 | + return $noticeHtml; |
| 22 | + } |
| 23 | +} |
Property changes on: trunk/extensions/MobileFrontend/SopaNoticeTemplate.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 24 | + 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( |
— | — | @@ -676,6 +678,10 @@ |
677 | 679 | $this->sendApplicationVersionVaryHeader(); |
678 | 680 | $this->checkUserStatus(); |
679 | 681 | $this->checkUserLoggedIn(); |
| 682 | + |
| 683 | + if (self::$code === 'en') { |
| 684 | + self::$displayNoticeId = 2; |
| 685 | + } |
680 | 686 | |
681 | 687 | if ( self::$title->isSpecial( 'Userlogin' ) && self::$isBetaGroupMember ) { |
682 | 688 | self::$wsLoginToken = $wgRequest->getSessionData( 'wsLoginToken' ); |
— | — | @@ -1585,6 +1591,14 @@ |
1586 | 1592 | } |
1587 | 1593 | } |
1588 | 1594 | |
| 1595 | + if ( !empty( self::$displayNoticeId ) ) { |
| 1596 | + if ( intval( self::$displayNoticeId ) === 2 ) { |
| 1597 | + $sopaNoticeTemplate = new SopaNoticeTemplate(); |
| 1598 | + $sopaNoticeTemplate->set( 'messages', self::$messages ); |
| 1599 | + $noticeHtml = $sopaNoticeTemplate->getHTML(); |
| 1600 | + } |
| 1601 | + } |
| 1602 | + |
1589 | 1603 | // header( 'Content-Type: application/xhtml+xml; charset=utf-8' ); |
1590 | 1604 | $searchTemplate = $this->getSearchTemplate(); |
1591 | 1605 | $searchWebkitHtml = $searchTemplate->getHTML(); |
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' => '<strong>IMAGINE A WORLD WITHOUT FREE KNOWLEDGE</strong>,<br/>Right now, the U.S. Congress is considering legislation that could cripple this site<br/> and your ability to access information online. <a href="http://en.wikipedia.org/wiki/Wikipedia:SOPA_initiative/Mobile_Learn_more">Learn more</a>.', |
78 | 79 | ); |
79 | 80 | |
80 | 81 | /** Message documentation (Message documentation) |
— | — | @@ -4492,7 +4493,6 @@ |
4493 | 4494 | 'mobile-frontend-password' => 'Wachtwoord:', |
4494 | 4495 | 'mobile-frontend-login' => 'Aanmelden', |
4495 | 4496 | 'mobile-frontend-placeholder' => 'Zoeken...', |
4496 | | - 'mobile-frontend-dismiss-notification' => 'deze melding verwijderen', |
4497 | 4497 | ); |
4498 | 4498 | |
4499 | 4499 | /** Nederlands (informeel) (Nederlands (informeel)) |
Index: trunk/extensions/MobileFrontend/stylesheets/common.css |
— | — | @@ -287,4 +287,15 @@ |
288 | 288 | table td, table th { |
289 | 289 | border: 1px solid #cccccc; |
290 | 290 | padding: 3px; |
| 291 | +} |
| 292 | + |
| 293 | +.mwm-message.mwm-notice { |
| 294 | + background: #FFFFFF; |
| 295 | + font-size: 1.1em; |
| 296 | + color: #000000; |
| 297 | +} |
| 298 | +.mwm-message.mwm-notice a { |
| 299 | + text-decoration: underline; |
| 300 | + font-weight: bold; |
| 301 | + color: #000000; |
291 | 302 | } |
\ No newline at end of file |
Index: trunk/extensions/MobileFrontend/stylesheets/beta_common.css |
— | — | @@ -312,4 +312,15 @@ |
313 | 313 | table td, table th { |
314 | 314 | border: 1px solid #cccccc; |
315 | 315 | padding: 3px; |
| 316 | +} |
| 317 | + |
| 318 | +.mwm-message.mwm-notice { |
| 319 | + background: #000000; |
| 320 | + font-size: 1.1em; |
| 321 | + color: #ffffff; |
| 322 | +} |
| 323 | +.mwm-message.mwm-notice a { |
| 324 | + text-decoration: underline; |
| 325 | + font-weight: bold; |
| 326 | + color: #ffffff; |
316 | 327 | } |
\ No newline at end of file |