mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2026-01-08 14:19:16 +00:00
implement multiple rule/action filters
This commit is contained in:
126
classes/dlg.php
126
classes/dlg.php
@@ -444,132 +444,6 @@ class Dlg extends Handler_Protected {
|
||||
</div>";
|
||||
}
|
||||
|
||||
function quickAddFilter() {
|
||||
$active_feed_id = (int) db_escape_string($_REQUEST["feed"]);
|
||||
$cat_filter = db_escape_string($_REQUEST["is_cat"]) == "true";
|
||||
|
||||
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-filters\">";
|
||||
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"quiet\" value=\"1\">";
|
||||
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"add\">";
|
||||
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"csrf_token\" value=\"".$_SESSION['csrf_token']."\">";
|
||||
|
||||
$result = db_query($this->link, "SELECT id,description
|
||||
FROM ttrss_filter_types ORDER BY description");
|
||||
|
||||
$filter_types = array();
|
||||
|
||||
while ($line = db_fetch_assoc($result)) {
|
||||
//array_push($filter_types, $line["description"]);
|
||||
$filter_types[$line["id"]] = __($line["description"]);
|
||||
}
|
||||
|
||||
print "<div class=\"dlgSec\">".__("Match")."</div>";
|
||||
|
||||
print "<div class=\"dlgSecCont\">";
|
||||
|
||||
print "<span id=\"filterDlg_dateModBox\" style=\"display : none\">";
|
||||
|
||||
$filter_params = array(
|
||||
"before" => __("before"),
|
||||
"after" => __("after"));
|
||||
|
||||
print_select_hash("filter_date_modifier", "before",
|
||||
$filter_params, 'dojoType="dijit.form.Select"');
|
||||
|
||||
print " </span>";
|
||||
|
||||
print "<input dojoType=\"dijit.form.ValidationTextBox\"
|
||||
required=\"true\" id=\"filterDlg_regExp\"
|
||||
style=\"font-size : 16px\"
|
||||
name=\"reg_exp\" value=\"$reg_exp\"/>";
|
||||
|
||||
print "<span id=\"filterDlg_dateChkBox\" style=\"display : none\">";
|
||||
print " <button dojoType=\"dijit.form.Button\"
|
||||
onclick=\"return filterDlgCheckDate()\">".
|
||||
__('Check it')."</button>";
|
||||
print "</span>";
|
||||
|
||||
print "<hr/>" . __("on field") . " ";
|
||||
print_select_hash("filter_type", 1, $filter_types,
|
||||
'onchange="filterDlgCheckType(this)" dojoType="dijit.form.Select"');
|
||||
|
||||
print "<hr/>";
|
||||
|
||||
print __("in") . " ";
|
||||
|
||||
print "<span id='filterDlg_feeds'>";
|
||||
print_feed_select($this->link, "feed_id",
|
||||
$cat_filter ? "CAT:$active_feed_id" : $active_feed_id,
|
||||
'dojoType="dijit.form.FilteringSelect"');
|
||||
print "</span>";
|
||||
|
||||
print "<span id='filterDlg_cats' style='display : none'>";
|
||||
print_feed_cat_select($this->link, "cat_id", $active_cat_id,
|
||||
'dojoType="dijit.form.FilteringSelect"');
|
||||
print "</span>";
|
||||
|
||||
print "</div>";
|
||||
|
||||
print "<div class=\"dlgSec\">".__("Perform Action")."</div>";
|
||||
|
||||
print "<div class=\"dlgSecCont\">";
|
||||
|
||||
print "<select name=\"action_id\" dojoType=\"dijit.form.Select\"
|
||||
onchange=\"filterDlgCheckAction(this)\">";
|
||||
|
||||
$result = db_query($this->link, "SELECT id,description FROM ttrss_filter_actions
|
||||
ORDER BY name");
|
||||
|
||||
while ($line = db_fetch_assoc($result)) {
|
||||
printf("<option value='%d'>%s</option>", $line["id"], __($line["description"]));
|
||||
}
|
||||
|
||||
print "</select>";
|
||||
|
||||
print "<span id=\"filterDlg_paramBox\" style=\"display : none\">";
|
||||
print " " . __("with parameters:") . " ";
|
||||
print "<input dojoType=\"dijit.form.TextBox\"
|
||||
id=\"filterDlg_actionParam\"
|
||||
name=\"action_param\">";
|
||||
|
||||
print_label_select($this->link, "action_param_label", $action_param,
|
||||
'id="filterDlg_actionParamLabel" dojoType="dijit.form.Select"');
|
||||
|
||||
print "</span>";
|
||||
|
||||
print " "; // tiny layout hack
|
||||
|
||||
print "</div>";
|
||||
|
||||
print "<div class=\"dlgSec\">".__("Options")."</div>";
|
||||
print "<div class=\"dlgSecCont\">";
|
||||
|
||||
print "<input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"enabled\" id=\"enabled\" checked=\"1\">
|
||||
<label for=\"enabled\">".__('Enabled')."</label><hr/>";
|
||||
|
||||
print "<input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"inverse\" id=\"inverse\">
|
||||
<label for=\"inverse\">".__('Inverse match')."</label><hr/>";
|
||||
|
||||
# print "<input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"cat_filter\" id=\"cat_filter\" onchange=\"filterDlgCheckCat(this)\">
|
||||
# <label for=\"cat_filter\">".__('Apply to category')."</label><hr/>";
|
||||
|
||||
|
||||
print "</div>";
|
||||
|
||||
print "<div class=\"dlgButtons\">";
|
||||
|
||||
print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterEditDlg').test()\">".
|
||||
__('Test')."</button> ";
|
||||
|
||||
print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterEditDlg').execute()\">".
|
||||
__('Create')."</button> ";
|
||||
|
||||
print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterEditDlg').hide()\">".
|
||||
__('Cancel')."</button>";
|
||||
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
function inactiveFeeds() {
|
||||
|
||||
if (DB_TYPE == "pgsql") {
|
||||
|
||||
Reference in New Issue
Block a user