From: dr0ptp4kt Date: Wed, 18 Dec 2013 18:34:57 +0000 (-0800) Subject: Add support for skins to set attributes of element. X-Git-Tag: 1.31.0-rc.0~17580^2 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=36983d11fb1de4c97baf97ab713ec5362ca63a41;p=lhc%2Fweb%2Fwiklou.git Add support for skins to set attributes of element. * Useful for device/profile-specific stuff (e.g., manifests) Change-Id: I65f4d3454ae52a25fe4c6e9f2119129425b3de7a --- 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