* @license https://files.froxlor.org/misc/COPYING.txt GPLv2 */ use Froxlor\Froxlor; use Froxlor\FileDir; /** * 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 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_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::isFroxlor()) { return true; } return Froxlor::versionCompare2($current_version, $version_to_check) == -1; }