Index: trunk/extensions/uniwiki/CatBoxAtTop/CatBoxAtTop.php |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | * http://www.mediawiki.org/wiki/Extension:Uniwiki_Category_Box_at_Top |
5 | 5 | * http://www.gnu.org/licenses/gpl-3.0.txt */ |
6 | 6 | |
7 | | -if (!defined("MEDIAWIKI")) |
| 7 | +if ( !defined( "MEDIAWIKI" ) ) |
8 | 8 | die(); |
9 | 9 | |
10 | 10 | /* ---- CREDITS ---- */ |
— | — | @@ -24,18 +24,18 @@ |
25 | 25 | $wgHooks['BeforePageDisplay'][] = "UW_CatBoxAtTop_CSS"; |
26 | 26 | $wgHooks['OutputPageBeforeHTML'][] = "UW_CatBoxAtTop_Rejig"; |
27 | 27 | |
28 | | -function UW_CatBoxAtTop_CSS (&$out) { |
| 28 | +function UW_CatBoxAtTop_CSS ( &$out ) { |
29 | 29 | global $wgScriptPath; |
30 | 30 | $href = "$wgScriptPath/extensions/uniwiki/CatBoxAtTop/style.css"; |
31 | | - $out->addScript ("<link rel='stylesheet' href='$href' />"); |
| 31 | + $out->addScript ( "<link rel='stylesheet' href='$href' />" ); |
32 | 32 | return true; |
33 | 33 | } |
34 | 34 | |
35 | | -function UW_CatBoxAtTop_Rejig (&$out, &$text) { |
| 35 | +function UW_CatBoxAtTop_Rejig ( &$out, &$text ) { |
36 | 36 | global $wgVersion; |
37 | 37 | |
38 | 38 | // no categories = no box |
39 | | - if (!$out->mCategoryLinks) |
| 39 | + if ( !$out->mCategoryLinks ) |
40 | 40 | return true; |
41 | 41 | |
42 | 42 | /* add a category box to the top of the output, |
— | — | @@ -43,16 +43,16 @@ |
44 | 44 | $catbox = "<div id=\"catbox\"><div>\n"; |
45 | 45 | $catbox .= "<h5>Categories</h5><ul>\n"; |
46 | 46 | $catlinks = array(); |
47 | | - if ($wgVersion == '1.13.0') { |
| 47 | + if ( $wgVersion == '1.13.0' ) { |
48 | 48 | $catlinks = $out->mCategoryLinks['normal']; |
49 | 49 | } else { |
50 | 50 | $catlinks = $out->mCategoryLinks; |
51 | 51 | } |
52 | 52 | |
53 | | - foreach ($catlinks as $cat) |
| 53 | + foreach ( $catlinks as $cat ) |
54 | 54 | $catbox .= "<li>$cat</li>\n"; |
55 | 55 | $catbox .= "</ul></div></div>\n"; |
56 | 56 | |
57 | | - $text = $catbox.$text; |
| 57 | + $text = $catbox . $text; |
58 | 58 | return true; |
59 | 59 | } |