' ) !== false ) {
+ // Check what we're showing
+ global $wgOut, $wgUser;
+ $allCats = $wgOut->getCategoryLinks();
+ $showHidden = $wgUser->getBoolOption( 'showhiddencats' ) ||
+ $this->mTitle->getNamespace() == NS_CATEGORY;
+
+ if( empty($allCats['normal']) && !( !empty($allCats['hidden']) && $showHidden ) ) {
$classes .= ' catlinks-allhidden';
}
- if( !empty( $catlinks ) ){
- return "
{$catlinks}
";
- }
+ return "
{$catlinks}
";
}
function getQuickbarCompensator( $rows = 1 ) {
@@ -869,7 +894,7 @@ END;
* Returns an empty string by default, if not changed by any hook function.
*/
protected function afterContentHook() {
- $data = "";
+ $data = '';
if( wfRunHooks( 'SkinAfterContent', array( &$data ) ) ){
// adding just some spaces shouldn't toggle the output
@@ -897,13 +922,48 @@ END;
protected function generateDebugHTML() {
global $wgShowDebug, $wgOut;
if ( $wgShowDebug ) {
- $listInternals = str_replace( "\n", "\n
", htmlspecialchars( $wgOut->mDebugtext ) );
- return "\n
\nDebug data:\n";
+ $listInternals = $this->formatDebugHTML( $wgOut->mDebugtext );
+ return "\n
\nDebug data:\n";
}
return '';
}
+ private function formatDebugHTML( $debugText ) {
+ $lines = explode( "\n", $debugText );
+ $curIdent = 0;
+ $ret = '';
+ foreach( $lines as $line ) {
+ $m = array();
+ $display = ltrim( $line );
+ $ident = strlen( $line ) - strlen( $display );
+ $diff = $ident - $curIdent;
+
+ if ( $display == '' )
+ $display = "\xc2\xa0";
+
+ if ( !$ident && $diff < 0 && substr( $display, 0, 9 ) != 'Entering ' && substr( $display, 0, 8 ) != 'Exiting ' ) {
+ $ident = $curIdent;
+ $diff = 0;
+ $display = '' . htmlspecialchars( $display ) . '';
+ } else {
+ $display = htmlspecialchars( $display );
+ }
+
+ if ( $diff < 0 )
+ $ret .= str_repeat( "\n", -$diff ) . "
\n";
+ elseif ( $diff == 0 )
+ $ret .= "\n";
+ else
+ $ret .= str_repeat( "- \n", $diff );
+ $ret .= $display . "\n";
+
+ $curIdent = $ident;
+ }
+ $ret .= str_repeat( '
', $curIdent ) . '';
+ return $ret;
+ }
+
/**
* This gets called shortly before the