if ( isset( $option['pass'] ) ) {
$this->setVar( '_AdminPassword', $option['pass'] );
}
+
+ // Set up the default skins
+ $skins = $this->findExtensions( 'skins' );
+ $this->setVar( '_Skins', $skins );
+
+ if ( $skins ) {
+ $skinNames = array_map( 'strtolower', $skins );
+ $this->setVar( 'wgDefaultSkin', $this->getDefaultSkin( $skinNames ) );
+ }
}
/**
return $exts;
}
+ /**
+ * Returns a default value to be used for $wgDefaultSkin: the preferred skin, if available among
+ * the installed skins, or any other one otherwise.
+ *
+ * @param string[] $skinNames Names of installed skins.
+ * @return string
+ */
+ public function getDefaultSkin( array $skinNames ) {
+ $defaultSkin = $GLOBALS['wgDefaultSkin'];
+ if ( in_array( $defaultSkin, $skinNames ) ) {
+ return $defaultSkin;
+ } else {
+ return $skinNames[0];
+ }
+ }
+
/**
* Installs the auto-detected extensions.
*
'var' => 'wgDefaultSkin',
'itemLabels' => array_fill_keys( $skinNames, 'config-skins-use-as-default' ),
'values' => $skinNames,
- 'value' => $this->getVar( 'wgDefaultSkin', $this->getDefaultSkin( $skinNames ) ),
+ 'value' => $this->getVar( 'wgDefaultSkin', $this->parent->getDefaultSkin( $skinNames ) ),
) );
foreach ( $skins as $skin ) {
$this->addHTML( $this->getCCDoneBox() );
}
- /**
- * Returns a default value to be used for $wgDefaultSkin: the preferred skin, if available among
- * the installed skins, or any other one otherwise.
- *
- * @param string[] $skinNames Names of installed skins.
- * @return string
- */
- public function getDefaultSkin( array $skinNames ) {
- $defaultSkin = $GLOBALS['wgDefaultSkin'];
- if ( in_array( $defaultSkin, $skinNames ) ) {
- return $defaultSkin;
- } else {
- return $skinNames[0];
- }
- }
-
/**
* If the user skips this installer page, we still need to set up the default skins, but ignore
* everything else.
if ( $skins ) {
$skinNames = array_map( 'strtolower', $skins );
- $this->parent->setVar( 'wgDefaultSkin', $this->getDefaultSkin( $skinNames ) );
+ $this->parent->setVar( 'wgDefaultSkin', $this->parent->getDefaultSkin( $skinNames ) );
}
return true;