From 6d993be4c5d4be9e6dfa73cfd11da27a48710a07 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Wed, 9 Jun 2010 11:54:18 +0000 Subject: [PATCH] Partial revert r67707, included half-baked patch --- includes/OutputPage.php | 2 -- includes/SkinTemplate.php | 15 --------------- includes/parser/CoreParserFunctions.php | 9 --------- includes/parser/ParserOutput.php | 13 +------------ languages/messages/MessagesEn.php | 1 - 5 files changed, 1 insertion(+), 39 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 3812ce1bf8..9722be80ed 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -39,7 +39,6 @@ class OutputPage { var $mParseWarnings = array(); var $mSquidMaxage = 0; var $mRevisionId = null; - var $mPageIcons = array(); protected $mTitle = null; /** @@ -1080,7 +1079,6 @@ class OutputPage { $this->addCategoryLinks( $parserOutput->getCategories() ); $this->mNewSectionLink = $parserOutput->getNewSection(); $this->mHideNewSectionLink = $parserOutput->getHideNewSection(); - $this->mPageIcons = $parserOutput->getPageIcons(); $this->mParseWarnings = $parserOutput->getWarnings(); if ( !$parserOutput->isCacheable() ) { diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index c5d09b28ac..e049f57f23 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -230,21 +230,6 @@ class SkinTemplate extends Skin { $tpl->set( 'pageclass', $this->getPageClasses( $this->mTitle ) ); $tpl->set( 'skinnameclass', ( 'skin-' . Sanitizer::escapeClass( $this->getSkinName() ) ) ); - $icons = ''; - foreach( $out->mPageIcons as $icon ) { - list( $file, $alt ) = $icon; - $fileAttr = array( 'src' => $file->createThumb( 16 ) ); - if( $alt != '' ) { - $msg = wfMsg( $alt ); - if( !wfEmptyMsg( $alt ) ) { - $alt = $msg; - } - $fileAttr['alt'] = htmlspecialchars( $alt ); - } - $icons .= Html::element( 'img', $fileAttr ) . " "; - } - $tpl->set( 'pageicons', $icons ); - $nsname = MWNamespace::exists( $this->mTitle->getNamespace() ) ? MWNamespace::getCanonicalName( $this->mTitle->getNamespace() ) : $this->mTitle->getNsText(); diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index d557711ea7..c3e9884eac 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -69,7 +69,6 @@ class CoreParserFunctions { $parser->setFunctionHook( 'subjectpagenamee', array( __CLASS__, 'subjectpagenamee' ), SFH_NO_HASH ); $parser->setFunctionHook( 'tag', array( __CLASS__, 'tagObj' ), SFH_OBJECT_ARGS ); $parser->setFunctionHook( 'formatdate', array( __CLASS__, 'formatDate' ) ); - $parser->setFunctionHook( 'pageicon', array( __CLASS__, 'pageicon' ) ); if ( $wgAllowDisplayTitle ) { $parser->setFunctionHook( 'displaytitle', array( __CLASS__, 'displaytitle' ), SFH_NO_HASH ); @@ -629,14 +628,6 @@ class CoreParserFunctions { } } - public static function pageicon( $parser, $name = '', $alt = '' ) { - $file = wfFindFile( $name ); - if( $file ) { - $parser->mOutput->addPageIcon( $file, $alt ); - } - return ''; - } - /** * Parser function to extension tag adaptor */ diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index b2a774eb25..1f390a26e8 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -28,8 +28,7 @@ class ParserOutput $mSections = array(), # Table of contents $mProperties = array(), # Name/value pairs to be cached in the DB $mTOCHTML = ''; # HTML of the TOC - private $mIndexPolicy = '', # 'index' or 'noindex'? Any other value will result in no change. - $mPageIcons = array(); # Array of icons to show for the page (like Protect, Featured, etc) + private $mIndexPolicy = ''; # 'index' or 'noindex'? Any other value will result in no change. function ParserOutput( $text = '', $languageLinks = array(), $categoryLinks = array(), $containsOldMagic = false, $titletext = '' ) @@ -60,7 +59,6 @@ class ParserOutput function getWarnings() { return array_keys( $this->mWarnings ); } function getIndexPolicy() { return $this->mIndexPolicy; } function getTOCHTML() { return $this->mTOCHTML; } - function getPageIcons() { return $this->mPageIcons; } function containsOldMagic() { return $this->mContainsOldMagic; } function setText( $text ) { return wfSetVar( $this->mText, $text ); } @@ -252,15 +250,6 @@ class ParserOutput } } - /** - * Add page icons to the parser output. - * @param File $file A valid file - * @param String $alt Alt text, if any - */ - function addPageIcon( $file, $alt = '' ) { - $this->mPageIcons[] = array( $file, $alt ); - } - /** * Override the title to be used for display * -- this is assumed to have been validated diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 3c396e30d0..ce69a93231 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -356,7 +356,6 @@ $magicWords = array( 'url_path' => array( 0, 'PATH' ), 'url_wiki' => array( 0, 'WIKI' ), 'url_query' => array( 0, 'QUERY' ), - 'pageicon' => array( 1, 'pageicon' ), ); /** -- 2.20.1