Index: trunk/extensions/DPLforum/DPLforum.namespaces.php |
— | — | @@ -0,0 +1,29 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Translations of the Forum namespace. |
| 5 | + * |
| 6 | + * @file |
| 7 | + */ |
| 8 | + |
| 9 | +$namespaceNames = array(); |
| 10 | + |
| 11 | +// For wikis where the DPLforum extension is not installed. |
| 12 | +if( !defined( 'NS_FORUM' ) ) { |
| 13 | + define( 'NS_FORUM', 110 ); |
| 14 | +} |
| 15 | + |
| 16 | +if( !defined( 'NS_FORUM_TALK' ) ) { |
| 17 | + define( 'NS_FORUM_TALK', 111 ); |
| 18 | +} |
| 19 | + |
| 20 | +/** English */ |
| 21 | +$namespaceNames['en'] = array( |
| 22 | + NS_FORUM => 'Forum', |
| 23 | + NS_FORUM_TALK => 'Forum_talk', |
| 24 | +); |
| 25 | + |
| 26 | +/** Finnish (Suomi) */ |
| 27 | +$namespaceNames['fi'] = array( |
| 28 | + NS_FORUM => 'Foorumi', |
| 29 | + NS_FORUM_TALK => 'Keskustelu_foorumista', |
| 30 | +); |
\ No newline at end of file |
Property changes on: trunk/extensions/DPLforum/DPLforum.namespaces.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 31 | + native |
Index: trunk/extensions/DPLforum/DPLforum.php |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | 4 | |
5 | | - DPLforum v3.3.1 -- DynamicPageList-based forum extension |
| 5 | + DPLforum v3.3.3 -- DynamicPageList-based forum extension |
6 | 6 | |
7 | 7 | Author: Ross McClure |
8 | 8 | http://www.mediawiki.org/wiki/User:Algorithm |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | http://www.gnu.org/copyleft/gpl.html |
28 | 28 | |
29 | 29 | To install, add following to LocalSettings.php |
30 | | - require_once("extensions/DPLforum/DPLforum.php"); |
| 30 | + require_once("$IP/extensions/DPLforum/DPLforum.php"); |
31 | 31 | |
32 | 32 | */ |
33 | 33 | |
— | — | @@ -35,19 +35,29 @@ |
36 | 36 | die( 1 ); |
37 | 37 | } |
38 | 38 | |
39 | | -$wgHooks['ParserFirstCallInit'][] = 'wfDPLinit'; |
40 | | -$wgHooks['LanguageGetMagic'][] = 'wfDPLmagic'; |
| 39 | +// Extension credits that will show up on Special:Version |
41 | 40 | $wgExtensionCredits['parserhook'][] = array( |
42 | 41 | 'path' => __FILE__, |
43 | 42 | 'name' => 'DPLforum', |
44 | 43 | 'author' => 'Ross McClure', |
45 | | - 'version' => '3.3.2', |
| 44 | + 'version' => '3.3.3', |
46 | 45 | 'url' => 'http://www.mediawiki.org/wiki/Extension:DPLforum', |
47 | 46 | 'descriptionmsg' => 'dplforum-desc', |
48 | 47 | ); |
49 | 48 | |
| 49 | +// Define the namespace constants |
| 50 | +define( 'NS_FORUM', 110 ); |
| 51 | +define( 'NS_FORUM_TALK', 111 ); |
| 52 | + |
| 53 | +// Hooked functions |
| 54 | +$wgHooks['ParserFirstCallInit'][] = 'wfDPLinit'; |
| 55 | +$wgHooks['LanguageGetMagic'][] = 'wfDPLmagic'; |
| 56 | +$wgHooks['CanonicalNamespaces'][] = 'wfDPLforumCanonicalNamespaces'; |
| 57 | + |
| 58 | +// Set up i18n and autoload the main class |
50 | 59 | $dir = dirname( __FILE__ ) . '/'; |
51 | 60 | $wgExtensionMessagesFiles['DPLforum'] = $dir . 'DPLforum.i18n.php'; |
| 61 | +$wgExtensionMessagesFiles['DPLforumNamespaces'] = $dir . 'DPLforum.namespaces.php'; |
52 | 62 | $wgAutoloadClasses['DPLForum'] = $dir . 'DPLforum_body.php'; |
53 | 63 | |
54 | 64 | function wfDPLinit( &$parser ) { |
— | — | @@ -68,3 +78,16 @@ |
69 | 79 | $f = new DPLForum(); |
70 | 80 | return $f->parse( $input, $parser ); |
71 | 81 | } |
| 82 | + |
| 83 | +/** |
| 84 | + * Register the canonical names for our namespace and its talkspace. |
| 85 | + * |
| 86 | + * @param $list Array: array of namespace numbers with corresponding |
| 87 | + * canonical names |
| 88 | + * @return Boolean: true |
| 89 | + */ |
| 90 | +function wfDPLforumCanonicalNamespaces( &$list ) { |
| 91 | + $list[NS_FORUM] = 'Forum'; |
| 92 | + $list[NS_FORUM_TALK] = 'Forum_talk'; |
| 93 | + return true; |
| 94 | +} |
\ No newline at end of file |