r22031 - htdocs/trunk - Bug #662820: make more visible the links to online documentation and make them language-based.

Cristian Marchi cmarchi at code.gnucash.org
Wed Feb 15 15:13:54 EST 2012


Author: cmarchi
Date: 2012-02-15 15:13:54 -0500 (Wed, 15 Feb 2012)
New Revision: 22031
Trac: http://svn.gnucash.org/trac/changeset/22031

Modified:
   htdocs/trunk/docs.phtml
Log:
Bug #662820: make more visible the links to online documentation and make them language-based.

Modified: htdocs/trunk/docs.phtml
===================================================================
--- htdocs/trunk/docs.phtml	2012-02-15 20:06:14 UTC (rev 22030)
+++ htdocs/trunk/docs.phtml	2012-02-15 20:13:54 UTC (rev 22031)
@@ -8,17 +8,60 @@
 include("emulate_globals_on.php");
 include("externals/header.phtml");
 include("externals/menu.phtml");
+
+/*the following code selects the link to browse online docs based on the language selected in the GnuCash website*/
+$basepath = "http://gnucash.org/docs/v2.4/";
+$helpfile = "gnucash-help/help.html";
+$tcfile   = "gnucash-guide/index.html";
+$helplangpath = 'C';
+$guidelangpath = 'C';
+$l_argarray = parse_url($_SERVER['REQUEST_URI']); /*read the array for the path*/
+$l_arg = $l_argarray[query]; /*select the lang part (query) from the above array: for example "lang=it_IT"*/
+if (is_null($l_arg)) { $l_arg = "lang=".$_COOKIE['lang_cookie']; } /*if lang query is not in the url read it from cookie as f.e. "lang=it_IT"*/
+/* the next switch assigns the language path to the help documents*/
+if ($l_arg) { /* There is a language argument */
+  switch ($l_arg) {
+    case "lang=de_DE":
+        $helplangpath = "de_DE";
+        break;
+    case "lang=it_IT":
+        $helplangpath = "it_IT";
+        break;
+  }
+}
+/* the next switch assigns the language path to the guide documents*/
+if ($l_arg) { /* There is a language argument */
+  switch ($l_arg) {
+    case "lang=de_DE":
+        $guidelangpath = "de_DE";
+        break;
+    case "lang=it_IT":
+        $guidelangpath = "it_IT";
+        break;
+    case "lang=ja_JP":
+        $guidelangpath = "ja_JP";
+        break;
+  }
+}
+/*finally build the language based urls to docs*/
+$hfileurl = $basepath . $helplangpath . "/" . $helpfile;
+$tfileurl = $basepath . $guidelangpath . "/" . $tcfile;
+/*end of the language based docs link creator code*/
 ?>
 
 <div id="content">
 
 <h1><?php echo T_("GnuCash Documentation");?></h1>
 
-<p class="justify"><?php echo T_("There are two major <span class=\"gnucash\">GnuCash</span> documentation packages to help users: the <b>Help Manual</b> and the <b>Tutorials and Concepts Guide</b>.");?></p>
+<p class="justify"><?php echo T_("There are two major <span class=\"gnucash\">GnuCash</span> documentation packages to help users:");?></p>
+<ul>
+<li><a href="<?php echo $hfileurl?>"><b><?php echo T_("The Help Manual");?></b></a></li>
+<li><a href="<?php echo $tfileurl?>"><b><?php echo T_("The Tutorials and Concepts Guide");?></b></a></li>
+</ul>
 
 <p class="justify"><?php echo T_("The <b>Help Manual</b> is designed to be a quick reference of how to accomplish specific tasks and how to use the features in <span class=\"gnucash\">GnuCash</span>. The <b>Concepts Guide</b> is designed to be an in depth guide to the concepts behind using <span class=\"gnucash\">GnuCash</span> with a tutorial to show how to put those concepts into practice.");?></p>
 
-<p class="justify"><?php echo T_("Additionally, you can talk to someone via IRC at <i>irc.gnome.org</i> channel <b>#gnucash</b> about your question. Another resource is the <a href=\"http://wiki.gnucash.org/wiki/\">English</a> or <a href=\"http://linuxwiki.de/GnuCash\">Deutsch</a> <span class=\"gnucash\">GnuCash</span> wikis.");?></p>
+<p class="justify"><?php echo T_("Additionally, you can talk to someone via IRC at irc.gnome.org channel <b>#gnucash</b> about your question. Another resource is the <a href=\"http://wiki.gnucash.org/wiki/\">English</a> or <a href=\"http://linuxwiki.de/GnuCash\">Deutsch</a> <span class=\"gnucash\">GnuCash</span> wikis.");?></p>
 
 <p class="justify"><?php echo T_("You can also send an email to the <a href=\"mailto:gnucash-user at lists.gnucash.org\">gnucash-user</a> mailing list if you cannot find a satisfactory answer to your question within either the <b>Help Manual</b> or the <b>Tutorial and Concepts Guide</b>. We <b>want</b> feedback from you, it is also through your comments that we know how to improve the documentation.");?></p>
 



More information about the gnucash-changes mailing list