Actions

MediaWiki

Difference between revisions of "Common.css"

From Montana Tech High Performance Computing

Line 2: Line 2:
  
 
<!-- No [view source] tab for users who can not edit -->
 
<!-- No [view source] tab for users who can not edit -->
<?php global $wgUser; if( !$wgUser->isLoggedIn() ) { ?>
+
<?php global $wgUser; if( $wgUser->isAnon() ) { ?>
 
       <style type="text/css">
 
       <style type="text/css">
 
         #ca-viewsource { display: none !important; }
 
         #ca-viewsource { display: none !important; }
 
       </style>  
 
       </style>  
 
     <?php } ?>
 
     <?php } ?>
 
 
 
$wgHooks['SkinTemplateSetupPageCss'][] = 'wfHideVariousTabsFromAnonymous';
 
 
function wfHideVariousTabsFromAnonymous( &$hidetabcss ) {
 
global $wgUser;
 
 
if ( !$wgUser->isLoggedIn() ) {
 
$hidetabcss .= 'li#ca-history, li#ca-viewsource, li#ca-edit, li#ca-talk, .vectorMenu { display: none; }';
 
}
 
 
return true;
 
}
 

Revision as of 19:18, 25 August 2017

/* CSS placed here will be applied to all skins */

<!-- No [view source] tab for users who can not edit -->
<?php global $wgUser; if( $wgUser->isAnon() ) { ?>
      <style type="text/css">
        #ca-viewsource { display: none !important; }
      </style> 
    <?php } ?>