ProgrammaticalCSS/includes/ProgrammaticalCSSHooks.php
2024-07-04 18:04:14 +02:00

19 lines
545 B
PHP

<?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;
}
}