Skip to content

Commit

Permalink
Change SkinTemplateOutputModifier.php for SMW 1.35.
Browse files Browse the repository at this point in the history
Possible solution for: SkinTemplateOutputPageBeforeExec hook is being deprecated SemanticMediaWiki#69.
  • Loading branch information
UnknownSkyrimPasserby authored Feb 18, 2021
1 parent bfc5c45 commit b67f88b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/SkinTemplateOutputModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,28 @@ public function modify( OutputPage $output, &$template ) {
// https://github.com/wikimedia/mediawiki/blob/23ea2e4c2966f381eb7fd69b66a8d738bb24cc60/includes/skins/SkinTemplate.php#L292-L296
$template->data['subtitle'] .= $this->htmlBreadcrumbLinksBuilder->getHtml();
}

/**
* For MW 1.35
* @since 2.0.1
*
* @param OutputPage $output
*/
public function modify2( OutputPage $output)
{
if ( !$this->canModifyOutput( $output ) ) {
return;
}

$title = $output->getTitle();
$this->htmlBreadcrumbLinksBuilder->buildBreadcrumbs( $title );

$this->htmlBreadcrumbLinksBuilder->isRTL(
$title->getPageLanguage()->isRTL()
);

$output->addSubtitle($this->htmlBreadcrumbLinksBuilder->getHtml());
}

private function canModifyOutput( OutputPage $output ) {

Expand Down

0 comments on commit b67f88b

Please sign in to comment.