From ecb201b95625f89074b09727e7d8aee006244779 Mon Sep 17 00:00:00 2001 From: "Nicholas Pisarro, Jr" Date: Mon, 1 Mar 2004 13:40:58 +0000 Subject: [PATCH] Created a new page, "SpecialAllmessages.php", which builds the equivalent of "MediaWiki:All_message" at run time instead of install time. This page is currently shown on "Special:Specialpages" by those with SysOp access. The table has a background color. Entries where the current text is different than the default text are show with a different background color. It might be possible to better optimize this table's construction. --- includes/SpecialAllmessages.php | 58 +++++++++++++++++++++++++++++++++ languages/Language.php | 1 + 2 files changed, 59 insertions(+) create mode 100644 includes/SpecialAllmessages.php diff --git a/includes/SpecialAllmessages.php b/includes/SpecialAllmessages.php new file mode 100644 index 0000000000..f805af2549 --- /dev/null +++ b/includes/SpecialAllmessages.php @@ -0,0 +1,58 @@ +getNsText( NS_TALK ); + $mwtalk = $wgLang->getNsText( NS_MEDIAWIKI_TALK ); + $mwMsg =& MagicWord::get( MAG_MSG ); + $navText = str_replace( "$1", "allmessagestext", $mwMsg->getSynonym( 0 ) ); + $navText .= " + +"; + + $first = true; + $sortedArray = $wgAllMessagesEn; + ksort( $sortedArray ); + + foreach ( $sortedArray as $key => $enMsg ) { + + $titleObj = Title::newFromText( $key ); + $title = $titleObj->getDBkey(); + + $message = wfMsgNoDB( $key ); + $mw = wfMsg ( $key ); + + $colorIt = ($message == $mw) ? " bgcolor=\"#f0f0ff\"" : " bgcolor=\"#ffe2e2\""; + + $message = wfEscapeWikiText( $message ); + $mw = wfEscapeWikiText( $mw ); + +# [$wgServer$wgScript?title=MediaWiki:$title&action=edit $key]
+ $navText .= +""; + } + + $navText .= "
+ '''Name''' + + '''Default text''' + + '''Current text''' +
+ [[MediaWiki:$title|$key]]
+ [[$mwtalk:$title|$talk]] +
+ $message + + $mw +
"; + + $wgOut->addWikiText( $navText ); + + return; +} + +?> diff --git a/languages/Language.php b/languages/Language.php index 795041a491..2b1022b94c 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -403,6 +403,7 @@ $wgLanguageNamesEn =& $wgLanguageNames; /* private */ $wgSysopSpecialPagesEn = array( "Blockip" => "Block a user/IP address", "Asksql" => "Query the database", + "Allmessages" => "All system messages", "Undelete" => "Restore deleted pages", "Makesysop" => "Turn a user into a sysop" ); -- 2.20.1