/** @var bool Stores "article flag" toggle. */
private $mIsArticleRelated = true;
+ /** @var bool Is the content subject to copyright */
+ private $mHasCopyright = false;
+
/**
* @var bool We have to set isPrintable(). Some pages should
* never be printed (ex: redirections).
return $this->mIsArticleRelated;
}
+ /**
+ * Set whether the standard copyright should be shown for the current page.
+ *
+ * @param bool $hasCopyright
+ */
+ public function setCopyright( $hasCopyright ) {
+ $this->mHasCopyright = $hasCopyright;
+ }
+
+ /**
+ * Return whether the standard copyright should be shown for the current page.
+ * By default, it is true for all articles but other pages
+ * can signal it by using setCopyright( true ).
+ *
+ * Used by SkinTemplate to decided whether to show the copyright.
+ *
+ * @return bool
+ */
+ public function showsCopyright() {
+ return $this->isArticle() || $this->mHasCopyright;
+ }
+
/**
* Add new language links
*
}
return $this->CSPNonce;
}
+
}
$tpl->set( 'lastmod', false );
$tpl->set( 'credits', false );
$tpl->set( 'numberofwatchingusers', false );
- if ( $out->isArticle() && $title->exists() ) {
- if ( $this->isRevisionCurrent() ) {
- if ( $wgMaxCredits != 0 ) {
- $tpl->set( 'credits', Action::factory( 'credits', $this->getWikiPage(),
- $this->getContext() )->getCredits( $wgMaxCredits, $wgShowCreditsIfMax ) );
- } else {
- $tpl->set( 'lastmod', $this->lastModified() );
+ if ( $title->exists() ) {
+ if ( $out->isArticle() ) {
+ if ( $this->isRevisionCurrent() ) {
+ if ( $wgMaxCredits != 0 ) {
+ $tpl->set( 'credits', Action::factory( 'credits', $this->getWikiPage(),
+ $this->getContext() )->getCredits( $wgMaxCredits, $wgShowCreditsIfMax ) );
+ } else {
+ $tpl->set( 'lastmod', $this->lastModified() );
+ }
}
}
- $tpl->set( 'copyright', $this->getCopyright() );
+ if ( $out->showsCopyright() ) {
+ $tpl->set( 'copyright', $this->getCopyright() );
+ }
}
$tpl->set( 'copyrightico', $this->getCopyrightIcon() );