r67708 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67707‎ | r67708 | r67709 >
Date:11:54, 9 June 2010
Author:demon
Status:ok
Tags:
Comment:
Partial revert r67707, included half-baked patch
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/includes/parser/CoreParserFunctions.php (modified) (history)
  • /trunk/phase3/includes/parser/ParserOutput.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/ParserOutput.php
@@ -28,8 +28,7 @@
2929 $mSections = array(), # Table of contents
3030 $mProperties = array(), # Name/value pairs to be cached in the DB
3131 $mTOCHTML = ''; # HTML of the TOC
32 - private $mIndexPolicy = '', # 'index' or 'noindex'? Any other value will result in no change.
33 - $mPageIcons = array(); # Array of icons to show for the page (like Protect, Featured, etc)
 32+ private $mIndexPolicy = ''; # 'index' or 'noindex'? Any other value will result in no change.
3433
3534 function ParserOutput( $text = '', $languageLinks = array(), $categoryLinks = array(),
3635 $containsOldMagic = false, $titletext = '' )
@@ -60,7 +59,6 @@
6160 function getWarnings() { return array_keys( $this->mWarnings ); }
6261 function getIndexPolicy() { return $this->mIndexPolicy; }
6362 function getTOCHTML() { return $this->mTOCHTML; }
64 - function getPageIcons() { return $this->mPageIcons; }
6563
6664 function containsOldMagic() { return $this->mContainsOldMagic; }
6765 function setText( $text ) { return wfSetVar( $this->mText, $text ); }
@@ -253,15 +251,6 @@
254252 }
255253
256254 /**
257 - * Add page icons to the parser output.
258 - * @param File $file A valid file
259 - * @param String $alt Alt text, if any
260 - */
261 - function addPageIcon( $file, $alt = '' ) {
262 - $this->mPageIcons[] = array( $file, $alt );
263 - }
264 -
265 - /**
266255 * Override the title to be used for display
267256 * -- this is assumed to have been validated
268257 * (check equal normalisation, etc.)
Index: trunk/phase3/includes/parser/CoreParserFunctions.php
@@ -69,7 +69,6 @@
7070 $parser->setFunctionHook( 'subjectpagenamee', array( __CLASS__, 'subjectpagenamee' ), SFH_NO_HASH );
7171 $parser->setFunctionHook( 'tag', array( __CLASS__, 'tagObj' ), SFH_OBJECT_ARGS );
7272 $parser->setFunctionHook( 'formatdate', array( __CLASS__, 'formatDate' ) );
73 - $parser->setFunctionHook( 'pageicon', array( __CLASS__, 'pageicon' ) );
7473
7574 if ( $wgAllowDisplayTitle ) {
7675 $parser->setFunctionHook( 'displaytitle', array( __CLASS__, 'displaytitle' ), SFH_NO_HASH );
@@ -629,14 +628,6 @@
630629 }
631630 }
632631
633 - public static function pageicon( $parser, $name = '', $alt = '' ) {
634 - $file = wfFindFile( $name );
635 - if( $file ) {
636 - $parser->mOutput->addPageIcon( $file, $alt );
637 - }
638 - return '';
639 - }
640 -
641632 /**
642633 * Parser function to extension tag adaptor
643634 */
Index: trunk/phase3/includes/OutputPage.php
@@ -39,7 +39,6 @@
4040 var $mParseWarnings = array();
4141 var $mSquidMaxage = 0;
4242 var $mRevisionId = null;
43 - var $mPageIcons = array();
4443 protected $mTitle = null;
4544
4645 /**
@@ -1080,7 +1079,6 @@
10811080 $this->addCategoryLinks( $parserOutput->getCategories() );
10821081 $this->mNewSectionLink = $parserOutput->getNewSection();
10831082 $this->mHideNewSectionLink = $parserOutput->getHideNewSection();
1084 - $this->mPageIcons = $parserOutput->getPageIcons();
10851083
10861084 $this->mParseWarnings = $parserOutput->getWarnings();
10871085 if ( !$parserOutput->isCacheable() ) {
Index: trunk/phase3/includes/SkinTemplate.php
@@ -230,21 +230,6 @@
231231 $tpl->set( 'pageclass', $this->getPageClasses( $this->mTitle ) );
232232 $tpl->set( 'skinnameclass', ( 'skin-' . Sanitizer::escapeClass( $this->getSkinName() ) ) );
233233
234 - $icons = '';
235 - foreach( $out->mPageIcons as $icon ) {
236 - list( $file, $alt ) = $icon;
237 - $fileAttr = array( 'src' => $file->createThumb( 16 ) );
238 - if( $alt != '' ) {
239 - $msg = wfMsg( $alt );
240 - if( !wfEmptyMsg( $alt ) ) {
241 - $alt = $msg;
242 - }
243 - $fileAttr['alt'] = htmlspecialchars( $alt );
244 - }
245 - $icons .= Html::element( 'img', $fileAttr ) . " ";
246 - }
247 - $tpl->set( 'pageicons', $icons );
248 -
249234 $nsname = MWNamespace::exists( $this->mTitle->getNamespace() ) ?
250235 MWNamespace::getCanonicalName( $this->mTitle->getNamespace() ) :
251236 $this->mTitle->getNsText();
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -356,7 +356,6 @@
357357 'url_path' => array( 0, 'PATH' ),
358358 'url_wiki' => array( 0, 'WIKI' ),
359359 'url_query' => array( 0, 'QUERY' ),
360 - 'pageicon' => array( 1, 'pageicon' ),
361360 );
362361
363362 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r67707Fixed a bunch of silly instances of [^!=]==\s*(true|false)demon11:44, 9 June 2010

Status & tagging log