Index: trunk/extensions/ArrayExtension/ArrayExtension.php |
— | — | @@ -1,16 +1,29 @@ |
2 | 2 | <?php |
3 | | -/* |
4 | | - Defines a subset of parser functions that operate with arrays. |
5 | | - verion: 1.3.2 |
6 | | - authors: Li Ding (lidingpku@gmail.com) and Jie Bao, Daniel Werner (since version 1.3) |
7 | | - update: 24th January 2011 |
8 | 3 | |
9 | | - homepage: http://www.mediawiki.org/wiki/Extension:ArrayExtension |
| 4 | +/** |
| 5 | + * Initialization file for the ArrayExtension extension. |
| 6 | + * |
| 7 | + * Documentation: http://www.mediawiki.org/wiki/Extension:ArrayExtension |
| 8 | + * Support http://www.mediawiki.org/wiki/Extension_talk:ArrayExtension |
| 9 | + * Source code: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/ArrayExtension |
| 10 | + * |
| 11 | + * @file ArrayExtension.php |
| 12 | + * @ingroup ArrayExtension |
| 13 | + * |
| 14 | + * @licence MIT License |
| 15 | + * |
| 16 | + * @author Li Ding (lidingpku@gmail.com) |
| 17 | + * @author Jie Bao |
| 18 | + * @author Daniel Werner (since version 1.3) |
| 19 | + */ |
10 | 20 | |
| 21 | +/** |
| 22 | + * This documenation group collects source code files belonging to ArrayExtension. |
| 23 | + * |
| 24 | + * @defgroup ArrayExtension ArrayExtension |
| 25 | + */ |
11 | 26 | |
12 | | -ToDo: |
13 | | -===== |
14 | | - |
| 27 | +/* TODO: |
15 | 28 | - add experimental table (2 dimension array) data structure |
16 | 29 | * table = header, row+ (1,1....) |
17 | 30 | * sort_table_by_header (header) |
— | — | @@ -23,7 +36,6 @@ |
24 | 37 | * get_table_header () to an array |
25 | 38 | * get_total_row |
26 | 39 | * get_total_col |
27 | | - |
28 | 40 | */ |
29 | 41 | |
30 | 42 | if ( ! defined( 'MEDIAWIKI' ) ) { |
— | — | @@ -36,9 +48,11 @@ |
37 | 49 | 'name' => 'ArrayExtension', |
38 | 50 | 'url' => 'http://www.mediawiki.org/wiki/Extension:ArrayExtension', |
39 | 51 | 'author' => array ( 'Li Ding', 'Jie Bao', 'Daniel Werner' ), |
40 | | - 'description' => 'Store and compute named arrays', |
| 52 | + 'descriptionmsg' => 'arrayext-desc', |
41 | 53 | 'version' => ArrayExtension::VERSION, |
| 54 | + 'path' => __FILE__ |
42 | 55 | ); |
| 56 | +$wgExtensionMessagesFiles['ArrayExtension'] = dirname( __FILE__ ) . '/ArrayExtension.i18n.php'; |
43 | 57 | |
44 | 58 | $wgHooks['LanguageGetMagic'][] = 'efArrayExtensionLanguageGetMagic'; |
45 | 59 | |
— | — | @@ -48,7 +62,7 @@ |
49 | 63 | */ |
50 | 64 | class ArrayExtension { |
51 | 65 | |
52 | | - const VERSION = '1.3.3'; |
| 66 | + const VERSION = '1.3.4 alpha'; |
53 | 67 | |
54 | 68 | var $mArrayExtension = array(); |
55 | 69 | |
— | — | @@ -173,7 +187,7 @@ |
174 | 188 | } |
175 | 189 | |
176 | 190 | function arrayprintObj( &$parser, $frame, $args ) { |
177 | | - // Set variables |
| 191 | + // Set variables |
178 | 192 | $arrayid = isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : ''; |
179 | 193 | $delimiter = isset( $args[1] ) ? trim( $frame->expand( $args[1] ) ) : ', '; |
180 | 194 | $search = isset( $args[2] ) ? trim( $frame->expand( $args[2], PPFrame::NO_ARGS | PPFrame::NO_TEMPLATES ) ) : '@@@@'; |
— | — | @@ -764,7 +778,10 @@ |
765 | 779 | |
766 | 780 | function efArrayExtensionLanguageGetMagic( &$magicWords, $langCode ) { |
767 | 781 | require_once( dirname( __FILE__ ) . '/ArrayExtension.i18n.magic.php' ); |
768 | | - foreach ( efArrayExtensionWords( $langCode ) as $word => $trans ) |
769 | | - $magicWords[$word] = $trans; |
| 782 | + |
| 783 | + foreach ( efArrayExtensionWords( $langCode ) as $word => $trans ) { |
| 784 | + $magicWords[$word] = $trans; |
| 785 | + } |
| 786 | + |
770 | 787 | return true; |
771 | | -} |
\ No newline at end of file |
| 788 | +} |
Index: trunk/extensions/ArrayExtension/ArrayExtension.i18n.magic.php |
— | — | @@ -1,9 +1,19 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
| 5 | + * Internationalization file for magic words in the ArrayExtension extension. |
| 6 | + * |
| 7 | + * @file ArrayExtension.i18n.magic.php |
| 8 | + * @ingroup ArrayExtension |
| 9 | + * |
| 10 | + * @licence MIT License |
| 11 | + */ |
| 12 | + |
| 13 | +/** |
5 | 14 | * Get translated magic words, if available |
6 | 15 | * |
7 | 16 | * @param string $lang Language code |
| 17 | + * |
8 | 18 | * @return array |
9 | 19 | */ |
10 | 20 | function efArrayExtensionWords( $lang ) { |
— | — | @@ -38,4 +48,4 @@ |
39 | 49 | return ( $lang == 'en' || !isset( $words[$lang] ) ) |
40 | 50 | ? $words['en'] |
41 | 51 | : array_merge( $words['en'], $words[$lang] ); |
42 | | -} |
\ No newline at end of file |
| 52 | +} |