Index: trunk/extensions/CentralNotice/SpecialNoticeText.php |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | |
25 | 25 | // Quick short circuit to be able to show preferred notices |
26 | 26 | $templates = array(); |
27 | | - |
| 27 | + |
28 | 28 | if ( $this->language == 'en' && $this->project != null ) { |
29 | 29 | // See if we have any preferred notices for all of en |
30 | 30 | $notices = CentralNoticeDB::getNotices( '', 'en', '', '', 1 ); |
— | — | @@ -39,9 +39,25 @@ |
40 | 40 | } |
41 | 41 | } |
42 | 42 | } |
| 43 | + |
| 44 | + if ( !$templates ) { |
| 45 | + if ( $this->project == 'wikipedia' ) { |
| 46 | + $notices = CentralNoticeDB::getNotices( 'wikipedia', '', '', '', 1 ); |
| 47 | + foreach( $notices as $notice => $val ) { |
| 48 | + if ( $val['language'] == '' || |
| 49 | + $val['language'] == $this->language ) { |
| 50 | + $templates = CentralNoticeDB::selectTemplatesAssigned( $notice ); |
| 51 | + break; |
| 52 | + } |
| 53 | + } |
| 54 | + |
| 55 | + } |
| 56 | + } |
| 57 | + |
43 | 58 | // Didn't find any preferred matches so do an old style lookup |
44 | | - if ( !$templates ) |
| 59 | + if ( !$templates ) { |
45 | 60 | $templates = CentralNotice::selectNoticeTemplates( $this->project, $this->language ); |
| 61 | + } |
46 | 62 | |
47 | 63 | $templateNames = array_keys( $templates ); |
48 | 64 | |