X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FWebInstallerOptions.php;h=07378ab32e3cac965dabd26c91d56e5df9bece63;hb=5c28dd51ebfe07232b9d082812b64445dcc5f207;hp=7cc5db23bd186dc131471bd38866ab409af1f00b;hpb=734ca2b4d2a1246fb0ea1e54b861ab423ab5e257;p=lhc%2Fweb%2Fwiklou.git
diff --git a/includes/installer/WebInstallerOptions.php b/includes/installer/WebInstallerOptions.php
index 7cc5db23bd..07378ab32e 100644
--- a/includes/installer/WebInstallerOptions.php
+++ b/includes/installer/WebInstallerOptions.php
@@ -67,7 +67,7 @@ class WebInstallerOptions extends WebInstallerPage {
$this->parent->getHelpBox( 'config-license-help' ) .
# E-mail
- $this->getFieldSetStart( 'config-email-settings' ) .
+ $this->getFieldsetStart( 'config-email-settings' ) .
$this->parent->getCheckBox( [
'var' => 'wgEnableEmail',
'label' => 'config-enable-email',
@@ -101,13 +101,13 @@ class WebInstallerOptions extends WebInstallerPage {
] ) .
$this->parent->getHelpBox( 'config-email-auth-help' ) .
"" .
- $this->getFieldSetEnd()
+ $this->getFieldsetEnd()
);
$skins = $this->parent->findExtensions( 'skins' );
- $skinHtml = $this->getFieldSetStart( 'config-skins' );
+ $skinHtml = $this->getFieldsetStart( 'config-skins' );
- $skinNames = array_map( 'strtolower', $skins );
+ $skinNames = array_map( 'strtolower', array_keys( $skins ) );
$chosenSkinName = $this->getVar( 'wgDefaultSkin', $this->parent->getDefaultSkin( $skinNames ) );
if ( $skins ) {
@@ -118,12 +118,17 @@ class WebInstallerOptions extends WebInstallerPage {
'value' => $chosenSkinName,
] );
- foreach ( $skins as $skin ) {
+ foreach ( $skins as $skin => $info ) {
+ if ( isset( $info['screenshots'] ) ) {
+ $screenshotText = $this->makeScreenshotsLink( $skin, $info['screenshots'] );
+ } else {
+ $screenshotText = htmlspecialchars( $skin );
+ }
$skinHtml .=
'
' .
$this->parent->getCheckBox( [
'var' => "skin-$skin",
- 'rawtext' => $skin,
+ 'rawtext' => $screenshotText,
'value' => $this->getVar( "skin-$skin", true ), // all found skins enabled by default
] ) .
'
' . $radioButtons[strtolower( $skin )] . '
' .
@@ -136,15 +141,15 @@ class WebInstallerOptions extends WebInstallerPage {
}
$skinHtml .= $this->parent->getHelpBox( 'config-skins-help' ) .
- $this->getFieldSetEnd();
+ $this->getFieldsetEnd();
$this->addHTML( $skinHtml );
$extensions = $this->parent->findExtensions();
if ( $extensions ) {
- $extHtml = $this->getFieldSetStart( 'config-extensions' );
+ $extHtml = $this->getFieldsetStart( 'config-extensions' );
- foreach ( $extensions as $ext ) {
+ foreach ( $extensions as $ext => $info ) {
$extHtml .= $this->parent->getCheckBox( [
'var' => "ext-$ext",
'rawtext' => $ext,
@@ -152,7 +157,7 @@ class WebInstallerOptions extends WebInstallerPage {
}
$extHtml .= $this->parent->getHelpBox( 'config-extensions-help' ) .
- $this->getFieldSetEnd();
+ $this->getFieldsetEnd();
$this->addHTML( $extHtml );
}
@@ -167,7 +172,7 @@ class WebInstallerOptions extends WebInstallerPage {
$uploadwrapperStyle = $this->getVar( 'wgEnableUploads' ) ? '' : 'display: none';
$this->addHTML(
# Uploading
- $this->getFieldSetStart( 'config-upload-settings' ) .
+ $this->getFieldsetStart( 'config-upload-settings' ) .
$this->parent->getCheckBox( [
'var' => 'wgEnableUploads',
'label' => 'config-upload-enable',
@@ -195,7 +200,7 @@ class WebInstallerOptions extends WebInstallerPage {
'label' => 'config-instantcommons',
'help' => $this->parent->getHelpBox( 'config-instantcommons-help' )
] ) .
- $this->getFieldSetEnd()
+ $this->getFieldsetEnd()
);
$caches = [ 'none' ];
@@ -219,7 +224,7 @@ class WebInstallerOptions extends WebInstallerPage {
$hidden = ( $cacheval == 'memcached' ) ? '' : 'display: none';
$this->addHTML(
# Advanced settings
- $this->getFieldSetStart( 'config-advanced-settings' ) .
+ $this->getFieldsetStart( 'config-advanced-settings' ) .
# Object cache settings
// getRadioSet() builds a set of labeled radio buttons.
// For grep: The following messages are used as the item labels:
@@ -239,13 +244,38 @@ class WebInstallerOptions extends WebInstallerPage {
'help' => $this->parent->getHelpBox( 'config-memcached-help' )
] ) .
'
' .
- $this->getFieldSetEnd()
+ $this->getFieldsetEnd()
);
$this->endForm();
return null;
}
+ private function makeScreenshotsLink( $name, $screenshots ) {
+ global $wgLang;
+ if ( count( $screenshots ) > 1 ) {
+ $links = [];
+ $counter = 1;
+ foreach ( $screenshots as $shot ) {
+ $links[] = Html::element(
+ 'a',
+ [ 'href' => $shot ],
+ $wgLang->formatNum( $counter++ )
+ );
+ }
+ return wfMessage( 'config-skins-screenshots' )
+ ->rawParams( $name, $wgLang->commaList( $links ) )
+ ->escaped();
+ } else {
+ $link = Html::element(
+ 'a',
+ [ 'href' => $screenshots[0] ],
+ wfMessage( 'config-screenshot' )->text()
+ );
+ return wfMessage( 'config-skins-screenshot', $name )->rawParams( $link )->escaped();
+ }
+ }
+
/**
* @return string
*/
@@ -345,7 +375,7 @@ class WebInstallerOptions extends WebInstallerPage {
* @return bool
*/
public function submitSkins() {
- $skins = $this->parent->findExtensions( 'skins' );
+ $skins = array_keys( $this->parent->findExtensions( 'skins' ) );
$this->parent->setVar( '_Skins', $skins );
if ( $skins ) {
@@ -398,7 +428,7 @@ class WebInstallerOptions extends WebInstallerPage {
$this->setVar( 'wgRightsIcon', '' );
}
- $skinsAvailable = $this->parent->findExtensions( 'skins' );
+ $skinsAvailable = array_keys( $this->parent->findExtensions( 'skins' ) );
$skinsToInstall = [];
foreach ( $skinsAvailable as $skin ) {
$this->parent->setVarsFromRequest( [ "skin-$skin" ] );
@@ -419,7 +449,7 @@ class WebInstallerOptions extends WebInstallerPage {
$retVal = false;
}
- $extsAvailable = $this->parent->findExtensions();
+ $extsAvailable = array_keys( $this->parent->findExtensions() );
$extsToInstall = [];
foreach ( $extsAvailable as $ext ) {
$this->parent->setVarsFromRequest( [ "ext-$ext" ] );