28 if ( $this->
getVar(
'_SkipOptional' ) ==
'skip' ) {
32 if ( $this->parent->request->wasPosted() ) {
38 $emailwrapperStyle = $this->
getVar(
'wgEnableEmail' ) ?
'' :
'display: none';
45 $this->parent->getRadioSet( [
46 'var' =>
'_RightsProfile',
47 'label' =>
'config-profile',
48 'itemLabelPrefix' =>
'config-profile-',
49 'values' => array_keys( $this->parent->rightsProfiles ),
51 $this->parent->getInfoBox(
wfMessage(
'config-profile-help' )->
plain() ) .
59 $this->parent->getRadioSet( [
60 'var' =>
'_LicenseCode',
61 'label' =>
'config-license',
62 'itemLabelPrefix' =>
'config-license-',
63 'values' => array_keys( $this->parent->licenses ),
64 'commonAttribs' => [
'class' =>
'licenseRadio' ],
66 $this->getCCChooser() .
67 $this->parent->getHelpBox(
'config-license-help' ) .
70 $this->getFieldsetStart(
'config-email-settings' ) .
71 $this->parent->getCheckBox( [
72 'var' =>
'wgEnableEmail',
73 'label' =>
'config-enable-email',
74 'attribs' => [
'class' =>
'showHideRadio',
'rel' =>
'emailwrapper' ],
76 $this->parent->getHelpBox(
'config-enable-email-help' ) .
77 "<div id=\"emailwrapper\" style=\"$emailwrapperStyle\">" .
78 $this->parent->getTextBox( [
79 'var' =>
'wgPasswordSender',
80 'label' =>
'config-email-sender'
82 $this->parent->getHelpBox(
'config-email-sender-help' ) .
83 $this->parent->getCheckBox( [
84 'var' =>
'wgEnableUserEmail',
85 'label' =>
'config-email-user',
87 $this->parent->getHelpBox(
'config-email-user-help' ) .
88 $this->parent->getCheckBox( [
89 'var' =>
'wgEnotifUserTalk',
90 'label' =>
'config-email-usertalk',
92 $this->parent->getHelpBox(
'config-email-usertalk-help' ) .
93 $this->parent->getCheckBox( [
94 'var' =>
'wgEnotifWatchlist',
95 'label' =>
'config-email-watchlist',
97 $this->parent->getHelpBox(
'config-email-watchlist-help' ) .
98 $this->parent->getCheckBox( [
99 'var' =>
'wgEmailAuthentication',
100 'label' =>
'config-email-auth',
102 $this->parent->getHelpBox(
'config-email-auth-help' ) .
104 $this->getFieldsetEnd()
107 $skins = $this->parent->findExtensions(
'skins' );
110 $skinNames = array_map(
'strtolower', array_keys( $skins ) );
111 $chosenSkinName = $this->
getVar(
'wgDefaultSkin', $this->parent->getDefaultSkin( $skinNames ) );
114 $radioButtons = $this->parent->getRadioElements( [
115 'var' =>
'wgDefaultSkin',
116 'itemLabels' => array_fill_keys( $skinNames,
'config-skins-use-as-default' ),
117 'values' => $skinNames,
118 'value' => $chosenSkinName,
121 foreach ( $skins as $skin => $info ) {
122 if ( isset( $info[
'screenshots'] ) ) {
125 $screenshotText = htmlspecialchars( $skin );
128 '<div class="config-skins-item">' .
129 $this->parent->getCheckBox( [
130 'var' =>
"skin-$skin",
131 'rawtext' => $screenshotText,
132 'value' => $this->
getVar(
"skin-$skin",
true ),
134 '<div class="config-skins-use-as-default">' . $radioButtons[strtolower( $skin )] .
'</div>' .
139 $this->parent->getWarningBox(
wfMessage(
'config-skins-missing' )->
plain() ) .
140 Html::hidden(
'config_wgDefaultSkin', $chosenSkinName );
143 $skinHtml .= $this->parent->getHelpBox(
'config-skins-help' ) .
147 $extensions = $this->parent->findExtensions();
152 foreach ( $extensions as
$ext => $info ) {
153 $extHtml .= $this->parent->getCheckBox( [
159 $extHtml .= $this->parent->getHelpBox(
'config-extensions-help' ) .
165 $this->
setVar(
'wgDeletedDirectory',
167 '/', DIRECTORY_SEPARATOR,
168 $this->
getVar(
'wgDeletedDirectory' )
172 $uploadwrapperStyle = $this->
getVar(
'wgEnableUploads' ) ?
'' :
'display: none';
176 $this->parent->getCheckBox( [
177 'var' =>
'wgEnableUploads',
178 'label' =>
'config-upload-enable',
179 'attribs' => [
'class' =>
'showHideRadio',
'rel' =>
'uploadwrapper' ],
180 'help' => $this->parent->getHelpBox(
'config-upload-help' )
182 '<div id="uploadwrapper" style="' . $uploadwrapperStyle .
'">' .
183 $this->parent->getTextBox( [
184 'var' =>
'wgDeletedDirectory',
185 'label' =>
'config-upload-deleted',
186 'attribs' => [
'dir' =>
'ltr' ],
187 'help' => $this->parent->getHelpBox(
'config-upload-deleted-help' )
190 $this->parent->getTextBox( [
192 'label' =>
'config-logo',
193 'attribs' => [
'dir' =>
'ltr' ],
194 'help' => $this->parent->getHelpBox(
'config-logo-help' )
198 $this->parent->getCheckBox( [
199 'var' =>
'wgUseInstantCommons',
200 'label' =>
'config-instantcommons',
201 'help' => $this->parent->getHelpBox(
'config-instantcommons-help' )
203 $this->getFieldsetEnd()
206 $caches = [
'none' ];
207 $cachevalDefault =
'none';
209 if ( count( $this->
getVar(
'_Caches' ) ) ) {
212 $cachevalDefault =
'accel';
214 $caches[] =
'memcached';
217 $cacheval = $this->
getVar(
'_MainCacheType' );
222 $cacheval = $cachevalDefault;
224 $hidden = ( $cacheval ==
'memcached' ) ?
'' :
'display: none';
232 $this->parent->getRadioSet( [
233 'var' =>
'_MainCacheType',
234 'label' =>
'config-cache-options',
235 'itemLabelPrefix' =>
'config-cache-',
237 'value' => $cacheval,
239 $this->parent->getHelpBox(
'config-cache-help' ) .
240 "<div id=\"config-memcachewrapper\" style=\"$hidden\">" .
241 $this->parent->getTextArea( [
242 'var' =>
'_MemCachedServers',
243 'label' =>
'config-memcached-servers',
244 'help' => $this->parent->getHelpBox(
'config-memcached-help' )
247 $this->getFieldsetEnd()
393 $this->parent->setVarsFromRequest( [
'_RightsProfile',
'_LicenseCode',
394 'wgEnableEmail',
'wgPasswordSender',
'wgEnableUploads',
'wgLogo',
395 'wgEnableUserEmail',
'wgEnotifUserTalk',
'wgEnotifWatchlist',
396 'wgEmailAuthentication',
'_MainCacheType',
'_MemCachedServers',
397 'wgUseInstantCommons',
'wgDefaultSkin' ] );
401 if ( !array_key_exists( $this->
getVar(
'_RightsProfile' ), $this->parent->rightsProfiles ) ) {
402 reset( $this->parent->rightsProfiles );
403 $this->
setVar(
'_RightsProfile',
key( $this->parent->rightsProfiles ) );
407 if (
$code ==
'cc-choose' ) {
408 if ( !$this->
getVar(
'_CCDone' ) ) {
409 $this->parent->showError(
'config-cc-not-chosen' );
412 } elseif ( array_key_exists(
$code, $this->parent->licenses ) ) {
417 $entry = $this->parent->licenses[
$code];
418 if ( isset( $entry[
'text'] ) ) {
419 $this->
setVar(
'wgRightsText', $entry[
'text'] );
423 $this->
setVar(
'wgRightsUrl', $entry[
'url'] );
424 $this->
setVar(
'wgRightsIcon', $entry[
'icon'] );
426 $this->
setVar(
'wgRightsText',
'' );
427 $this->
setVar(
'wgRightsUrl',
'' );
428 $this->
setVar(
'wgRightsIcon',
'' );
431 $skinsAvailable = array_keys( $this->parent->findExtensions(
'skins' ) );
432 $skinsToInstall = [];
433 foreach ( $skinsAvailable as $skin ) {
434 $this->parent->setVarsFromRequest( [
"skin-$skin" ] );
435 if ( $this->
getVar(
"skin-$skin" ) ) {
436 $skinsToInstall[] =
$skin;
439 $this->parent->setVar(
'_Skins', $skinsToInstall );
441 if ( !$skinsToInstall && $skinsAvailable ) {
442 $this->parent->showError(
'config-skins-must-enable-some' );
445 $defaultSkin = $this->
getVar(
'wgDefaultSkin' );
446 $skinsToInstallLowercase = array_map(
'strtolower', $skinsToInstall );
447 if ( $skinsToInstall && array_search( $defaultSkin, $skinsToInstallLowercase ) ===
false ) {
448 $this->parent->showError(
'config-skins-must-enable-default' );
452 $extsAvailable = array_keys( $this->parent->findExtensions() );
454 foreach ( $extsAvailable as
$ext ) {
455 $this->parent->setVarsFromRequest( [
"ext-$ext" ] );
456 if ( $this->
getVar(
"ext-$ext" ) ) {
457 $extsToInstall[] =
$ext;
460 $this->parent->setVar(
'_Extensions', $extsToInstall );
462 if ( $this->
getVar(
'_MainCacheType' ) ==
'memcached' ) {
463 $memcServers = explode(
"\n", $this->
getVar(
'_MemCachedServers' ) );
464 if ( !$memcServers ) {
465 $this->parent->showError(
'config-memcache-needservers' );
469 foreach ( $memcServers as $server ) {
470 $memcParts = explode(
":", $server, 2 );
471 if ( !isset( $memcParts[0] )
472 || ( !IP::isValid( $memcParts[0] )
473 && ( gethostbyname( $memcParts[0] ) == $memcParts[0] ) )
475 $this->parent->showError(
'config-memcache-badip', $memcParts[0] );
477 } elseif ( !isset( $memcParts[1] ) ) {
478 $this->parent->showError(
'config-memcache-noport', $memcParts[0] );
480 } elseif ( $memcParts[1] < 1 || $memcParts[1] > 65535 ) {
481 $this->parent->showError(
'config-memcache-badport', 1, 65535 );