(2010-)
* @license GPLv2 https://files.froxlor.org/misc/COPYING.txt
* @package Updater
*
*/
use Froxlor\Froxlor;
use Froxlor\FileDir;
use Froxlor\Config\ConfigParser;
/**
* checks if the new-version has some updating to do
*
* @param boolean $has_preconfig
* pointer to check if any preconfig has to be output
* @param string $return
* pointer to output string
* @param string $current_version
* current froxlor version
*
* @return void
*/
function parseAndOutputPreconfig011(&$has_preconfig, &$return, $current_version, $current_db_version)
{
if (versionInUpdate($current_version, '0.10.99')) {
$has_preconfig = true;
$description = 'We have rearranged the settings and split them into basic and advanced categories. This makes it easier for users who do not need all the detailed or very specific settings and options and gives a better overview of the basic/mostly used settings.';
$return['panel_settings_mode_note'] = ['type' => 'infotext', 'value' => $description];
$question = 'Chose settings mode (you can change that at any time)';
$return['panel_settings_mode'] = [
'type' => 'select',
'select_var' => [
0 => 'Basic',
1 => 'Advanced'
],
'selected' => 1,
'label' => $question
];
$description = 'The configuration page now can preselect a distribution, please select your current distribution';
$return['system_distribution_note'] = ['type' => 'infotext', 'value' => $description];
$question = 'Select distribution';
$config_dir = FileDir::makeCorrectDir(Froxlor::getInstallDir() . '/lib/configfiles/');
// show list of available distro's
$distros = glob($config_dir . '*.xml');
$distributions_select[''] = '-';
// read in all the distros
foreach ($distros as $_distribution) {
// get configparser object
$dist = new ConfigParser($_distribution);
// store in tmp array
$distributions_select[str_replace(".xml", "", strtolower(basename($_distribution)))] = $dist->getCompleteDistroName();
}
// sort by distribution name
asort($distributions_select);
$return['system_distribution'] = [
'type' => 'select',
'select_var' => $distributions_select,
'selected' => '',
'label' => $question
];
}
}