Skip to content
This repository was archived by the owner on Sep 23, 2023. It is now read-only.

Commit a3fa2e8

Browse files
edg2sMatmaRex
authored andcommitted
Make instantCommons a checkbox
1 parent 477dc83 commit a3fa2e8

File tree

5 files changed

+22
-3
lines changed

5 files changed

+22
-3
lines changed

LocalSettings-instantCommons.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// InstantCommons
2+
$wgUseInstantCommons = true;

LocalSettings.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ $wgEchoPerUserBlacklist = true;
6464
// GlobalWatchlist
6565
$wgGlobalWatchlistDevMode = true;
6666

67-
// InstantCommons
68-
$wgUseInstantCommons = true;
69-
7067
// UploadWizard, Special:Upload
7168
$wgEnableUploads = true;
7269

index.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,19 @@
151151
'classes' => [ 'form-repos-field' ],
152152
]
153153
),
154+
new OOUI\FieldLayout(
155+
new OOUI\CheckboxInputWidget( [
156+
'name' => 'instantCommons',
157+
'value' => 1,
158+
'selected' => true
159+
] ),
160+
[
161+
'label' => 'Load images from Commons',
162+
'help' => 'Any images not local to the wiki will be pulled from Wikimedia Commons.',
163+
'helpInline' => true,
164+
'align' => 'left',
165+
]
166+
),
154167
new OOUI\FieldLayout(
155168
new OOUI\CheckboxInputWidget( [
156169
'name' => 'proxy',

new.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ function set_progress( float $pc, string $label ) {
276276
$repos = get_repo_data();
277277

278278
$useProxy = !empty( $_POST['proxy'] );
279+
$useInstantCommons = !empty( $_POST['instantCommons' ] );
279280

280281
if ( $_POST['preset'] === 'custom' ) {
281282
$allowedRepos = $_POST['repos'];
@@ -374,6 +375,7 @@ function set_progress( float $pc, string $label ) {
374375
$cmd = make_shell_command( $baseEnv + [
375376
'MAINPAGE' => $mainPage,
376377
'USE_PROXY' => $useProxy,
378+
'USE_INSTANT_COMMONS' => $useInstantCommons,
377379
], __DIR__ . '/new/postinstall.sh' );
378380

379381
$error = shell_echo( $cmd );

new/postinstall.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ if [ "${USE_PROXY}" = "1" ]; then
5454
done
5555
fi
5656

57+
# Enable instantCommons if selected
58+
if [ "${USE_INSTANT_COMMONS}" = "1" ]; then
59+
cat $PATCHDEMO/LocalSettings-instantCommons.txt >> $PATCHDEMO/wikis/$NAME/w/LocalSettings.php
60+
fi
61+
5762
# populate interwiki table from en.wiki
5863
php $PATCHDEMO/wikis/$NAME/w/maintenance/populateInterwiki.php
5964

0 commit comments

Comments
 (0)