gnucash-htdocs master: Fix html documentation links.
John Ralls
jralls at code.gnucash.org
Sun Sep 25 16:38:18 EDT 2022
Updated via https://github.com/Gnucash/gnucash-htdocs/commit/a5d8e71c (commit)
from https://github.com/Gnucash/gnucash-htdocs/commit/1757c87b (commit)
commit a5d8e71c3d24442bfec8ea6e5140faba3e0d893f
Author: John Ralls <jralls at ceridwen.us>
Date: Sun Sep 25 13:14:21 2022 -0700
Fix html documentation links.
diff --git a/viewdoc.phtml b/viewdoc.phtml
index c37bca0..1e9636d 100644
--- a/viewdoc.phtml
+++ b/viewdoc.phtml
@@ -12,8 +12,10 @@ include("externals/header.phtml");
include("externals/menu.phtml");
# Some base parameters used later on
+# The helpdoc path applies to the 4.900/5.0 branch and is adjusted for
+# earlier versions below.
$basepath = \DEFAULT_URL."docs";
-$helpdoc = "gnucash-help/help.html";
+$helpdoc = "gnucash-manual/index.html";
$tcdoc = "gnucash-guide/index.html";
$current_stable = $major_stable;
@@ -87,6 +89,42 @@ if ($rev_to_show) {
$req_rev_ok = false;
break;
}
+
+ # Adjust name of gnucash-manual start page for older versions
+ switch ($rev_to_show) {
+ case "1.8":
+ case "2.0":
+ case "2.2":
+ case "2.4":
+ case "2.6":
+ case "3":
+ $helpdoc = "gnucash-help/help.html";
+ break;
+ case "4":
+ # Once gnucash 5 is out, the three cases below should be removed from the switch statement
+ case "current":
+ case "maint":
+ case "nightly":
+ $helpdoc = "gnucash-help/index.html";
+ break;
+ }
+}
+
+
+# Parse requested document
+$doc_to_show = filter_input(INPUT_GET, 'doc', FILTER_SANITIZE_STRING);
+if ($doc_to_show) {
+ switch ($doc_to_show) {
+ case "help":
+ $showdoc = $helpdoc;
+ break;
+ case "guide":
+ $showdoc = $tcdoc;
+ break;
+ default: /* unknown document requested, will present guide by default */
+ $req_doc_ok = false;
+ break;
+ }
}
# Now check if the requested combination of doc, revision and language actually exists
# If not, try the default C locale instead.
Summary of changes:
viewdoc.phtml | 40 +++++++++++++++++++++++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)
More information about the gnucash-changes
mailing list