]> git.wh0rd.org - tt-rss.git/blobdiff - modules/pref-filters.php
js: misc fixes, code cleanup
[tt-rss.git] / modules / pref-filters.php
index 5c71fcb03f8d6b90e2742b4e32a5dc444b308a88..d11d0eb7e007cbc81a9a02404bb95a28f5e3129f 100644 (file)
@@ -63,9 +63,8 @@
                                         name=\"reg_exp\" size=\"30\" value=\"$reg_exp\">";
 
                        print "<span id=\"filter_dlg_date_chk_box\" $date_ops_invisible>";                      
-                       print "&nbsp;<input class=\"button\"
-                               type=\"submit\" onclick=\"return filterDlgCheckDate()\" 
-                               value=\"".__('Check it')."\">";
+                       print "&nbsp;<button onclick=\"return filterDlgCheckDate()\">".
+                               __('Check it')."</button>";
                        print "</span>";
 
                        print "<br/> " . __("on field") . " ";
                        <img style='vertical-align : top;' src='".theme_image($link, "images/sign_quest.png")."'></a>
                </div>";
 
-               print "<button onclick=\"return displayDlg('quickAddFilter', false)\">".
+               print "<button onclick=\"return quickAddFilter()\">".
                        __('Create filter')."</button> "; 
 
                print "<button onclick=\"return editSelectedFilter()\">".
                print "<button onclick=\"return removeSelectedFilters()\">".
                        __('Remove')."</button> ";
 
-               print "<button onclick=\"rescore_all_feeds()\">".
-                       __('Rescore articles')."</button> "; 
+               if (defined('_ENABLE_FEED_DEBUGGING')) {
+                       print "<button onclick=\"rescore_all_feeds()\">".
+                               __('Rescore articles')."</button> "; 
+               }
 
                if ($filter_search) {
                        $filter_search = split(' ', db_escape_string($filter_search));
 
                        print "<tr><td class=\"selectPrompt\" colspan=\"8\">
                                ".__('Select:')." 
-                                       <a href=\"javascript:selectPrefRows('filter', true)\">".__('All')."</a>,
-                                       <a href=\"javascript:selectPrefRows('filter', false)\">".__('None')."</a>
+                                       <a href=\"#\" onclick=\"selectTableRows('prefFilterList', 'all')\">".__('All')."</a>,
+                                       <a href=\"#\" onclick=\"selectTableRows('prefFilterList', 'none')\">".__('None')."</a>
                                </td</tr>";
 
                        $lnum = 0;
 
                                        print "<tr class=\"title\">
                                                <td align='center' width=\"5%\">&nbsp;</td>
-                                               <td width=\"20%\"><a href=\"javascript:updateFilterList('reg_exp')\">".__('Match')."</a></td>
-                                               <td width=\"\"><a href=\"javascript:updateFilterList('feed_title')\">".__('Feed')."</a></td>
-                                               <td width=\"20%\"><a href=\"javascript:updateFilterList('filter_type')\">".__('Field')."</a></td>
-                                               <td width=\"20%\"><a href=\"javascript:updateFilterList('action_param')\">".__('Params')."</a></td>"; 
+                                               <td width=\"20%\"><a href=\"#\" onclick=\"updateFilterList('reg_exp')\">".__('Match')."</a></td>
+                                               <td width=\"\"><a href=\"#\" onclick=\"updateFilterList('feed_title')\">".__('Feed')."</a></td>
+                                               <td width=\"20%\"><a href=\"#\" onclick=\"updateFilterList('filter_type')\">".__('Field')."</a></td>
+                                               <td width=\"20%\"><a href=\"#\" onclick=\"updateFilterList('action_param')\">".__('Params')."</a></td>"; 
 
                                        $lnum = 0;
                                }
        
                                if (!$line["feed_title"]) $line["feed_title"] = __("All feeds");
 
+                               if (array_search($line["action_name"], 
+                                       array("score", "tag", "label")) === false) {
+
+                                               $line["action_param"] = false;
+                               }
+
                                if (!$line["action_param"]) {
                                        $line["action_param"] = "&mdash;";
                                } else if ($line["action_name"] == "score") {
 
                                $line["feed_title"] = htmlspecialchars($line["feed_title"]);
 
-                               print "<td align='center'><input onclick='toggleSelectPrefRow(this, \"filter\");' 
+                               print "<td align='center'><input onclick='toggleSelectRow(this);' 
                                        type=\"checkbox\" id=\"FICHK-".$line["id"]."\"></td>";
 
                                $filter_params = array(
                                                $line["action_param"] . "</span>";
                                }       
 
-                               $onclick = "onclick='editFilter($filter_id)' title='".__('Click to edit')."'";
+                               $onclick = "onclick='editFilter($filter_id, event)' title='".__('Click to edit')."'";
 
                                $inverse_label = "";
 
                }
        }
 
-       function print_label_select($link, $name, $value, $style = "") {
-
-               $result = db_query($link, "SELECT caption FROM ttrss_labels2
-                       WHERE owner_uid = '".$_SESSION["uid"]."' ORDER BY caption");
-
-               print "<select name=\"$name\" style=\"$style\">";
-
-               while ($line = db_fetch_assoc($result)) {
-
-                       $issel = ($line["caption"] == $value) ? "selected" : "";
-
-                       print "<option $issel>" . $line["caption"] . "</option>";
-
-               }
-
-               print "</select>";
-
-
-       }
 ?>