Index: trunk/phase3/includes/Preferences.php |
— | — | @@ -38,10 +38,10 @@ |
39 | 39 | /** |
40 | 40 | * @throws MWException |
41 | 41 | * @param $user User |
42 | | - * @param $context ContextSource |
| 42 | + * @param $context IContextSource |
43 | 43 | * @return array|null |
44 | 44 | */ |
45 | | - public static function getPreferences( $user, ContextSource $context ) { |
| 45 | + static function getPreferences( $user, IContextSource $context ) { |
46 | 46 | if ( self::$defaultPreferences ) { |
47 | 47 | return self::$defaultPreferences; |
48 | 48 | } |
— | — | @@ -127,11 +127,11 @@ |
128 | 128 | |
129 | 129 | /** |
130 | 130 | * @param $user User |
131 | | - * @param $context ContextSource |
| 131 | + * @param $context IContextSource |
132 | 132 | * @param $defaultPreferences |
133 | 133 | * @return void |
134 | 134 | */ |
135 | | - static function profilePreferences( $user, ContextSource $context, &$defaultPreferences ) { |
| 135 | + static function profilePreferences( $user, IContextSource $context, &$defaultPreferences ) { |
136 | 136 | global $wgAuth, $wgContLang, $wgParser, $wgCookieExpiration, $wgLanguageCode, |
137 | 137 | $wgDisableTitleConversion, $wgDisableLangConversion, $wgMaxSigChars, |
138 | 138 | $wgEnableEmail, $wgEmailConfirmToEdit, $wgEnableUserEmail, $wgEmailAuthentication, |
— | — | @@ -454,11 +454,11 @@ |
455 | 455 | |
456 | 456 | /** |
457 | 457 | * @param $user User |
458 | | - * @param $context ContextSource |
| 458 | + * @param $context IContextSource |
459 | 459 | * @param $defaultPreferences |
460 | 460 | * @return void |
461 | 461 | */ |
462 | | - static function skinPreferences( $user, ContextSource $context, &$defaultPreferences ) { |
| 462 | + static function skinPreferences( $user, IContextSource $context, &$defaultPreferences ) { |
463 | 463 | ## Skin ##################################### |
464 | 464 | global $wgAllowUserCss, $wgAllowUserJs; |
465 | 465 | |
— | — | @@ -509,10 +509,10 @@ |
510 | 510 | |
511 | 511 | /** |
512 | 512 | * @param $user User |
513 | | - * @param $context ContextSource |
| 513 | + * @param $context IContextSource |
514 | 514 | * @param $defaultPreferences Array |
515 | 515 | */ |
516 | | - static function filesPreferences( $user, ContextSource $context, &$defaultPreferences ) { |
| 516 | + static function filesPreferences( $user, IContextSource $context, &$defaultPreferences ) { |
517 | 517 | ## Files ##################################### |
518 | 518 | $defaultPreferences['imagesize'] = array( |
519 | 519 | 'type' => 'select', |
— | — | @@ -530,11 +530,11 @@ |
531 | 531 | |
532 | 532 | /** |
533 | 533 | * @param $user User |
534 | | - * @param $context ContextSource |
| 534 | + * @param $context IContextSource |
535 | 535 | * @param $defaultPreferences |
536 | 536 | * @return void |
537 | 537 | */ |
538 | | - static function datetimePreferences( $user, ContextSource $context, &$defaultPreferences ) { |
| 538 | + static function datetimePreferences( $user, IContextSource $context, &$defaultPreferences ) { |
539 | 539 | ## Date and time ##################################### |
540 | 540 | $dateOptions = self::getDateOptions( $context ); |
541 | 541 | if ( $dateOptions ) { |
— | — | @@ -603,10 +603,10 @@ |
604 | 604 | |
605 | 605 | /** |
606 | 606 | * @param $user User |
607 | | - * @param $context ContextSource |
| 607 | + * @param $context IContextSource |
608 | 608 | * @param $defaultPreferences Array |
609 | 609 | */ |
610 | | - static function renderingPreferences( $user, ContextSource $context, &$defaultPreferences ) { |
| 610 | + static function renderingPreferences( $user, IContextSource $context, &$defaultPreferences ) { |
611 | 611 | ## Page Rendering ############################## |
612 | 612 | global $wgAllowUserCssPrefs; |
613 | 613 | if ( $wgAllowUserCssPrefs ) { |
— | — | @@ -681,10 +681,10 @@ |
682 | 682 | |
683 | 683 | /** |
684 | 684 | * @param $user User |
685 | | - * @param $context ContextSource |
| 685 | + * @param $context IContextSource |
686 | 686 | * @param $defaultPreferences Array |
687 | 687 | */ |
688 | | - static function editingPreferences( $user, ContextSource $context, &$defaultPreferences ) { |
| 688 | + static function editingPreferences( $user, IContextSource $context, &$defaultPreferences ) { |
689 | 689 | global $wgUseExternalEditor, $wgAllowUserCssPrefs; |
690 | 690 | |
691 | 691 | ## Editing ##################################### |
— | — | @@ -781,10 +781,10 @@ |
782 | 782 | |
783 | 783 | /** |
784 | 784 | * @param $user User |
785 | | - * @param $context ContextSource |
| 785 | + * @param $context IContextSource |
786 | 786 | * @param $defaultPreferences Array |
787 | 787 | */ |
788 | | - static function rcPreferences( $user, ContextSource $context, &$defaultPreferences ) { |
| 788 | + static function rcPreferences( $user, IContextSource $context, &$defaultPreferences ) { |
789 | 789 | global $wgRCMaxAge, $wgRCShowWatchingUsers; |
790 | 790 | |
791 | 791 | ## RecentChanges ##################################### |
— | — | @@ -838,10 +838,10 @@ |
839 | 839 | |
840 | 840 | /** |
841 | 841 | * @param $user User |
842 | | - * @param $context ContextSource |
| 842 | + * @param $context IContextSource |
843 | 843 | * @param $defaultPreferences |
844 | 844 | */ |
845 | | - static function watchlistPreferences( $user, ContextSource $context, &$defaultPreferences ) { |
| 845 | + static function watchlistPreferences( $user, IContextSource $context, &$defaultPreferences ) { |
846 | 846 | global $wgUseRCPatrol, $wgEnableAPI, $wgRCMaxAge; |
847 | 847 | |
848 | 848 | $watchlistdaysMax = ceil( $wgRCMaxAge / ( 3600 * 24 ) ); |
— | — | @@ -939,10 +939,10 @@ |
940 | 940 | |
941 | 941 | /** |
942 | 942 | * @param $user User |
943 | | - * @param $context ContextSource |
| 943 | + * @param $context IContextSource |
944 | 944 | * @param $defaultPreferences Array |
945 | 945 | */ |
946 | | - static function searchPreferences( $user, ContextSource $context, &$defaultPreferences ) { |
| 946 | + static function searchPreferences( $user, IContextSource $context, &$defaultPreferences ) { |
947 | 947 | global $wgContLang, $wgEnableMWSuggest, $wgVectorUseSimpleSearch; |
948 | 948 | |
949 | 949 | ## Search ##################################### |
— | — | @@ -1003,10 +1003,10 @@ |
1004 | 1004 | |
1005 | 1005 | /** |
1006 | 1006 | * @param $user User |
1007 | | - * @param $context ContextSource |
| 1007 | + * @param $context IContextSource |
1008 | 1008 | * @param $defaultPreferences Array |
1009 | 1009 | */ |
1010 | | - static function miscPreferences( $user, ContextSource $context, &$defaultPreferences ) { |
| 1010 | + static function miscPreferences( $user, IContextSource $context, &$defaultPreferences ) { |
1011 | 1011 | global $wgContLang; |
1012 | 1012 | |
1013 | 1013 | ## Misc ##################################### |
— | — | @@ -1035,10 +1035,10 @@ |
1036 | 1036 | |
1037 | 1037 | /** |
1038 | 1038 | * @param $user User The User object |
1039 | | - * @param $context ContextSource |
| 1039 | + * @param $context IContextSource |
1040 | 1040 | * @return Array: text/links to display as key; $skinkey as value |
1041 | 1041 | */ |
1042 | | - static function generateSkinOptions( $user, ContextSource $context ) { |
| 1042 | + static function generateSkinOptions( $user, IContextSource $context ) { |
1043 | 1043 | global $wgDefaultSkin, $wgAllowUserCss, $wgAllowUserJs; |
1044 | 1044 | $ret = array(); |
1045 | 1045 | |
— | — | @@ -1090,10 +1090,10 @@ |
1091 | 1091 | } |
1092 | 1092 | |
1093 | 1093 | /** |
1094 | | - * @param $context ContextSource |
| 1094 | + * @param $context IContextSource |
1095 | 1095 | * @return array |
1096 | 1096 | */ |
1097 | | - static function getDateOptions( ContextSource $context ) { |
| 1097 | + static function getDateOptions( IContextSource $context ) { |
1098 | 1098 | $lang = $context->getLanguage(); |
1099 | 1099 | $dateopts = $lang->getDatePreferences(); |
1100 | 1100 | |
— | — | @@ -1125,10 +1125,10 @@ |
1126 | 1126 | } |
1127 | 1127 | |
1128 | 1128 | /** |
1129 | | - * @param $context ContextSource |
| 1129 | + * @param $context IContextSource |
1130 | 1130 | * @return array |
1131 | 1131 | */ |
1132 | | - static function getImageSizes( ContextSource $context ) { |
| 1132 | + static function getImageSizes( IContextSource $context ) { |
1133 | 1133 | global $wgImageLimits; |
1134 | 1134 | |
1135 | 1135 | $ret = array(); |
— | — | @@ -1143,10 +1143,10 @@ |
1144 | 1144 | } |
1145 | 1145 | |
1146 | 1146 | /** |
1147 | | - * @param $context ContextSource |
| 1147 | + * @param $context IContextSource |
1148 | 1148 | * @return array |
1149 | 1149 | */ |
1150 | | - static function getThumbSizes( ContextSource $context ) { |
| 1150 | + static function getThumbSizes( IContextSource $context ) { |
1151 | 1151 | global $wgThumbLimits; |
1152 | 1152 | |
1153 | 1153 | $ret = array(); |
— | — | @@ -1200,12 +1200,12 @@ |
1201 | 1201 | |
1202 | 1202 | /** |
1203 | 1203 | * @param $user User |
1204 | | - * @param $context ContextSource |
| 1204 | + * @param $context IContextSource |
1205 | 1205 | * @param $formClass string |
1206 | 1206 | * @param $remove Array: array of items to remove |
1207 | 1207 | * @return HtmlForm |
1208 | 1208 | */ |
1209 | | - static function getFormObject( $user, ContextSource $context, $formClass = 'PreferencesForm', array $remove = array() ) { |
| 1209 | + static function getFormObject( $user, IContextSource $context, $formClass = 'PreferencesForm', array $remove = array() ) { |
1210 | 1210 | $formDescriptor = Preferences::getPreferences( $user, $context ); |
1211 | 1211 | if ( count( $remove ) ) { |
1212 | 1212 | $removeKeys = array_flip( $remove ); |
— | — | @@ -1229,10 +1229,9 @@ |
1230 | 1230 | } |
1231 | 1231 | |
1232 | 1232 | /** |
1233 | | - * @param $context ContextSource |
1234 | 1233 | * @return array |
1235 | 1234 | */ |
1236 | | - static function getTimezoneOptions( ContextSource $context ) { |
| 1235 | + static function getTimezoneOptions( IContextSource $context ) { |
1237 | 1236 | $opt = array(); |
1238 | 1237 | |
1239 | 1238 | global $wgLocalTZoffset, $wgLocaltimezone; |