Partial revert r67707, included half-baked patch
authorChad Horohoe <demon@users.mediawiki.org>
Wed, 9 Jun 2010 11:54:18 +0000 (11:54 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Wed, 9 Jun 2010 11:54:18 +0000 (11:54 +0000)
includes/OutputPage.php
includes/SkinTemplate.php
includes/parser/CoreParserFunctions.php
includes/parser/ParserOutput.php
languages/messages/MessagesEn.php

index 3812ce1..9722be8 100644 (file)
@@ -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() ) {
index c5d09b2..e049f57 100644 (file)
@@ -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 ) . "&nbsp;";
-               }
-               $tpl->set( 'pageicons', $icons );
-
                $nsname = MWNamespace::exists( $this->mTitle->getNamespace() ) ?
                                        MWNamespace::getCanonicalName( $this->mTitle->getNamespace() ) :
                                        $this->mTitle->getNsText();
index d557711..c3e9884 100644 (file)
@@ -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
         */
index b2a774e..1f390a2 100644 (file)
@@ -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
index 3c396e3..ce69a93 100644 (file)
@@ -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' ),
 );
 
 /**