]> git.wh0rd.org - tt-rss.git/commitdiff
more i18n work, add some report notices
authorAndrew Dolgov <fox@bah.spb.su>
Mon, 5 Mar 2007 13:45:34 +0000 (14:45 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Mon, 5 Mar 2007 13:45:34 +0000 (14:45 +0100)
functions.js
modules/popup-dialog.php
modules/pref-feeds.php
modules/pref-filters.php
modules/pref-labels.php

index 72011568e4bf1991a8e55457960728322e09db3e..7442daa67e5e66748305fa5e1369179c484495f9 100644 (file)
@@ -1343,7 +1343,9 @@ function infobox_submit_callback() {
                        }
                } catch (e) { }
 
-//             notify_info(xmlhttp.responseText);
+               if (xmlhttp.responseText) {
+                       notify_info(xmlhttp.responseText);
+               }
 
        } 
 }
@@ -1364,7 +1366,7 @@ function infobox_callback() {
        }
 }
 
-function qaddFilter() {
+function addFilter() {
 
        if (!xmlhttp_ready(xmlhttp)) {
                printLockingError();
@@ -1400,7 +1402,7 @@ function isValidURL(s) {
        return s.match("http://") != null || s.match("https://") != null || s.match("feed://") != null;
 }
 
-function qafAdd() {
+function qaddFeed() {
 
        if (!xmlhttp_ready(xmlhttp)) {
                printLockingError();
index 6ac80be749507ecb7d1c5d7b172281ea359040da..8fe1ac4b3810bc4c16577710fdc8e78e646ace5b 100644 (file)
@@ -36,6 +36,7 @@
 
                        print "</div>";
 
+                       return;
                }
 
                if ($id == "quickAddFeed") {
@@ -52,7 +53,7 @@
                        print "<table width='100%'>
                        <tr><td>Feed URL:</td><td>
                                <input class=\"iedit\" onblur=\"javascript:enableHotkeys()\" 
-                                       onkeypress=\"return filterCR(event, qafAdd)\"
+                                       onkeypress=\"return filterCR(event, qaddFeed)\"
                                        onkeyup=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\"
                                        onchange=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\"
                                        onfocus=\"javascript:disableHotkeys()\" name=\"feed_url\"></td></tr>";
                        print "<div align='right'>
                                <input class=\"button\"
                                        id=\"fadd_submit_btn\" disabled=\"true\"
-                                       type=\"submit\" onclick=\"return qafAdd()\" value=\"".__('Subscribe')."\">
+                                       type=\"submit\" onclick=\"return qaddFeed()\" value=\"".__('Subscribe')."\">
                                <input class=\"button\"
                                        type=\"submit\" onclick=\"return closeInfoBox()\" 
                                        value=\"".__('Cancel')."\"></div>";
+
+                       return;
                }
 
                if ($id == "search") {
 
                        print "</div>";
 
+                       return;
+
                }
 
                if ($id == "quickAddLabel") {
                        print "<input class=\"button\"
                                type=\"submit\" onclick=\"return labelEditCancel()\" 
                                value=\"".__('Cancel')."\">";
+
+                       return;
                }
 
                if ($id == "quickAddFilter") {
 
                        print "<input type=\"submit\" 
                                id=\"infobox_submit\"
-                               class=\"button\" onclick=\"return qaddFilter()\" 
+                               class=\"button\" onclick=\"return addFilter()\" 
                                disabled=\"true\" value=\"".__('Create')."\"> ";
 
                        print "<input class=\"button\"
 
 //                     print "</td></tr></table>"; 
 
+                       return;
                }
 
                if ($id == "feedUpdateErrors") {
 
                        print "</div>";
 
+                       return;
                }
 
-               print "</div>";
+               print "<div id='infoBoxTitle'>Internal Error</div>
+                       <div id='infoBoxContents'>
+                       <p>Unknown dialog <b>$id</b></p>
+                       </div></div>";
+       
        }
 ?>
index 5a5d0f0e7b914204437f31b22316751ed036f324..57a224eb95a8d5333a2addd56facb5020ae51d76 100644 (file)
                        <input type=\"submit\" class=\"button\" 
                                onclick=\"javascript:updateFeedList()\" value=\"".__('Search')."\">
                        </div>";
-
-               print "<div class=\"prefGenericAddBox\">
-                       <input id=\"fadd_link\" 
+               
+               print "<input id=\"fadd_link\" 
                                onkeyup=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\"
                                onchange=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\"
                                size=\"40\">
                                onclick=\"javascript:browseFeeds()\" value=\"".__('Top 25')."\">";
                }
 
-               print "</div>";
-
                $feeds_sort = db_escape_string($_GET["sort"]);
 
                if (!$feeds_sort || $feeds_sort == "undefined") {
index 1403464b16564896cf9b5e44600d3024b1e5cbde..57432955a42d789cf8f1c5a507c1fc5c65334dc2 100644 (file)
                                        inverse = $inverse,
                                        action_param = '$action_param'
                                        WHERE id = '$filter_id' AND owner_uid = " . $_SESSION["uid"]);
-                       
+
+                       if (db_affected_rows($link, $result) != 0) {
+                               print_notice(T_sprintf("Saved filter <b>%s</b>", htmlspecialchars($reg_exp)));
+                       }
+
                }
 
                if ($subop == "remove") {
                                        ('$regexp', '$filter_type','".$_SESSION["uid"]."', 
                                                $feed_id, '$action_id', '$action_param', $inverse)");
 
-                       print_notice(T_sprintf("Created filter <b>%s</b>", htmlspecialchars($regexp)));
+                       if (db_affected_rows($link, $result) != 0) {
+                               print T_sprintf("Created filter <b>%s</b>", htmlspecialchars($regexp));
+                       }
+
+                       return;
                }
 
                if ($quiet) return;
index ccd669fc296c55b466a79e9e84bdead05c7d4411..c07d6132f0554e0a45b5f99aa350fb8d22bc8f29 100644 (file)
                                sql_exp = '$sql_exp', 
                                description = '$descr'
                                WHERE id = '$label_id'");
+
+                       if (db_affected_rows($link, $result) != 0) {
+                               print_notice(T_sprintf("Saved label <b>%s</b>", htmlspecialchars($descr)));
+                       }
+
                }
 
                if ($subop == "remove") {
                }
 
                if ($subop == "add") {
-               
-                       if (!WEB_DEMO_MODE) {
 
-                               // no escaping is done here on purpose
-                               $sql_exp = trim($_GET["sql_exp"]);
-                               $description = db_escape_string($_GET["description"]);
+                       // no escaping is done here on purpose
+                       $sql_exp = trim($_GET["sql_exp"]);
+                       $description = db_escape_string($_GET["description"]);
 
-                               if (!$sql_exp || !$description) return;
+                       if (!$sql_exp || !$description) return;
 
-                               $result = db_query($link,
-                                       "INSERT INTO ttrss_labels (sql_exp,description,owner_uid) 
-                                               VALUES ('$sql_exp', '$description', '".$_SESSION["uid"]."')");
-                       } 
+                       $result = db_query($link,
+                               "INSERT INTO ttrss_labels (sql_exp,description,owner_uid) 
+                               VALUES ('$sql_exp', '$description', '".$_SESSION["uid"]."')");
+
+                       if (db_affected_rows($link, $result) != 0) {
+                               print T_sprintf("Created label <b>%s</b>", htmlspecialchars($description));
+                       }
+
+                       return;
                }
 
                $sort = db_escape_string($_GET["sort"]);