first commit
This commit is contained in:
18
includes/ProgrammaticalCSSHooks.php
Normal file
18
includes/ProgrammaticalCSSHooks.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
if ( !defined( 'MEDIAWIKI' ) ) {
|
||||
die( 'This is an extension to the MediaWiki package and cannot be run standalone.' );
|
||||
}
|
||||
|
||||
class ProgrammaticalCSSHooks {
|
||||
public static function onBeforePageDisplay( OutputPage &$out, Skin &$skin ) {
|
||||
$context = RequestContext::getMain();
|
||||
$user = $context->getUser();
|
||||
|
||||
// Do this if the user is not logged in. Logged in usere have a ID > 0
|
||||
if ( $user->mId <= 0 ) {
|
||||
$out->addModuleStyles( ['ext.programmaticalcss'] );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user