r110579 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110578‎ | r110579 | r110580 >
Date:15:54, 2 February 2012
Author:maxsem
Status:ok (Comments)
Tags:miscextensions 
Comment:
Correct me if it's stupid, but this rev introduces a way to enable sidebar links by making a message non-empty instead of poking Reedy to edit site config
Modified paths:
  • /trunk/extensions/FeaturedFeeds/FeaturedFeeds.body.php (modified) (history)
  • /trunk/extensions/FeaturedFeeds/FeaturedFeeds.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FeaturedFeeds/FeaturedFeeds.body.php
@@ -108,7 +108,10 @@
109109 public static function skinTemplateOutputPageBeforeExec( &$sk, &$tpl ) {
110110 global $wgDisplayFeedsInSidebar, $wgAdvertisedFeedTypes;
111111
112 - if ( $wgDisplayFeedsInSidebar && $sk->getContext()->getTitle()->isMainPage() ) {
 112+ if ( ( $wgDisplayFeedsInSidebar
 113+ || !wfMessage( 'ffeed-enable-sidebar-links' )->inContentLanguage()->isDisabled() )
 114+ && $sk->getContext()->getTitle()->isMainPage() )
 115+ {
113116 $feeds = self::getFeeds( $sk->getContext()->getLanguage()->getCode() );
114117 $links = array();
115118 $format = $wgAdvertisedFeedTypes[0]; // @fixme:
Index: trunk/extensions/FeaturedFeeds/FeaturedFeeds.i18n.php
@@ -18,6 +18,7 @@
1919 'ffeed-entry-not-found' => 'Feed entry for $1 not found',
2020 'ffeed-sidebar-section' => 'Featured content feeds',
2121 'ffeed-invalid-timestamp' => 'Invalid feed timestamp',
 22+ 'ffeed-enable-sidebar-links' => '-', # do not localise
2223
2324 # Featured Article
2425 'ffeed-featured-page' => '', # do not localise

Follow-up revisions

RevisionCommit summaryAuthorDate
r110595r110579: Update ignore messagesraymond17:05, 2 February 2012

Comments

#Comment by Reedy (talk | contribs)   16:45, 3 February 2012

Looks sane based upon the isDisabled code

	/**
	 * Check whether a message does not exist, is an empty string, or is "-"
	 * @return Bool: true if is is and false if not
	 */
	public function isDisabled() {
		$message = $this->fetchMessage();
		return $message === false || $message === '' || $message === '-';
	}

Status & tagging log