bug 37015: Allow disabling special page summary
authorAmir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Tue, 22 May 2012 10:25:47 +0000 (13:25 +0300)
committerAmir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Tue, 22 May 2012 16:46:52 +0000 (19:46 +0300)
Replaced isBlank() with isDisabled() in SpecialPage::outputHeader.
This allows disabling the default headers (*-summary).

Patch set 2: Hid recentchangestext if nothing is written there.

Change-Id: Id3ec2aeb1fab00344908b7bff01929bdafbfd08f

includes/SpecialPage.php
includes/specials/SpecialRecentchanges.php

index 7a6c0be..9e6717f 100644 (file)
@@ -626,7 +626,7 @@ class SpecialPage {
                } else {
                        $msg = $summaryMessageKey;
                }
-               if ( !$this->msg( $msg )->isBlank() && !$this->including() ) {
+               if ( !$this->msg( $msg )->isDisabled() && !$this->including() ) {
                        $this->getOutput()->wrapWikiMsg(
                                "<div class='mw-specialpage-summary'>\n$1\n</div>", $msg );
                }
index 46dd115..bb384d4 100644 (file)
@@ -635,7 +635,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                global $wgContLang;
 
                $message = $this->msg( 'recentchangestext' )->inContentLanguage();
-               if ( $message->exists() ) {
+               if ( !$message->isDisabled() ) {
                        $this->getOutput()->addWikiText(
                                Html::rawElement( 'p',
                                        array( 'lang' => $wgContLang->getCode(), 'dir' => $wgContLang->getDir() ),