Index: trunk/extensions/SharedHelpNamespace/SharedHelpNamespace.php |
— | — | @@ -29,8 +29,10 @@ |
30 | 30 | $dir = dirname( __FILE__ ) . '/'; |
31 | 31 | $wgExtensionMessagesFiles['SharedHelpNamespace'] = $dir . 'SharedHelpNamespace.i18n.php'; |
32 | 32 | |
33 | | -// Help wikis where the help namespace is fetched from |
34 | | -$wgSharedHelpNamespaceFetchingWikis = array(); |
| 33 | +// Help wiki(s) where the help namespace is fetched from |
| 34 | +if( !isset($wgSharedHelpNamespaceFetchingWikis) ) { |
| 35 | + $wgSharedHelpNamespaceFetchingWikis = array(); |
| 36 | +} |
35 | 37 | |
36 | 38 | // Hooks |
37 | 39 | $wgHooks['ShowMissingArticle'][] = 'wfSharedHelpNamespaceLoad'; |
— | — | @@ -145,16 +147,21 @@ |
146 | 148 | |
147 | 149 | |
148 | 150 | function wfSharedHelpNamespaceChangeEditSectionLink( $skin, $title, $section, $tooltip, $result, $lang = false ) { |
149 | | - global $wgSharedHelpNamespaceFetchingWikis, $wgLanguageCode, $wgDBname; |
| 151 | + global $wgTitle, $wgSharedHelpNamespaceFetchingWikis, $wgLanguageCode, $wgDBname; |
150 | 152 | |
151 | | - foreach ( $wgSharedHelpNamespaceFetchingWikis as $language => $urls ) { |
152 | | - foreach ( $urls as $url => $wgSharedHelpNamespaceFetchingWiki ) { |
153 | | - if ( $wgLanguageCode == "$language" && $wgDBname != $wgSharedHelpNamespaceFetchingWiki ) { |
154 | | - $result = '<span class="editsection">[<a href="'.$url.'/index.php?title='.str_replace( ' ', '_', $title ).'&action=edit&section='.$section.'" title="'.wfMsg( 'editsectionhint', $tooltip ).'">'.wfMsg( 'editsection' ).'</a>]</span>'; |
| 153 | + if ( $wgTitle->getNamespace() == NS_HELP ) { |
| 154 | + foreach ( $wgSharedHelpNamespaceFetchingWikis as $language => $urls ) { |
| 155 | + foreach ( $urls as $url => $wgSharedHelpNamespaceFetchingWiki ) { |
| 156 | + if ( $wgLanguageCode == "$language" && $wgDBname != $wgSharedHelpNamespaceFetchingWiki ) { |
| 157 | + $result = '<span class="editsection">[<a href="'.$url.'/index.php?title='.str_replace( ' ', '_', $title ).'&action=edit&section='.$section.'" title="'.wfMsg( 'editsectionhint', $tooltip ).'">'.wfMsg( 'editsection' ).'</a>]</span>'; |
| 158 | + } |
155 | 159 | } |
156 | 160 | } |
| 161 | + return true; |
| 162 | + } else { |
| 163 | + return false; |
157 | 164 | } |
158 | | - return true; |
| 165 | + |
159 | 166 | } |
160 | 167 | |
161 | 168 | |