Index: trunk/extensions/UploadWizard/UploadWizardCampaign.php |
— | — | @@ -215,11 +215,12 @@ |
216 | 216 | * @return array |
217 | 217 | */ |
218 | 218 | public function getAllConfig() { |
219 | | - $config = $this->getConfig(); |
| 219 | + $setConfig = $this->getConfig(); |
| 220 | + $config = array(); |
220 | 221 | |
221 | 222 | foreach ( self::getDefaultConfig() as $name => $data ) { |
222 | | - if ( array_key_exists( $name, $config ) ) { |
223 | | - $data['default'] = $config[$name]; |
| 223 | + if ( array_key_exists( $name, $setConfig ) ) { |
| 224 | + $data['default'] = $setConfig[$name]; |
224 | 225 | } |
225 | 226 | |
226 | 227 | $config[$name] = $data; |
— | — | @@ -236,8 +237,8 @@ |
237 | 238 | * @return array |
238 | 239 | */ |
239 | 240 | public static function getDefaultConfig() { |
240 | | - return array ( |
241 | | - 'skiptutorial' => array ( 'type' => 'check', 'default' => true ) |
| 241 | + return array ( // TODO |
| 242 | + 'skipTutorial' => array ( 'type' => 'check', 'default' => true ) |
242 | 243 | ); |
243 | 244 | } |
244 | 245 | |
Index: trunk/extensions/UploadWizard/SpecialUploadWizard.php |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | |
58 | 58 | // fallback for non-JS |
59 | 59 | $wgOut->addHTML( '<noscript>' ); |
60 | | - $wgOut->addHTML( '<p class="errorbox">' . wfMsg( 'mwe-upwiz-js-off' ) . '</p>' ); |
| 60 | + $wgOut->addHTML( '<p class="errorbox">' . htmlspecialchars( wfMsg( 'mwe-upwiz-js-off' ) ) . '</p>' ); |
61 | 61 | $this->simpleForm->show(); |
62 | 62 | $wgOut->addHTML( '</noscript>' ); |
63 | 63 | |
— | — | @@ -95,12 +95,23 @@ |
96 | 96 | * @param subpage, e.g. the "foo" in Special:UploadWizard/foo |
97 | 97 | */ |
98 | 98 | public function addJsVars( $subPage ) { |
99 | | - global $wgOut, $wgUpwizDir, $wgUploadWizardConfig, $wgSitename; |
| 99 | + global $wgOut, $wgUpwizDir, $wgUploadWizardConfig, $wgSitename, $wgRequest; |
100 | 100 | |
| 101 | + $capmaignSettings = array(); |
| 102 | + $capaignName = $wgRequest->getVal( 'campaign' ); |
| 103 | + |
| 104 | + if ( !is_null( $capaignName ) ) { |
| 105 | + $capaign = UploadWizardCampaign::newFromName( $capaignName ); |
| 106 | + |
| 107 | + if ( $capaign !== false ) { |
| 108 | + $capmaignSettings = $capaign->getConfig(); |
| 109 | + } |
| 110 | + } |
| 111 | + |
101 | 112 | // Merge the default configuration with the local settings $wgUploadWizardConfig configuration |
102 | 113 | $configPath = $wgUpwizDir . '/UploadWizard.config.php'; |
103 | 114 | if( is_file( $configPath ) ){ |
104 | | - $wgUploadWizardConfig = array_merge( include( $configPath ), $wgUploadWizardConfig ); |
| 115 | + $wgUploadWizardConfig = array_merge( include( $configPath ), $wgUploadWizardConfig, $capmaignSettings ); |
105 | 116 | } |
106 | 117 | |
107 | 118 | $wgOut->addScript( |
Index: trunk/extensions/UploadWizard/UploadWizard.config.php |
— | — | @@ -286,9 +286,4 @@ |
287 | 287 | // URL for alternative uploading form |
288 | 288 | 'altUploadForm' => '', |
289 | 289 | |
290 | | - 'campaignDefaults' => array( |
291 | | - 'skiptutorial' => false, |
292 | | - |
293 | | - ), |
294 | | - |
295 | 290 | ); |
Index: trunk/extensions/UploadWizard/UploadWizard.i18n.php |
— | — | @@ -295,7 +295,7 @@ |
296 | 296 | 'uploadcampaign-text' => 'You are modifying an Upload Wizard campaign.', |
297 | 297 | 'mwe-upwiz-campaign-name' => 'Campaign name', |
298 | 298 | 'mwe-upwiz-campaign-enabled' => 'Campaign enabled', |
299 | | - 'mwe-upwiz-campaign-conf-skiptutorial' => 'Skip the licensing tutorial', |
| 299 | + 'mwe-upwiz-campaign-conf-skipTutorial' => 'Skip the licensing tutorial', |
300 | 300 | ); |
301 | 301 | |
302 | 302 | /** Message documentation (Message documentation) |
— | — | @@ -3228,7 +3228,7 @@ |
3229 | 3229 | 'uploadcampaign-text' => 'Du modifizierst gerade eine Kampagne.', |
3230 | 3230 | 'mwe-upwiz-campaign-name' => 'Name der Kampagne', |
3231 | 3231 | 'mwe-upwiz-campaign-enabled' => 'Kampagne aktiviert', |
3232 | | - 'mwe-upwiz-campaign-conf-skiptutorial' => 'Das Tutorium zur Lizenzierung überspringen', |
| 3232 | + 'mwe-upwiz-campaign-conf-skipTutorial' => 'Das Tutorium zur Lizenzierung überspringen', |
3233 | 3233 | ); |
3234 | 3234 | |
3235 | 3235 | /** German (formal address) (Deutsch (Sie-Form)) |
— | — | @@ -5449,7 +5449,7 @@ |
5450 | 5450 | 'uploadcampaign-text' => 'אתם משנים מבצע פרסום של אשף ההעלאות.', |
5451 | 5451 | 'mwe-upwiz-campaign-name' => 'שם מבצע הפרסום', |
5452 | 5452 | 'mwe-upwiz-campaign-enabled' => 'מבצע הפרסום הופעל', |
5453 | | - 'mwe-upwiz-campaign-conf-skiptutorial' => 'לדלג על דף ההסברים על רישיונות', |
| 5453 | + 'mwe-upwiz-campaign-conf-skipTutorial' => 'לדלג על דף ההסברים על רישיונות', |
5454 | 5454 | ); |
5455 | 5455 | |
5456 | 5456 | /** Hindi (हिन्दी) |
— | — | @@ -6501,7 +6501,7 @@ |
6502 | 6502 | 'uploadcampaign-text' => 'Tu modifica ora un campania del Assistente de Incargamento.', |
6503 | 6503 | 'mwe-upwiz-campaign-name' => 'Nomine del campania', |
6504 | 6504 | 'mwe-upwiz-campaign-enabled' => 'Campania activate', |
6505 | | - 'mwe-upwiz-campaign-conf-skiptutorial' => 'Saltar le tutorial de licentiamento', |
| 6505 | + 'mwe-upwiz-campaign-conf-skipTutorial' => 'Saltar le tutorial de licentiamento', |
6506 | 6506 | ); |
6507 | 6507 | |
6508 | 6508 | /** Indonesian (Bahasa Indonesia) |
— | — | @@ -8391,7 +8391,7 @@ |
8392 | 8392 | 'uploadcampaign-text' => 'Менувате кампања на Помошникот за подигање.', |
8393 | 8393 | 'mwe-upwiz-campaign-name' => 'Име на кампањата', |
8394 | 8394 | 'mwe-upwiz-campaign-enabled' => 'Кампањата е овозможена', |
8395 | | - 'mwe-upwiz-campaign-conf-skiptutorial' => 'Прескокни го објаснувањето за лиценцирање', |
| 8395 | + 'mwe-upwiz-campaign-conf-skipTutorial' => 'Прескокни го објаснувањето за лиценцирање', |
8396 | 8396 | ); |
8397 | 8397 | |
8398 | 8398 | /** Malayalam (മലയാളം) |
— | — | @@ -8660,7 +8660,7 @@ |
8661 | 8661 | 'uploadcampaign-text' => 'താങ്കൾ അപ്ലോഡ് സഹായി മേള പുതുക്കിക്കൊണ്ടിരിക്കുകയാണ്.', |
8662 | 8662 | 'mwe-upwiz-campaign-name' => 'മേളയുടെ പേര്', |
8663 | 8663 | 'mwe-upwiz-campaign-enabled' => 'മേള സജ്ജമാക്കിയിരിക്കുന്നു', |
8664 | | - 'mwe-upwiz-campaign-conf-skiptutorial' => 'അനുമതി നൽകൽ പഠനസഹായി വേണ്ട', |
| 8664 | + 'mwe-upwiz-campaign-conf-skipTutorial' => 'അനുമതി നൽകൽ പഠനസഹായി വേണ്ട', |
8665 | 8665 | ); |
8666 | 8666 | |
8667 | 8667 | /** Mongolian (Монгол) |
— | — | @@ -8938,7 +8938,7 @@ |
8939 | 8939 | 'uploadcampaign-text' => 'Anda sedang mengubah suai kempen Alat Muat Naik Ajaib.', |
8940 | 8940 | 'mwe-upwiz-campaign-name' => 'Nama kempen', |
8941 | 8941 | 'mwe-upwiz-campaign-enabled' => 'Kempen dihidupkan', |
8942 | | - 'mwe-upwiz-campaign-conf-skiptutorial' => 'Langkau tutorial pelesenan', |
| 8942 | + 'mwe-upwiz-campaign-conf-skipTutorial' => 'Langkau tutorial pelesenan', |
8943 | 8943 | ); |
8944 | 8944 | |
8945 | 8945 | /** Burmese (မြန်မာဘာသာ) |
— | — | @@ -10385,7 +10385,7 @@ |
10386 | 10386 | 'uploadcampaign-text' => 'Está a modificar uma campanha do Assistente de Envio de Ficheiros.', |
10387 | 10387 | 'mwe-upwiz-campaign-name' => 'Nome da campanha', |
10388 | 10388 | 'mwe-upwiz-campaign-enabled' => 'Campanha activada', |
10389 | | - 'mwe-upwiz-campaign-conf-skiptutorial' => 'Saltar o guia prático de licenciamento', |
| 10389 | + 'mwe-upwiz-campaign-conf-skipTutorial' => 'Saltar o guia prático de licenciamento', |
10390 | 10390 | ); |
10391 | 10391 | |
10392 | 10392 | /** Brazilian Portuguese (Português do Brasil) |
— | — | @@ -11648,7 +11648,7 @@ |
11649 | 11649 | 'uploadcampaign-text' => 'Spreminjate kampanjo čarovnika nalaganja', |
11650 | 11650 | 'mwe-upwiz-campaign-name' => 'Ime kampanje', |
11651 | 11651 | 'mwe-upwiz-campaign-enabled' => 'Kampanja je omogočena', |
11652 | | - 'mwe-upwiz-campaign-conf-skiptutorial' => 'Preskoči vodnik po licenciranju', |
| 11652 | + 'mwe-upwiz-campaign-conf-skipTutorial' => 'Preskoči vodnik po licenciranju', |
11653 | 11653 | ); |
11654 | 11654 | |
11655 | 11655 | /** Somali (Soomaaliga) |
— | — | @@ -13134,7 +13134,7 @@ |
13135 | 13135 | 'uploadcampaign-text' => 'Bạn đang sửa đổi một thông báo chung cho Trình thuật sĩ tải lên.', |
13136 | 13136 | 'mwe-upwiz-campaign-name' => 'Tên thông báo chung', |
13137 | 13137 | 'mwe-upwiz-campaign-enabled' => 'Thông báo chung được kích hoạt', |
13138 | | - 'mwe-upwiz-campaign-conf-skiptutorial' => 'Bỏ qua hướng dẫn giấy phép', |
| 13138 | + 'mwe-upwiz-campaign-conf-skipTutorial' => 'Bỏ qua hướng dẫn giấy phép', |
13139 | 13139 | ); |
13140 | 13140 | |
13141 | 13141 | /** Wu (吴语) */ |