From ade9edeb849803082856f7633194913ad4df93a0 Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Sun, 26 Apr 2020 21:03:08 +0200 Subject: Automatic code formatting --- ratatoeskr/setup/create_tables.php | 10 ++++---- ratatoeskr/setup/setup.php | 52 ++++++++++++++++---------------------- 2 files changed, 27 insertions(+), 35 deletions(-) (limited to 'ratatoeskr/setup') diff --git a/ratatoeskr/setup/create_tables.php b/ratatoeskr/setup/create_tables.php index 9b330fe..4898e84 100644 --- a/ratatoeskr/setup/create_tables.php +++ b/ratatoeskr/setup/create_tables.php @@ -1,7 +1,8 @@ vars["rel_path_to_root"] = $rel_path_to_root; -$ste->vars["translations"] = array(); -foreach($languages as $langcode => $langinfo) -{ - if($langinfo["translation_exist"]) +$ste->vars["translations"] = []; +foreach ($languages as $langcode => $langinfo) { + if ($langinfo["translation_exist"]) { $ste->vars["translations"][$langcode] = $langinfo["language"]; + } } -if(isset($_GET["lang"]) and (@$languages[$_GET["lang"]]["translation_exist"])) -{ +if (isset($_GET["lang"]) and (@$languages[$_GET["lang"]]["translation_exist"])) { load_language($_GET["lang"]); $lang = $_GET["lang"]; $ste->vars["lang"] = $_GET["lang"]; -} -else +} else { die($ste->exectemplate("/systemtemplates/setup_select_lang.html")); +} -if(isset($_POST["apply_setup"])) -{ - if(empty($_POST["admin_username"]) or empty($_POST["admin_init_password"])) +if (isset($_POST["apply_setup"])) { + if (empty($_POST["admin_username"]) or empty($_POST["admin_init_password"])) { $ste->vars["error"] = $translation["admin_data_must_be_filled_out"]; - else - { + } else { $config["mysql"]["server"] = $_POST["mysql_host"]; $config["mysql"]["db"] = $_POST["mysql_database"]; $config["mysql"]["user"] = $_POST["mysql_user"]; $config["mysql"]["passwd"] = $_POST["mysql_password"]; $config["mysql"]["prefix"] = $_POST["table_prefix"]; - try - { + try { db_connect(); create_mysql_tables(); @@ -49,12 +45,12 @@ if(isset($_POST["apply_setup"])) require_once(dirname(__FILE__) . "/../sys/models.php"); $ratatoeskr_settings["default_language"] = $lang; - $ratatoeskr_settings["comment_visible_defaut"] = True; - $ratatoeskr_settings["allow_comments_default"] = True; + $ratatoeskr_settings["comment_visible_defaut"] = true; + $ratatoeskr_settings["allow_comments_default"] = true; $ratatoeskr_settings["comment_textprocessor"] = "Markdown"; - $ratatoeskr_settings["languages"] = $lang == "en" ? array("en") : array($lang, "en"); + $ratatoeskr_settings["languages"] = $lang == "en" ? ["en"] : [$lang, "en"]; $ratatoeskr_settings["last_db_cleanup"] = time(); - $ratatoeskr_settings["debugmode"] = False; + $ratatoeskr_settings["debugmode"] = false; $style = Style::create("default"); $style->code = <<