From 76343fb91511b9f53e58b6c01b258bfe00ddb4c6 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 24 Oct 2014 08:31:47 +0200 Subject: Use an INI-style configuration file Replace web/lib/config.inc.php with an INI-style configuration file. This allows us to get rid of several globals and makes it easier to use the same configuration file in external scripts. Signed-off-by: Lukas Fleischer --- web/template/actions_form.php | 2 +- web/template/header.php | 2 +- web/template/pkg_details.php | 13 +++++++------ web/template/pkgbase_details.php | 13 +++++++------ web/template/pkgreq_results.php | 5 +++-- web/template/tu_last_votes_list.php | 2 +- 6 files changed, 20 insertions(+), 17 deletions(-) (limited to 'web/template') diff --git a/web/template/actions_form.php b/web/template/actions_form.php index 389297b..f18c01c 100644 --- a/web/template/actions_form.php +++ b/web/template/actions_form.php @@ -1,4 +1,4 @@ - +
diff --git a/web/template/header.php b/web/template/header.php index d10b162..dd1d480 100644 --- a/web/template/header.php +++ b/web/template/header.php @@ -69,7 +69,7 @@
  • - +
  • diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index d09b3d8..faec0dc 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -21,7 +21,8 @@ $updated_time = ($row["ModifiedTS"] == 0) ? $msg : gmdate("Y-m-d H:i", intval($r $submitted_time = ($row["SubmittedTS"] == 0) ? $msg : gmdate("Y-m-d H:i", intval($row["SubmittedTS"])); $out_of_date_time = ($row["OutOfDateTS"] == 0) ? $msg : gmdate("Y-m-d", intval($row["OutOfDateTS"])); -$urlpath = URL_DIR . substr($row['BaseName'], 0, 2) . "/" . $row['BaseName']; +$package_url = config_get('options', 'package_url'); +$urlpath = $package_url . substr($row['BaseName'], 0, 2) . "/" . $row['BaseName']; $lics = pkg_licenses($row["ID"]); $grps = pkg_groups($row["ID"]); @@ -82,7 +83,7 @@ $sources = pkg_sources($row["ID"]);
  • - +
  • @@ -281,7 +282,7 @@ if (has_credential(CRED_PKGBASE_CHANGE_CATEGORY, array($row["MaintainerUID"]))): @@ -299,7 +300,7 @@ if ($row["SubmitterUID"]): @@ -317,7 +318,7 @@ if ($row["MaintainerUID"]): @@ -333,7 +334,7 @@ if ($row["PackagerUID"]): - + diff --git a/web/template/pkgbase_details.php b/web/template/pkgbase_details.php index fb11e60..406408b 100644 --- a/web/template/pkgbase_details.php +++ b/web/template/pkgbase_details.php @@ -19,7 +19,8 @@ $updated_time = ($row["ModifiedTS"] == 0) ? $msg : gmdate("Y-m-d H:i", intval($r $submitted_time = ($row["SubmittedTS"] == 0) ? $msg : gmdate("Y-m-d H:i", intval($row["SubmittedTS"])); $out_of_date_time = ($row["OutOfDateTS"] == 0) ? $msg : gmdate("Y-m-d", intval($row["OutOfDateTS"])); -$urlpath = URL_DIR . substr($row['Name'], 0, 2) . "/" . $row['Name']; +$package_url = config_get('options', 'package_url'); +$urlpath = $package_url . substr($row['Name'], 0, 2) . "/" . $row['Name']; $pkgs = pkgbase_get_pkgnames($base_id); ?> @@ -33,7 +34,7 @@ $pkgs = pkgbase_get_pkgnames($base_id);
  • - +
  • @@ -140,7 +141,7 @@ if (has_credential(CRED_PKGBASE_CHANGE_CATEGORY, array($row["MaintainerUID"]))): @@ -158,7 +159,7 @@ if ($row["SubmitterUID"]): @@ -176,7 +177,7 @@ if ($row["MaintainerUID"]): @@ -192,7 +193,7 @@ if ($row["PackagerUID"]): - + diff --git a/web/template/pkgreq_results.php b/web/template/pkgreq_results.php index 3d50c82..24ee877 100644 --- a/web/template/pkgreq_results.php +++ b/web/template/pkgreq_results.php @@ -34,9 +34,10 @@ $REQUEST_IDLE_TIME); + $idle_time = config_get_int('options', 'request_idle_time'); + $due = ($row['Open'] && time() - intval($row['RequestTS']) > $idle_time); if (!$due) { - $time_left = $REQUEST_IDLE_TIME - (time() - intval($row['RequestTS'])); + $time_left = $idle_time - (time() - intval($row['RequestTS'])); if ($time_left > 48 * 3600) { $time_left_fmt = __("~%d days left", round($time_left / (24 * 3600))); } elseif ($time_left > 3600) { diff --git a/web/template/tu_last_votes_list.php b/web/template/tu_last_votes_list.php index e897a6a..0b0ee48 100644 --- a/web/template/tu_last_votes_list.php +++ b/web/template/tu_last_votes_list.php @@ -21,7 +21,7 @@ ?> - + -- cgit v1.2.3-70-g09d2