remove no longer needed line for Parser_OldPP (now banished!)
[lhc/web/wiklou.git] / includes / Linker.php
index 051bebe..a68d48c 100644 (file)
@@ -191,7 +191,7 @@ class Linker {
                wfProfileIn( __METHOD__ . '-checkPageExistence' );
                if( !in_array( 'known', $options ) and !in_array( 'broken', $options ) ) {
                        if( $target->getNamespace() == NS_SPECIAL ) {
-                               if( SpecialPage::exists( $target->getDbKey() ) ) {
+                               if( SpecialPage::exists( $target->getDBKey() ) ) {
                                        $options []= 'known';
                                } else {
                                        $options []= 'broken';
@@ -227,11 +227,8 @@ class Linker {
                }
 
                $ret = null;
-               if( wfRunHooks( 'LinkEnd', array( $this, $target, $options, &$text,
-               &$attribs, &$ret ) ) ) {
-                       $ret = Xml::openElement( 'a', $attribs )
-                               . $text
-                               . Xml::closeElement( 'a' );
+               if( wfRunHooks( 'LinkEnd', array( $this, $target, $options, &$text, &$attribs, &$ret ) ) ) {
+                       $ret = Xml::openElement( 'a', $attribs ) . $text . Xml::closeElement( 'a' );
                }
 
                wfProfileOut( __METHOD__ );
@@ -864,7 +861,7 @@ class Linker {
                } else {
                        if ( isset( $fp['manualthumb'] ) ) {
                                # Use manually specified thumbnail
-                               $manual_title = Title::makeTitleSafe( NS_IMAGE, $fp['manualthumb'] );
+                               $manual_title = Title::makeTitleSafe( NS_FILE, $fp['manualthumb'] );
                                if( $manual_title ) {
                                        $manual_img = wfFindFile( $manual_title );
                                        if ( $manual_img ) {
@@ -970,7 +967,7 @@ class Linker {
 
        /** @deprecated use Linker::makeMediaLinkObj() */
        function makeMediaLink( $name, $unused = '', $text = '', $time = false ) {
-               $nt = Title::makeTitleSafe( NS_IMAGE, $name );
+               $nt = Title::makeTitleSafe( NS_FILE, $name );
                return $this->makeMediaLinkObj( $nt, $text, $time );
        }
 
@@ -1050,7 +1047,7 @@ class Linker {
                } else {
                        $page = Title::makeTitle( NS_USER, $userText );
                }
-               return $this->link( $page, htmlspecialchars( $userText ) );
+               return $this->link( $page, htmlspecialchars( $userText ), array( 'class' => 'mw-userlink' ) );
        }
 
        /**
@@ -1090,7 +1087,7 @@ class Linker {
                }
 
                if( $items ) {
-                       return ' (' . implode( ' | ', $items ) . ')';
+                       return ' <span class="mw-usertoollinks">(' . implode( ' | ', $items ) . ')</span>';
                } else {
                        return '';
                }
@@ -1781,6 +1778,8 @@ class Linker {
         *   escape), or false for no accesskey attribute
         */
        public function accesskey( $name ) {
+               wfProfileIn( __METHOD__ );
+
                $accesskey = wfMsg( "accesskey-$name" );
 
                # FIXME: Per standard MW behavior, a value of '-' means to suppress the
@@ -1789,8 +1788,11 @@ class Linker {
                if( $accesskey != ''
                && $accesskey != '-'
                && !wfEmptyMsg( "accesskey-$name", $accesskey ) ) {
+                       wfProfileOut( __METHOD__ );
                        return $accesskey;
                }
+
+               wfProfileOut( __METHOD__ );
                return false;
        }
 }