From 36983d11fb1de4c97baf97ab713ec5362ca63a41 Mon Sep 17 00:00:00 2001 From: dr0ptp4kt Date: Wed, 18 Dec 2013 10:34:57 -0800 Subject: [PATCH] Add support for skins to set attributes of element. * Useful for device/profile-specific stuff (e.g., manifests) Change-Id: I65f4d3454ae52a25fe4c6e9f2119129425b3de7a --- includes/OutputPage.php | 2 +- includes/Skin.php | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index eac70a30ee..b6a8d246d9 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -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() ); diff --git a/includes/Skin.php b/includes/Skin.php index 946e698349..6722ccabd1 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -453,6 +453,19 @@ abstract class Skin extends ContextSource { return "$numeric $type $name"; } + /* + * Return values for element + * @return array of associative name-to-value elements for 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 * "" tag, skins can override it if they have a need to add in any -- 2.20.1