(2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package Language * */ /** * Function getPreConfig * * outputs various form-field-arrays before the update process * can be continued (asks for agreement whatever is being asked) * * @param string $current_version * @param int $current_db_version * * @return array */ function getPreConfig($current_version, $current_db_version): array { $has_preconfig = false; include_once \Froxlor\FileDir::makeCorrectFile(dirname(__FILE__) . '/preconfig/0.9/preconfig_0.9.inc.php'); $return['section_09'] = [ 'title' => '0.9.x updates', 'fields' => [] ]; parseAndOutputPreconfig09($has_preconfig, $return['section_09']['fields'], $current_version, $current_db_version); include_once \Froxlor\FileDir::makeCorrectFile(dirname(__FILE__) . '/preconfig/0.10/preconfig_0.10.inc.php'); $return['section_010'] = [ 'title' => '0.10.x updates', 'fields' => [] ]; parseAndOutputPreconfig010($has_preconfig, $return['section_010']['fields'], $current_version, $current_db_version); include_once \Froxlor\FileDir::makeCorrectFile(dirname(__FILE__) . '/preconfig/0.11/preconfig_0.11.inc.php'); $return['section_011'] = [ 'title' => '0.11.x updates', 'fields' => [] ]; parseAndOutputPreconfig011($has_preconfig, $return['section_011']['fields'], $current_version, $current_db_version); if (empty($return['section_09']['fields'])) { unset($return['section_09']); } if (empty($return['section_010']['fields'])) { unset($return['section_010']); } if (empty($return['section_011']['fields'])) { unset($return['section_011']); } if (!empty($return)) { $has_preconfig = true; $return['section_agree'] = [ 'title' => 'Check', 'fields' => [ 'update_changesagreed' => ['type' => 'checkbox', 'value' => 1, 'label' => 'I have read the update notifications above and I am aware of the changes made to my system.'], 'update_preconfig' => ['type' => 'hidden', 'value' => 1] ] ]; } if ($has_preconfig) { return $return; } else { return []; } } function versionInUpdate($current_version, $version_to_check) { if (!\Froxlor\Froxlor::isFroxlor()) { return true; } return (\Froxlor\Froxlor::versionCompare2($current_version, $version_to_check) == -1 ? true : false); }