Index: trunk/phase3/skins/MonoBook.php |
— | — | @@ -158,7 +158,6 @@ |
159 | 159 | if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true; |
160 | 160 | if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true; |
161 | 161 | if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true; |
162 | | - |
163 | 162 | foreach ($sidebar as $boxName => $cont) { |
164 | 163 | if ( $boxName == 'SEARCH' ) { |
165 | 164 | $this->searchBox(); |
— | — | @@ -167,10 +166,7 @@ |
168 | 167 | } elseif ( $boxName == 'LANGUAGES' ) { |
169 | 168 | $this->languageBox(); |
170 | 169 | } else { |
171 | | - if( wfRunHooks( 'SkinSidebarOutputSpecialBox', array( &$this, $boxName, $cont ) ) ) { |
172 | | - # If no hook returned false, then output a normal box |
173 | | - $this->customBox( $boxName, $cont ); |
174 | | - } |
| 170 | + $this->customBox( $boxName, $cont ); |
175 | 171 | } |
176 | 172 | } |
177 | 173 | ?> |
Index: trunk/phase3/skins/Modern.php |
— | — | @@ -156,7 +156,7 @@ |
157 | 157 | if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true; |
158 | 158 | if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true; |
159 | 159 | if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true; |
160 | | - |
| 160 | + |
161 | 161 | foreach ($sidebar as $boxName => $cont) { |
162 | 162 | if ( $boxName == 'SEARCH' ) { |
163 | 163 | $this->searchBox(); |
— | — | @@ -165,10 +165,7 @@ |
166 | 166 | } elseif ( $boxName == 'LANGUAGES' ) { |
167 | 167 | $this->languageBox(); |
168 | 168 | } else { |
169 | | - if( wfRunHooks( 'SkinSidebarOutputSpecialBox', array( &$this, $boxName, $cont ) ) ) { |
170 | | - # If no hook returned false, then output a normal box |
171 | | - $this->customBox( $boxName, $cont ); |
172 | | - } |
| 169 | + $this->customBox( $boxName, $cont ); |
173 | 170 | } |
174 | 171 | } |
175 | 172 | ?> |
— | — | @@ -352,5 +349,4 @@ |
353 | 350 | } |
354 | 351 | |
355 | 352 | } // end of class |
356 | | - |
357 | | - |
| 353 | +?> |
Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -1056,27 +1056,6 @@ |
1057 | 1057 | &$text: bottomScripts Text |
1058 | 1058 | Append to $text to add additional text/scripts after the stock bottom scripts. |
1059 | 1059 | |
1060 | | -'SkinGlobalVariables': Allows modification of the JS global variables exported to the browser |
1061 | | -&$vars: The list of variables |
1062 | | - |
1063 | | -'SkinSetupSiteCss': Allows modification of the stylesheets and css imported into the skin |
1064 | | -&$stylesheets: The list of stylesheet urls for importing, keys allow for internal things to be |
1065 | | -unset or have query arguments appended |
1066 | | -&$rawcss: Raw css to be exported |
1067 | | -$msgQuery: Query containing caching and other params to use when adding a stylesheet url |
1068 | | -that comes from a MediaWiki: message page |
1069 | | - |
1070 | | -'SkinSidebarOutputSpecialBox': Allows for custom outputting of special sidebar boxes |
1071 | | -&$skin: Skin object |
1072 | | -$boxName: Name of the skin box to output |
1073 | | -$cont: Content array which may be used for options |
1074 | | - |
1075 | | -'SkinSidebarSpecialBox': Allows for extension definition of custom special sidebar boxes |
1076 | | -Set $cont to an array of initial data and return false to define a new sidebar box |
1077 | | -&$skin: Skin object |
1078 | | -$boxName: Name of the custom box to match |
1079 | | -&$cont: Content array |
1080 | | - |
1081 | 1060 | 'SkinSubPageSubtitle': At the beginning of Skin::subPageSubtitle() |
1082 | 1061 | $skin: Skin object |
1083 | 1062 | &$subpages: Subpage links HTML |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -964,62 +964,54 @@ |
965 | 965 | |
966 | 966 | global $wgRequest, $wgAllowUserCss, $wgUseSiteCss, $wgContLang, $wgSquidMaxage, $wgStylePath, $wgUser; |
967 | 967 | |
968 | | - $stylesheets = array(); |
969 | | - $rawcss = ''; |
| 968 | + $sitecss = ''; |
| 969 | + $usercss = ''; |
970 | 970 | $siteargs = '&maxage=' . $wgSquidMaxage; |
971 | | - $userPreview = false; |
972 | 971 | if( $this->loggedin ) { |
973 | 972 | // Ensure that logged-in users' generated CSS isn't clobbered |
974 | 973 | // by anons' publicly cacheable generated CSS. |
975 | 974 | $siteargs .= '&smaxage=0'; |
976 | | - |
977 | | - // If we allow user-specific code append some arguments for it |
978 | | - if( $wgAllowUserCss ) { |
979 | | - $action = $wgRequest->getText('action'); |
980 | | - $userPreview = $this->mTitle->isCssSubpage() && $this->userCanPreview( $action ); |
981 | | - $siteargs .= '&ts=' . $wgUser->mTouched; |
982 | | - if( $userPreview ) $siteargs = "&smaxage=0&maxage=0"; |
| 975 | + } |
| 976 | + |
| 977 | + # Add user-specific code if this is a user and we allow that kind of thing |
| 978 | + |
| 979 | + if ( $wgAllowUserCss && $this->loggedin ) { |
| 980 | + $action = $wgRequest->getText('action'); |
| 981 | + |
| 982 | + # if we're previewing the CSS page, use it |
| 983 | + if( $this->mTitle->isCssSubpage() and $this->userCanPreview( $action ) ) { |
| 984 | + $siteargs = "&smaxage=0&maxage=0"; |
| 985 | + $usercss = $wgRequest->getText('wpTextbox1'); |
| 986 | + } else { |
| 987 | + $usercss = '@import "' . |
| 988 | + self::makeUrl($this->userpage . '/'.$this->skinname.'.css', |
| 989 | + 'action=raw&ctype=text/css') . '";' ."\n"; |
983 | 990 | } |
| 991 | + |
| 992 | + $siteargs .= '&ts=' . $wgUser->mTouched; |
984 | 993 | } |
985 | | - |
| 994 | + |
986 | 995 | if( $wgContLang->isRTL() && in_array( 'rtl', $this->cssfiles ) ) { |
987 | 996 | global $wgStyleVersion; |
988 | | - $stylesheets['skinrtl'] = "$wgStylePath/$this->stylename/rtl.css?$wgStyleVersion"; |
| 997 | + $sitecss .= "@import \"$wgStylePath/$this->stylename/rtl.css?$wgStyleVersion\";\n"; |
989 | 998 | } |
990 | | - |
| 999 | + |
991 | 1000 | # If we use the site's dynamic CSS, throw that in, too |
992 | | - if( $wgUseSiteCss ) { |
| 1001 | + if ( $wgUseSiteCss ) { |
993 | 1002 | $query = "usemsgcache=yes&action=raw&ctype=text/css&smaxage=$wgSquidMaxage"; |
994 | 1003 | $skinquery = ''; |
995 | 1004 | if (($us = $wgRequest->getVal('useskin', '')) !== '') |
996 | 1005 | $skinquery = "&useskin=$us"; |
997 | | - $stylesheets['sitecommon'] = self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI); |
998 | | - $stylesheets['siteskin'] = self::makeNSUrl( ucfirst( $this->skinname ) . '.css', $query, NS_MEDIAWIKI ); |
999 | | - $stylesheets['gen'] = self::makeUrl( '-', "action=raw&gen=css$siteargs$skinquery" ); |
| 1006 | + $sitecss .= '@import "' . self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI) . '";' . "\n"; |
| 1007 | + $sitecss .= '@import "' . self::makeNSUrl( ucfirst( $this->skinname ) . '.css', $query, NS_MEDIAWIKI ) . '";' . "\n"; |
| 1008 | + $sitecss .= '@import "' . self::makeUrl( '-', "action=raw&gen=css$siteargs$skinquery" ) . '";' . "\n"; |
1000 | 1009 | } |
1001 | | - |
1002 | | - # Add user-specific code if this is a user and we allow that kind of thing |
1003 | | - if( $wgAllowUserCss && $this->loggedin ) { |
1004 | | - # if we're previewing the CSS page, use it |
1005 | | - if( $userPreview ) { |
1006 | | - $rawcss .= $wgRequest->getText('wpTextbox1'); |
1007 | | - } else { |
1008 | | - $stylesheets['userskin'] = self::makeUrl( |
1009 | | - $this->userpage . '/'.$this->skinname.'.css', |
1010 | | - 'action=raw&ctype=text/css'); |
1011 | | - } |
1012 | | - } |
1013 | | - |
1014 | | - wfRunHooks( 'SkinSetupSiteCss', array( &$stylesheets, &$rawcss, $query ) ); |
1015 | | - |
| 1010 | + |
1016 | 1011 | # If we use any dynamic CSS, make a little CDATA block out of it. |
1017 | | - $s = ''; |
1018 | | - foreach( $stylesheets as $link ) { |
1019 | | - $s .= "@import \"$link\";\n"; |
| 1012 | + |
| 1013 | + if ( !empty($sitecss) || !empty($usercss) ) { |
| 1014 | + $this->usercss = "/*<![CDATA[*/\n" . $sitecss . $usercss . '/*]]>*/'; |
1020 | 1015 | } |
1021 | | - $s .= $rawcss; |
1022 | | - if( $s != '' ) $this->usercss = "/*<![CDATA[*/\n{$s}/*]]>*/"; |
1023 | | - |
1024 | 1016 | wfProfileOut( __METHOD__ ); |
1025 | 1017 | } |
1026 | 1018 | |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -361,8 +361,6 @@ |
362 | 362 | } |
363 | 363 | $vars['wgAjaxWatch'] = $msgs; |
364 | 364 | } |
365 | | - |
366 | | - wfRunHooks('SkinGlobalVariables', array(&$vars)); |
367 | 365 | |
368 | 366 | return self::makeVariablesScript( $vars ); |
369 | 367 | } |
— | — | @@ -420,25 +418,17 @@ |
421 | 419 | function getUserStylesheet() { |
422 | 420 | global $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage, $wgStyleVersion; |
423 | 421 | $sheet = $this->getStylesheet(); |
| 422 | + $s = "@import \"$wgStylePath/common/shared.css?$wgStyleVersion\";\n"; |
| 423 | + $s .= "@import \"$wgStylePath/common/oldshared.css?$wgStyleVersion\";\n"; |
| 424 | + $s .= "@import \"$wgStylePath/$sheet?$wgStyleVersion\";\n"; |
| 425 | + if($wgContLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_rtl.css?$wgStyleVersion\";\n"; |
| 426 | + |
424 | 427 | $query = "usemsgcache=yes&action=raw&ctype=text/css&smaxage=$wgSquidMaxage"; |
425 | | - |
426 | | - $stylesheets = array(); |
427 | | - $stylesheets['shared'] = "$wgStylePath/common/shared.css?$wgStyleVersion"; |
428 | | - $stylesheets['oldshared'] = "$wgStylePath/common/oldshared.css?$wgStyleVersion"; |
429 | | - $stylesheets['skin'] = "$wgStylePath/$sheet?$wgStyleVersion"; |
430 | | - if($wgContLang->isRTL()) $stylesheets['rtl'] = "$wgStylePath/common/common_rtl.css?$wgStyleVersion"; |
431 | | - $stylesheets['sitecommon'] = self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI ); |
432 | | - $stylesheets['siteskin'] = self::makeNSUrl( ucfirst( $this->getSkinName() . '.css' ), $query, NS_MEDIAWIKI ); |
433 | | - |
434 | | - $rawcss = $this->doGetUserStyles(); |
435 | | - |
436 | | - wfRunHooks( 'SkinSetupSiteCss', array( &$stylesheets, &$rawcss, $query ) ); |
437 | | - |
438 | | - $s = ''; |
439 | | - foreach( $stylesheets as $link ) { |
440 | | - $s .= "@import \"$link\";\n"; |
441 | | - } |
442 | | - return "{$s}{$rawcss}\n"; |
| 428 | + $s .= '@import "' . self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI ) . "\";\n" . |
| 429 | + '@import "' . self::makeNSUrl( ucfirst( $this->getSkinName() . '.css' ), $query, NS_MEDIAWIKI ) . "\";\n"; |
| 430 | + |
| 431 | + $s .= $this->doGetUserStyles(); |
| 432 | + return $s."\n"; |
443 | 433 | } |
444 | 434 | |
445 | 435 | /** |
— | — | @@ -1682,35 +1672,19 @@ |
1683 | 1673 | $bar = array(); |
1684 | 1674 | $lines = explode( "\n", wfMsgForContent( 'sidebar' ) ); |
1685 | 1675 | $heading = ''; |
1686 | | - $specialBox = false; |
1687 | 1676 | foreach ($lines as $line) { |
1688 | 1677 | if (strpos($line, '*') !== 0) |
1689 | 1678 | continue; |
1690 | 1679 | if (strpos($line, '**') !== 0) { |
1691 | 1680 | $line = trim($line, '* '); |
1692 | | - |
1693 | 1681 | if ( $line == 'SEARCH' || $line == 'TOOLBOX' || $line == 'LANGUAGES' ) { |
1694 | | - # Internal special box type |
| 1682 | + # Special box type |
1695 | 1683 | $bar[$line] = array(); |
1696 | | - $specialBox = true; |
1697 | 1684 | } else { |
1698 | | - $cont = null; |
1699 | | - # Allow extensions to start a special box |
1700 | | - if( !wfRunHooks( 'SkinSidebarSpecialBox', array( &$this, $line, &$cont ) ) ) { |
1701 | | - # Extension special box type |
1702 | | - $bar[$line] = $cont; |
1703 | | - $specialBox = true; |
1704 | | - } else { |
1705 | | - # Normal box |
1706 | | - $specialBox = false; |
1707 | | - } |
| 1685 | + $heading = $line; |
1708 | 1686 | } |
1709 | | - $heading = $line; |
1710 | 1687 | } else { |
1711 | | - if( $specialBox ) { |
1712 | | - # Inside a special box, we just append the lines into the $cont |
1713 | | - $bar[$heading][] = $line; |
1714 | | - } elseif (strpos($line, '|') !== false) { // sanity check |
| 1688 | + if (strpos($line, '|') !== false) { // sanity check |
1715 | 1689 | $line = array_map('trim', explode( '|' , trim($line, '* '), 2 ) ); |
1716 | 1690 | $link = wfMsgForContent( $line[0] ); |
1717 | 1691 | if ($link == '-') |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -181,19 +181,12 @@ |
182 | 182 | * (bug 11732) Allow localisation of edit button images |
183 | 183 | * Allow the search box, toolbox and languages box in the Monobook sidebar to be |
184 | 184 | moved around arbitrarily using special sections in [[MediaWiki:Sidebar]]: |
185 | | - SEARCH, TOOLBOX and LANGUAGES extensions may also add new custom boxes to the |
186 | | - sidebar by hooking into SkinSidebarSpecialBox to define the box and into |
187 | | - SkinSidebarOutputSpecialBox to output data for the box. |
| 185 | + SEARCH, TOOLBOX and LANGUAGES |
188 | 186 | * Add a new hook NormalizeMessageKey to allow extensions to replace messages before |
189 | 187 | the database is potentially queried |
190 | 188 | * (bug 9736) Redirects on Special:Fewestrevisions are now marked as such. |
191 | 189 | * New date/time formats in Cs localization according to ČSN and PČP. |
192 | | -* Add a new hook SkinSetupSiteCss to allow extensions to define new stylesheets |
193 | | - to load site wide, or modify the list of stylesheets to load. This can be useful |
194 | | - for wiki farms who need a specific placement of the stylesheets to cascade right. |
195 | | -* Add a new hook SkinGlobalVariables to allow extensions to add new global variables |
196 | | - to be exported for JavaScript code to make use of. |
197 | | - |
| 190 | + |
198 | 191 | === Bug fixes in 1.13 === |
199 | 192 | |
200 | 193 | * (bug 10677) Add link to the file description page on the shared repository |