Difference between revisions of "MediaWiki:Common.css"

From Hablon
Jump to navigation Jump to search
Line 1: Line 1:
 
/* CSS placed here will be applied to all skins */
 
/* CSS placed here will be applied to all skins */
$wgHooks['SkinTemplateSetupPageCss'][] = 'wfHideVariousTabsFromAnonymous';
+
$wgHooks['SkinTemplateNavigation'][] = 'fnHideVariousTabsFromAnonymousVector';
 
 
function wfHideVariousTabsFromAnonymous( &$hidetabcss ) {
 
global $wgUser;
 
 
 
if ( !$wgUser->isLoggedIn() ) {
 
$hidetabcss .= 'li#ca-history, li#ca-viewsource, li#ca-edit, li#ca-talk, .vectorMenu { display: none; }';
 
}
 
  
 +
function fnHideVariousTabsFromAnonymousVector( SkinTemplate &$sktemplate, array &$links ) {
 +
// the old '$content_actions' array is thankfully just a
 +
// sub-array of this one
 +
fnHideVariousNamespaceTabsFromAnonymous( $sktemplate, $links['namespaces'] );
 +
fnHideVariousActionTabsFromAnonymous( $sktemplate, $links['views'] );
 
return true;
 
return true;
 
}
 
}

Revision as of 06:17, 18 April 2021

/* CSS placed here will be applied to all skins */
$wgHooks['SkinTemplateNavigation'][] = 'fnHideVariousTabsFromAnonymousVector';

function fnHideVariousTabsFromAnonymousVector( SkinTemplate &$sktemplate, array &$links ) {
	// the old '$content_actions' array is thankfully just a
	// sub-array of this one
	fnHideVariousNamespaceTabsFromAnonymous( $sktemplate, $links['namespaces'] );
	fnHideVariousActionTabsFromAnonymous( $sktemplate, $links['views'] );
	return true;
}