r59194 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59193‎ | r59194 | r59195 >
Date:09:39, 18 November 2009
Author:tomasz
Status:ok
Tags:
Comment:
adding the ability to have the preferred setting for wikipedia as a project
Modified paths:
  • /trunk/extensions/CentralNotice/SpecialNoticeText.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/SpecialNoticeText.php
@@ -23,7 +23,7 @@
2424
2525 // Quick short circuit to be able to show preferred notices
2626 $templates = array();
27 -
 27+
2828 if ( $this->language == 'en' && $this->project != null ) {
2929 // See if we have any preferred notices for all of en
3030 $notices = CentralNoticeDB::getNotices( '', 'en', '', '', 1 );
@@ -39,9 +39,25 @@
4040 }
4141 }
4242 }
 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+
4358 // Didn't find any preferred matches so do an old style lookup
44 - if ( !$templates )
 59+ if ( !$templates ) {
4560 $templates = CentralNotice::selectNoticeTemplates( $this->project, $this->language );
 61+ }
4662
4763 $templateNames = array_keys( $templates );
4864

Follow-up revisions

RevisionCommit summaryAuthorDate
r59852Picking up r59194, r59851 and new translationstomasz22:08, 8 December 2009

Status & tagging log