Merge "Add a class to interlanguage links"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 25 Nov 2013 15:47:54 +0000 (15:47 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 25 Nov 2013 15:47:54 +0000 (15:47 +0000)
1  2 
includes/SkinTemplate.php

@@@ -139,7 -139,7 +139,7 @@@ class SkinTemplate extends Skin 
                if ( !$wgHideInterlanguageLinks ) {
                        foreach ( $out->getLanguageLinks() as $languageLinkText ) {
                                $languageLinkParts = explode( ':', $languageLinkText, 2 );
-                               $class = 'interwiki-' . $languageLinkParts[0];
+                               $class = 'interlanguage-link interwiki-' . $languageLinkParts[0];
                                unset( $languageLinkParts );
                                $languageLinkTitle = Title::newFromText( $languageLinkText );
                                if ( $languageLinkTitle ) {
                                        // otherwise we'll end up with the autonym again.
                                        $ilLangLocalName = Language::fetchLanguageName( $ilInterwikiCode, $userLang->getCode() );
  
 +                                      if ( $languageLinkTitle->getText() === '' ) {
 +                                              $ilTitle = wfMessage( 'interlanguage-link-title-langonly', $ilLangLocalName )->text();
 +                                      } else {
 +                                              $ilTitle = wfMessage( 'interlanguage-link-title', $languageLinkTitle->getText(),
 +                                                      $ilLangLocalName )->text();
 +                                      }
 +
                                        $language_urls[] = array(
                                                'href' => $languageLinkTitle->getFullURL(),
                                                'text' => $ilLangName,
 -                                              'title' => wfMessage( 'interlanguage-link-title', $languageLinkTitle->getText(), $ilLangLocalName )->text(),
 +                                              'title' => $ilTitle,
                                                'class' => $class,
                                                'lang' => wfBCP47( $ilInterwikiCode ),
                                                'hreflang' => wfBCP47( $ilInterwikiCode ),
                if ( $oldContext ) {
                        $this->setContext( $oldContext );
                }
 +
 +              wfProfileOut( __METHOD__ );
        }
  
        /**
                        $personal_urls[$login_id] = $login_url;
                }
  
 -              wfRunHooks( 'PersonalUrls', array( &$personal_urls, &$title ) );
 +              wfRunHooks( 'PersonalUrls', array( &$personal_urls, &$title, $this ) );
                wfProfileOut( __METHOD__ );
                return $personal_urls;
        }
@@@ -1457,20 -1448,6 +1457,20 @@@ abstract class QuickTemplate 
        public function getSkin() {
                return $this->data['skin'];
        }
 +
 +      /**
 +       * Fetch the output of a QuickTemplate and return it
 +       *
 +       * @since 1.23
 +       * @return String
 +       */
 +      public function getHTML() {
 +              ob_start();
 +              $this->execute();
 +              $html = ob_get_contents();
 +              ob_end_clean();
 +              return $html;
 +      }
  }
  
  /**