From 4581c08d03a0ebdd5a804da3d026b5de15be1f5f Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 27 Sep 2005 19:40:14 +0000 Subject: [PATCH] * Support for per-page CSS by an extension using wgHooks --- includes/SkinTemplate.php | 16 ++++++++++++++++ skins/MonoBook.php | 1 + 2 files changed, 17 insertions(+) diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 9430aeea9e..d2b054a38b 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -251,6 +251,7 @@ class SkinTemplate extends Skin { $tpl->setRef( 'username', $this->username ); $tpl->setRef( 'userpage', $this->userpage); $tpl->setRef( 'userpageurl', $this->userpageUrlDetails['href']); + $tpl->setRef( 'pagecss', $this->setupPageCss() ); $tpl->setRef( 'usercss', $this->usercss); $tpl->setRef( 'userjs', $this->userjs); $tpl->setRef( 'userjsprev', $this->userjsprev); @@ -936,6 +937,21 @@ class SkinTemplate extends Skin { wfProfileOut( $fname ); } + /** + * Code for extensions to hook into to provide per-page CSS, see + * extension/PageCSS/PageCSS.php for an implementation of this. + * + * @access private + */ + function setupPageCss() { + $fname = 'SkinTemplate::setupPageCss'; + wfProfileIn( $fname ); + $out = false; + wfRunHooks( 'SkinTemplateSetupPageCss', array( &$out ) ); + wfProfileOut( $fname ); + return $out; + } + /** * returns css with user-specific options * @access public diff --git a/skins/MonoBook.php b/skins/MonoBook.php index 7db1aa4f5f..46c7e996b9 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -65,6 +65,7 @@ class MonoBookTemplate extends QuickTemplate { data['jsvarurl' ]) { ?> + data['pagecss' ]) { ?> data['usercss' ]) { ?> data['userjs' ]) { ?> data['userjsprev']) { ?> -- 2.20.1