From: Ævar Arnfjörð Bjarmason Date: Tue, 27 Sep 2005 19:40:14 +0000 (+0000) Subject: * Support for per-page CSS by an extension using wgHooks X-Git-Tag: 1.6.0~1571 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=4581c08d03a0ebdd5a804da3d026b5de15be1f5f;p=lhc%2Fweb%2Fwiklou.git * Support for per-page CSS by an extension using wgHooks --- 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']) { ?>