Index: trunk/extensions/ArrayExtension/ArrayExtension.php |
— | — | @@ -12,9 +12,9 @@ |
13 | 13 | * |
14 | 14 | * @licence MIT License |
15 | 15 | * |
16 | | - * @author Li Ding (lidingpku@gmail.com) |
| 16 | + * @author Li Ding < lidingpku@gmail.com > |
17 | 17 | * @author Jie Bao |
18 | | - * @author Daniel Werner (since version 1.3) |
| 18 | + * @author Daniel Werner < danweetz@web.de > (since version 1.3) |
19 | 19 | * |
20 | 20 | * @ToDo: |
21 | 21 | * use $egArrayExtensionCompatbilityMode to finally get rid of unlogic behavior of certain functions |
— | — | @@ -23,27 +23,6 @@ |
24 | 24 | * things more consistent and clear. |
25 | 25 | */ |
26 | 26 | |
27 | | -/** |
28 | | - * This documenation group collects source code files belonging to ArrayExtension. |
29 | | - * |
30 | | - * @defgroup ArrayExtension ArrayExtension |
31 | | - */ |
32 | | - |
33 | | -/* TODO: |
34 | | - - add experimental table (2 dimension array) data structure |
35 | | - * table = header, row+ (1,1....) |
36 | | - * sort_table_by_header (header) |
37 | | - * sort_table_by_col (col) |
38 | | - * print_table (format) e.g. csv, ul, ol, |
39 | | - * add_table_row (array) |
40 | | - * get_table_row (row) to an array |
41 | | - * add_table_col(array) |
42 | | - * get_table_col (col) to an array |
43 | | - * get_table_header () to an array |
44 | | - * get_total_row |
45 | | - * get_total_col |
46 | | -*/ |
47 | | - |
48 | 27 | if ( ! defined( 'MEDIAWIKI' ) ) { die(); } |
49 | 28 | |
50 | 29 | $wgExtensionCredits['parserhook'][] = array( |
— | — | @@ -297,7 +276,14 @@ |
298 | 277 | $array = self::get( $parser )->getArray( $arrayId ); |
299 | 278 | |
300 | 279 | if( $array === null ) { |
301 | | - return ''; |
| 280 | + // array we want to print doesn't exist! |
| 281 | + global $egArrayExtensionCompatbilityMode; |
| 282 | + if( ! $egArrayExtensionCompatbilityMode ) { |
| 283 | + return ''; |
| 284 | + } else { |
| 285 | + // COMPATIBILITY-MODE |
| 286 | + return "undefined array: $arrayId"; |
| 287 | + } |
302 | 288 | } |
303 | 289 | |
304 | 290 | $rendered_values = array(); |
— | — | @@ -821,9 +807,14 @@ |
822 | 808 | |
823 | 809 | global $egArrayExtensionCompatbilityMode; |
824 | 810 | |
825 | | - if( ! $operationRan && $egArrayExtensionCompatbilityMode ) { |
826 | | - // COMPATIBILITY-MODE: |
827 | | - // Before version 2.0 we didn't create a new array in case only one array was given |
| 811 | + if( ! $operationRan && $egArrayExtensionCompatbilityMode |
| 812 | + && $operationFunc !== 'multi_arraymerge' // only exception was 'arraymerge' |
| 813 | + ) { |
| 814 | + /* |
| 815 | + * COMPATIBILITY-MODE: |
| 816 | + * Before version 2.0 we didn't create a new array in case only one array was given. |
| 817 | + * The only exception was 'arraymerge' which did duplicate the array. |
| 818 | + */ |
828 | 819 | return ''; |
829 | 820 | } |
830 | 821 | |