These skins have been obsolete since 1.16 and aren't supported well at this point.
This deprecates those skins and begins deprecation of the creation of <head> contents
with only chunks of OutputPage stuff. The entire head should be created by OutputPage.
This also deprecates some old methods responsible for returning raw chunks of html for the head:
* getScript
* getHeadItems
Output of HeadItems is also tweaked. Previously there was no newline added
after each item, now there is. Most of the callers of addHeadItem don't use
their own newline and as a result end up on one line.
Change-Id: I13e25cc8d8fc3aa682f23b019a2fda0e809a5f64
core to their own respective repositories. See also
https://www.mediawiki.org/wiki/Skin:Modern and
https://www.mediawiki.org/wiki/Skin:CologneBlue.
+* BREAKING CHANGE: Skins built for MediaWiki 1.15 and earlier that do not use
+ the "headelement" template key are no longer supported. Setting
+ $useHeadElement = false; is no longer supported and will not cause old keys
+ like "headlinks", "skinnameclass", etc. to be defined.
==== Renamed classes ====
* CLDRPluralRuleConverter_Expression to CLDRPluralRuleConverterExpression
* Get all registered JS and CSS tags for the header.
*
* @return string
+ * @deprecated since 1.24 Use OutputPage::headElement to build the full header.
*/
function getScript() {
+ wfDeprecated( __METHOD__, '1.24' );
return $this->mScripts . $this->getHeadItems();
}
* Get all header items in a string
*
* @return string
+ * @deprecated since 1.24 Use OutputPage::headElement or
+ * if absolutely necessary use OutputPage::getHeadItemsArray
*/
function getHeadItems() {
+ wfDeprecated( __METHOD__, '1.24' );
$s = '';
foreach ( $this->mHeadItems as $item ) {
$s .= $item;
$ret .= Html::element( 'title', null, $this->getHTMLTitle() ) . "\n";
- $ret .= (
- $this->getHeadLinks() .
- "\n" .
- $this->buildCssLinks() .
- // No newline after buildCssLinks since makeResourceLoaderLink did that already
- $this->getHeadScripts() .
- "\n" .
- $this->getHeadItems()
- );
+ foreach ( $this->getHeadLinksArray() as $item ) {
+ $ret .= $item . "\n";
+ }
+
+ // No newline after buildCssLinks since makeResourceLoaderLink did that already
+ $ret .= $this->buildCssLinks();
+
+ $ret .= $this->getHeadScripts() . "\n";
+
+ foreach ( $this->mHeadItems as $item ) {
+ $ret .= $item . "\n";
+ }
$closeHead = Html::closeElement( 'head' );
if ( $closeHead ) {
/**
* @return string HTML tag links to be put in the header.
+ * @deprecated since 1.24 Use OutputPage::headElement or if you have to,
+ * OutputPage::getHeadLinksArray directly.
*/
public function getHeadLinks() {
+ wfDeprecated( __METHOD__, '1.24' );
return implode( "\n", $this->getHeadLinksArray() );
}
*/
public $template = 'QuickTemplate';
- /**
- * @var bool Whether this skin use OutputPage::headElement() to generate
- * the "<head>" tag.
- */
- public $useHeadElement = false;
-
/**
* Add specific styles for this skin
*
$out = $this->getOutput();
$tpl = $this->setupTemplateForOutput();
- wfProfileIn( __METHOD__ . '-stuff-head' );
- if ( !$this->useHeadElement ) {
- $tpl->set( 'pagecss', false );
- $tpl->set( 'usercss', false );
-
- $tpl->set( 'userjs', false );
- $tpl->set( 'userjsprev', false );
-
- $tpl->set( 'jsvarurl', false );
-
- $tpl->set( 'xhtmldefaultnamespace', 'http://www.w3.org/1999/xhtml' );
- $tpl->set( 'xhtmlnamespaces', $wgXhtmlNamespaces );
- $tpl->set( 'html5version', $wgHtml5Version );
- $tpl->set( 'headlinks', $out->getHeadLinks() );
- $tpl->set( 'csslinks', $out->buildCssLinks() );
- $tpl->set( 'pageclass', $this->getPageClasses( $title ) );
- $tpl->set( 'skinnameclass', ( 'skin-' . Sanitizer::escapeClass( $this->getSkinName() ) ) );
- }
- wfProfileOut( __METHOD__ . '-stuff-head' );
-
wfProfileIn( __METHOD__ . '-stuff2' );
$tpl->set( 'title', $out->getPageTitle() );
$tpl->set( 'pagetitle', $out->getHTMLTitle() );
$tpl->set( 'nav_urls', $this->buildNavUrls() );
// Set the head scripts near the end, in case the above actions resulted in added scripts
- if ( $this->useHeadElement ) {
- $tpl->set( 'headelement', $out->headElement( $this ) );
- } else {
- $tpl->set( 'headscripts', $out->getHeadScripts() . $out->getHeadItems() );
- }
+ $tpl->set( 'headelement', $out->headElement( $this ) );
$tpl->set( 'debug', '' );
$tpl->set( 'debughtml', $this->generateDebugHTML() );
public $skinname = 'monobook';
public $stylename = 'monobook';
public $template = 'MonoBookTemplate';
- public $useHeadElement = true;
/**
* @param OutputPage $out
* @ingroup Skins
*/
class SkinVector extends SkinTemplate {
- public $useHeadElement = true;
public $skinname = 'vector';
public $stylename = 'vector';
public $template = 'VectorTemplate';