r42790 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r42789‎ | r42790 | r42791 >
Date:23:45, 29 October 2008
Author:tparscal
Status:old (Comments)
Tags:
Comment:
Added configuration variables for table names. Fixed paths.
Modified paths:
  • /branches/CentralNotice-SpecialPage-Integration/CentralNotice.php (modified) (history)

Diff [purge]

Index: branches/CentralNotice-SpecialPage-Integration/CentralNotice.php
@@ -4,7 +4,7 @@
55 /// This guy gets loaded from every page on every wiki, and is heavily cached.
66 /// Its contents are small, and just load up another cached JS page, but this
77 /// allows us to update everything with a single purge. Nice, eh?
8 -$wgNoticeLoader = $IP . '/Special:NoticeLoader';
 8+$wgNoticeLoader = $wgArticlePath . '/Special:NoticeLoader';
99
1010 /// Override these per-wiki to pass on via the loader to the text system
1111 /// for localization by language and project.
@@ -27,7 +27,7 @@
2828 /// URL prefix to the raw-text loader special.
2929 /// Project/language and timestamp epoch keys get appended to this
3030 /// via the loader stub.
31 -$wgNoticeText = $IP . '/Special:NoticeText';
 31+$wgNoticeText = $wgArticlePath . '/Special:NoticeText';
3232
3333 /// If true, notice only displays if 'sitenotice=yes' is in the query string
3434 $wgNoticeTestMode = false;
@@ -83,6 +83,11 @@
8484 $wgSpecialPageGroups['NoticeTranslate'] = 'wiki'; // Wiki data and tools"
8585 $wgSpecialPageGroups['NoticeTemplate'] = 'wiki'; // Wiki data and tools"
8686
 87+
 88+$egCentralNoticeTableNames['templates'] = 'central_notice_templates';
 89+$egCentralNoticeTableNames['campaign'] = 'central_notice_campaign';
 90+$egCentralNoticeTableNames['assignments'] = 'central_notice_template_assignments';
 91+
8792 function efCentralNoticeSetup() {
8893 global $wgHooks, $wgNoticeInfrastructure;
8994 global $wgAutoloadClasses, $wgSpecialPages;

Follow-up revisions

RevisionCommit summaryAuthorDate
r42933Cleanup to r42790 -- fix default noticeloader/noticetext pathsbrion19:23, 31 October 2008

Comments

#Comment by Brion VIBBER (talk | contribs)   00:54, 30 October 2008

$wgArticlePath will end in $1 -- you need to do a str_replace here. Or just give up and make the user figure out the value. ;)

(Could just make the default false or null or something, then do a run-time calculation via SpecialPage::getTitleFor('NoticeText')->getFullUrl() if it's not set to an explicit value.)

#Comment by Brion VIBBER (talk | contribs)   19:23, 31 October 2008

$1 thingy done in r42933

Status & tagging log