Index: trunk/extensions/Favorites/Favorites_body.php |
— | — | @@ -19,7 +19,6 @@ |
20 | 20 | if ($wgArticle) { |
21 | 21 | |
22 | 22 | if ( $wgUseIconFavorite ) { |
23 | | - |
24 | 23 | $class = 'icon '; |
25 | 24 | $place = 'views'; |
26 | 25 | } else { |
Index: trunk/extensions/Favorites/Favorites.php |
— | — | @@ -22,13 +22,11 @@ |
23 | 23 | 'name' => 'Favorites', |
24 | 24 | 'author' => 'Jeremy Lemley', |
25 | 25 | 'descriptionmsg' => 'favorites-desc', |
26 | | - 'version' => '0.2.0', |
| 26 | + 'version' => '0.2.2', |
27 | 27 | 'url' => "http://www.mediawiki.org/wiki/Extension:Favorites", |
28 | 28 | ); |
29 | | - |
30 | | - |
31 | 29 | |
32 | | - |
| 30 | +global $wgUseIconFavorite; |
33 | 31 | $dir = dirname(__FILE__) . '/'; |
34 | 32 | $wgExtensionMessagesFiles['Favorites'] = $dir . 'favorites.i18n.php'; |
35 | 33 | $wgAutoloadClasses['Favorites'] = $dir . 'Favorites_body.php'; |
— | — | @@ -52,6 +50,11 @@ |
53 | 51 | $wgHooks['SkinTemplateNavigation'][] = 'fnNavUrls'; // For Vector |
54 | 52 | $wgHooks['SkinTemplateTabs'][] = 'fnNavTabs'; // For other skins |
55 | 53 | |
| 54 | +if ($wgUseIconFavorite){ |
| 55 | + //add CSS - only needed for icon display |
| 56 | + $wgHooks['BeforePageDisplay'][] = 'fnAddCss'; |
| 57 | +} |
| 58 | + |
56 | 59 | //add or remove |
57 | 60 | $wgHooks['UnknownAction'][] = 'fnAction'; |
58 | 61 | |
— | — | @@ -59,10 +62,7 @@ |
60 | 63 | $wgHooks['TitleMoveComplete'][] = 'fnHookMoveToFav'; |
61 | 64 | $wgHooks['ArticleDeleteComplete'][] = 'fnHookDeleteFav'; |
62 | 65 | |
63 | | -//add CSS |
64 | | -$wgHooks['BeforePageDisplay'][] = 'fnAddCss'; |
65 | 66 | |
66 | | - |
67 | 67 | function fnAction ($action, $article) { |
68 | 68 | $title = new Title(); |
69 | 69 | $favArticle = new FavArticle($title); |
— | — | @@ -107,7 +107,7 @@ |
108 | 108 | |
109 | 109 | function fnAddCss (&$out) { |
110 | 110 | global $wgScriptPath; |
111 | | - $out->addStyle($wgScriptPath. '/extensions/favorites/favorites.css'); |
| 111 | + $out->addStyle($wgScriptPath. '/extensions/Favorites/favorites.css'); |
112 | 112 | return true; |
113 | 113 | } |
114 | 114 | |