Remove dead code
[lhc/web/wiklou.git] / includes / OutputPage.php
index 1d79e83..bf9f5ac 100644 (file)
@@ -39,9 +39,6 @@ class OutputPage extends ContextSource {
        /// Should be private. Used with addMeta() which adds "<meta>"
        var $mMetatags = array();
 
-       /// "<meta keywords='stuff'>" most of the time the first 10 links to an article
-       var $mKeywords = array();
-
        var $mLinktags = array();
        var $mCanonicalUrl = false;
 
@@ -313,19 +310,6 @@ class OutputPage extends ContextSource {
                array_push( $this->mMetatags, array( $name, $val ) );
        }
 
-       /**
-        * Add a keyword or a list of keywords in the page header
-        *
-        * @param string $text or array of strings
-        */
-       function addKeyword( $text ) {
-               if ( is_array( $text ) ) {
-                       $this->mKeywords = array_merge( $this->mKeywords, $text );
-               } else {
-                       array_push( $this->mKeywords, $text );
-               }
-       }
-
        /**
         * Add a new \<link\> tag to the page header.
         *
@@ -2448,14 +2432,6 @@ $templates
         * @param $options Options array to pass to Linker
         */
        public function addReturnTo( $title, $query = array(), $text = null, $options = array() ) {
-               if ( in_array( 'http', $options ) ) {
-                       $proto = PROTO_HTTP;
-               } elseif ( in_array( 'https', $options ) ) {
-                       $proto = PROTO_HTTPS;
-               } else {
-                       $proto = PROTO_RELATIVE;
-               }
-
                $link = $this->msg( 'returnto' )->rawParams(
                        Linker::link( $title, $text, array(), $query, $options ) )->escaped();
                $this->addHTML( "<p id=\"mw-returnto\">{$link}</p>\n" );
@@ -2528,8 +2504,8 @@ $templates
                        // The spec recommends defining XHTML5's charset using the XML declaration
                        // instead of meta.
                        // Our XML declaration is output by Html::htmlHeader.
-                       // http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#attr-meta-http-equiv-content-type
-                       // http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#charset
+                       // http://www.whatwg.org/html/semantics.html#attr-meta-http-equiv-content-type
+                       // http://www.whatwg.org/html/semantics.html#charset
                        $ret .= Html::element( 'meta', array( 'charset' => 'UTF-8' ) );
                }
 
@@ -3040,6 +3016,7 @@ $templates
                        'wgCurRevisionId' => $latestRevID,
                        'wgArticleId' => $pageID,
                        'wgIsArticle' => $this->isArticle(),
+                       'wgIsRedirect' => $title->isRedirect(),
                        'wgAction' => Action::getActionName( $this->getContext() ),
                        'wgUserName' => $user->isAnon() ? null : $user->getName(),
                        'wgUserGroups' => $user->getEffectiveGroups(),
@@ -3067,6 +3044,8 @@ $templates
                if ( $wgContLang->hasVariants() ) {
                        $vars['wgUserVariant'] = $wgContLang->getPreferredVariant();
                }
+               // Same test as SkinTemplate
+               $vars['wgIsProbablyEditable'] = $title->quickUserCan( 'edit', $user ) && ( $title->exists() || $title->quickUserCan( 'create', $user ) );
                foreach ( $title->getRestrictionTypes() as $type ) {
                        $vars['wgRestriction' . ucfirst( $type )] = $title->getRestrictions( $type );
                }
@@ -3140,21 +3119,6 @@ $templates
                        ) );
                }
 
-               if ( count( $this->mKeywords ) > 0 ) {
-                       $strip = array(
-                               "/<.*?" . ">/" => '',
-                               "/_/" => ' '
-                       );
-                       $tags['meta-keywords'] = Html::element( 'meta', array(
-                               'name' => 'keywords',
-                               'content' => preg_replace(
-                                       array_keys( $strip ),
-                                       array_values( $strip ),
-                                       implode( ',', $this->mKeywords )
-                               )
-                       ) );
-               }
-
                foreach ( $this->mMetatags as $tag ) {
                        if ( 0 == strcasecmp( 'http:', substr( $tag[0], 0, 5 ) ) ) {
                                $a = 'http-equiv';
@@ -3246,7 +3210,7 @@ $templates
                                        foreach ( $variants as $_v ) {
                                                $tags["variant-$_v"] = Html::element( 'link', array(
                                                        'rel' => 'alternate',
-                                                       'hreflang' => $_v,
+                                                       'hreflang' => wfBCP47( $_v ),
                                                        'href' => $this->getTitle()->getLocalURL( array( 'variant' => $_v ) ) )
                                                );
                                        }