}
$vars['wgAjaxWatch'] = $msgs;
}
+
+ wfRunHooks('SkinGlobalVariables', array(&$vars));
return self::makeVariablesScript( $vars );
}
function getUserStylesheet() {
global $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage, $wgStyleVersion;
$sheet = $this->getStylesheet();
- $s = "@import \"$wgStylePath/common/shared.css?$wgStyleVersion\";\n";
- $s .= "@import \"$wgStylePath/common/oldshared.css?$wgStyleVersion\";\n";
- $s .= "@import \"$wgStylePath/$sheet?$wgStyleVersion\";\n";
- if($wgContLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_rtl.css?$wgStyleVersion\";\n";
-
$query = "usemsgcache=yes&action=raw&ctype=text/css&smaxage=$wgSquidMaxage";
- $s .= '@import "' . self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI ) . "\";\n" .
- '@import "' . self::makeNSUrl( ucfirst( $this->getSkinName() . '.css' ), $query, NS_MEDIAWIKI ) . "\";\n";
-
- $s .= $this->doGetUserStyles();
- return $s."\n";
+
+ $stylesheets = array();
+ $stylesheets['shared'] = "$wgStylePath/common/shared.css?$wgStyleVersion";
+ $stylesheets['oldshared'] = "$wgStylePath/common/oldshared.css?$wgStyleVersion";
+ $stylesheets['skin'] = "$wgStylePath/$sheet?$wgStyleVersion";
+ if($wgContLang->isRTL()) $stylesheets['rtl'] = "$wgStylePath/common/common_rtl.css?$wgStyleVersion";
+ $stylesheets['sitecommon'] = self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI );
+ $stylesheets['siteskin'] = self::makeNSUrl( ucfirst( $this->getSkinName() . '.css' ), $query, NS_MEDIAWIKI );
+
+ $rawcss = $this->doGetUserStyles();
+
+ wfRunHooks( 'SkinSetupSiteCss', array( &$stylesheets, &$rawcss, $query ) );
+
+ $s = '';
+ foreach( $stylesheets as $link ) {
+ $s .= "@import \"$link\";\n";
+ }
+ return "{$s}{$rawcss}\n";
}
/**
$bar = array();
$lines = explode( "\n", wfMsgForContent( 'sidebar' ) );
$heading = '';
+ $specialBox = false;
foreach ($lines as $line) {
if (strpos($line, '*') !== 0)
continue;
if (strpos($line, '**') !== 0) {
$line = trim($line, '* ');
+
if ( $line == 'SEARCH' || $line == 'TOOLBOX' || $line == 'LANGUAGES' ) {
- # Special box type
+ # Internal special box type
$bar[$line] = array();
+ $specialBox = true;
} else {
- $heading = $line;
+ $cont = null;
+ # Allow extensions to start a special box
+ if( !wfRunHooks( 'SkinSidebarSpecialBox', array( &$this, $line, &$cont ) ); ) {
+ # Extension special box type
+ $bar[$line] = $cont;
+ $specialBox = true;
+ } else {
+ # Normal box
+ $specialBox = false;
+ }
}
+ $heading = $line;
} else {
- if (strpos($line, '|') !== false) { // sanity check
+ if( $specialBox ) {
+ # Inside a special box, we just append the lines into the $cont
+ $bar[$heading][] = $line;
+ } elseif (strpos($line, '|') !== false) { // sanity check
$line = array_map('trim', explode( '|' , trim($line, '* '), 2 ) );
$link = wfMsgForContent( $line[0] );
if ($link == '-')