Add support for skins to set attributes of <html> element.
authordr0ptp4kt <abaso@wikimedia.org>
Wed, 18 Dec 2013 18:34:57 +0000 (10:34 -0800)
committerdr0ptp4kt <abaso@wikimedia.org>
Wed, 18 Dec 2013 18:43:11 +0000 (10:43 -0800)
* Useful for device/profile-specific stuff (e.g., manifests)

Change-Id: I65f4d3454ae52a25fe4c6e9f2119129425b3de7a

includes/OutputPage.php
includes/Skin.php

index eac70a3..b6a8d24 100644 (file)
@@ -2484,7 +2484,7 @@ $templates
                $userdir = $this->getLanguage()->getDir();
                $sitedir = $wgContLang->getDir();
 
-               $ret = Html::htmlHeader( array( 'lang' => $this->getLanguage()->getHtmlCode(), 'dir' => $userdir, 'class' => 'client-nojs' ) );
+               $ret = Html::htmlHeader( $sk->getHtmlElementAttributes() );
 
                if ( $this->getHTMLTitle() == '' ) {
                        $this->setHTMLTitle( $this->msg( 'pagetitle', $this->getPageTitle() )->inContentLanguage() );
index 946e698..6722cca 100644 (file)
@@ -453,6 +453,19 @@ abstract class Skin extends ContextSource {
                return "$numeric $type $name";
        }
 
+       /*
+        * Return values for <html> element
+        * @return array of associative name-to-value elements for <html> element
+        */
+       public function getHtmlElementAttributes() {
+               $lang = $this->getLanguage();
+               return array(
+                       'lang' => $lang->getHtmlCode(),
+                       'dir' => $lang->getDir(),
+                       'class' => 'client-nojs',
+               );
+       }
+
        /**
         * This will be called by OutputPage::headElement when it is creating the
         * "<body>" tag, skins can override it if they have a need to add in any