]> git.wh0rd.org - tt-rss.git/commitdiff
display help_text in prefs editor
authorAndrew Dolgov <fox@madoka.spb.ru>
Thu, 17 Nov 2005 07:10:31 +0000 (08:10 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Thu, 17 Nov 2005 07:10:31 +0000 (08:10 +0100)
backend.php
prefs.js
prefs.php
tt-rss.css

index ed497f4711b94c141e479244f1883111b5fc266d..e413fbafb989741586f5715cd134b1695f8a58ca 100644 (file)
 
        if ($op == "pref-prefs") {
 
-               $subop = $_POST["subop"];
+               $subop = $_REQUEST["subop"];
 
                if ($subop == "Save configuration") {
 
 
                        }
 
+               } else if ($subop == "getHelp") {
+
+                       $pref_name = db_escape_string($_GET["pn"]);
+
+                       $result = db_query($link, "SELECT help_text FROM ttrss_prefs
+                               WHERE pref_name = '$pref_name'");
+
+                       if (db_num_rows($result) > 0) {
+                               $help_text = db_fetch_result($result, 0, "help_text");
+                               print $help_text;
+                       } else {
+                               print "Unknown option: $pref_name";
+                       }
+
                } else if ($subop == "Reset to defaults") {
 
                        db_query($link, "UPDATE ttrss_prefs SET value = def_value");
 
                                print "<tr class=\"$class\">";
 
-                               print "<td width=\"40%\">" . $line["short_desc"] . "</td>";
-
                                $type_name = $line["type_name"];
                                $pref_name = $line["pref_name"];
                                $value = $line["value"];
                                $def_value = $line["def_value"];
+                               $help_text = $line["help_text"];
+
+                               print "<td width=\"40%\" id=\"$pref_name\">" . $line["short_desc"];
+
+                               if ($help_text) print "<div class=\"prefHelp\">$help_text</div>";
+                               
+                               print "</td>";
 
                                print "<td>";
 
index a7764758e53e624d34d48e79e65ffa286ba7404a..3e8b6b18102b0fc15f3b72e3dc14531788f4414f 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -105,6 +105,15 @@ function prefslist_callback() {
        }
 }
 
+function gethelp_callback() {
+       var container = document.getElementById('prefHelpBox');
+       if (xmlhttp.readyState == 4) {
+
+               container.innerHTML = xmlhttp.responseText;
+               container.style.display = "block";
+
+       }
+}
 
 
 function notify_callback() {
@@ -785,3 +794,27 @@ function init() {
        notify("");
 
 }
+
+/*
+var help_topic_id = false;
+
+function do_dispOptionHelp() {
+
+       if (!xmlhttp_ready(xmlhttp))
+               return;
+
+       xmlhttp.open("GET", "backend.php?op=pref-prefs&subop=getHelp&pn=" +
+               param_escape(help_topic_id), true);
+       xmlhttp.onreadystatechange=gethelp_callback;
+       xmlhttp.send(null);
+
+}
+
+function dispOptionHelp(event, sender) {
+
+       help_topic_id = sender.id;
+
+//     document.setTimeout("do_dispOptionHelp()", 100);
+
+} */
+
index 6b1cefe60a1be95561597a4dcc0ea511a51ac6b3..a2e7ac31c2a88f61cdde0fe23a76f1f2ee94a66e 100644 (file)
--- a/prefs.php
+++ b/prefs.php
@@ -4,6 +4,7 @@
        <link rel="stylesheet" href="tt-rss.css" type="text/css">
        <script type="text/javascript" src="functions.js"></script>
        <script type="text/javascript" src="prefs.js"></script>
+
        <!--[if gte IE 5.5000]>
                <script type="text/javascript" src="pngfix.js"></script>
        <![endif]-->
@@ -23,7 +24,7 @@
 <table width="100%" height="100%" cellspacing="0" cellpadding="0" class="main">
 <? if (get_pref($link, 'DISPLAY_HEADER')) { ?>
 <tr>
-       <td colspan="2">
+       <td>
                <table cellspacing="0" cellpadding="0" width="100%"><tr>
                        <td class="header" valign="middle">     
                                <img src="images/ttrss_logo.png" alt="logo">    
index 5c3251abbfe4f667507d0aa50e4246292e8b05d7..69745405c5b9e9e791dca3b6b384a9eeac32d50c 100644 (file)
@@ -526,3 +526,11 @@ div.bigErrorMsg {
 td.innerSplash {
        margin : 35px;
 }
+
+div.prefHelp, td.prefHelp {
+       font-size : x-small;
+       color : gray;
+       padding : 5px;
+}
+
+