Skip to content

Commit

Permalink
Remove bodyOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
malberts committed Feb 20, 2025
1 parent 497c9ed commit ab15092
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
14 changes: 0 additions & 14 deletions src/ChameleonTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,7 @@ class ChameleonTemplate extends BaseTemplate {
* @throws \MWException
*/
public function execute() {
$skin = $this->getSkin();
$skinOptions = method_exists( $skin, 'getOptions' ) ? $skin->getOptions() : [];
// TODO: Remove $bodyOnly when dropping < MW 1.39 support.
$bodyOnly = $skinOptions['bodyOnly'] ?? false;
// output the head element
// The headelement defines the <body> tag itself, it shouldn't be included in the html text
// To add attributes or classes to the body tag use OutputPageBodyAttributes hook
if ( !$bodyOnly ) {
$this->html( 'headelement' );
}
echo $this->getSkin()->getComponentFactory()->getRootComponent()->getHtml();
if ( !$bodyOnly ) {
$this->printTrail();
echo "</body>\n</html>";
}
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/Hooks/SetupAfterCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,7 @@ function () {

return new Chameleon( [
'name' => 'chameleon',
'styles' => $styles,
'bodyOnly' => version_compare( $this->configuration['wgVersion'], '1.39', '>=' ),
'styles' => $styles
] );
} );
}
Expand Down

0 comments on commit ab15092

Please sign in to comment.