diff options
| author | wn_ <invalid@email.com> | 2025-01-06 15:49:37 +0000 |
|---|---|---|
| committer | wn_ <invalid@email.com> | 2025-01-06 15:49:40 +0000 |
| commit | e546e739146dbeabd2d35dba5dbe2cb50e2f5f76 (patch) | |
| tree | 8f493bf77450c72cdacfea2e3e3389d5b0880cdb | |
| parent | 2eb3c150c2f63b4e4e11ec699fae144e60dc7109 (diff) | |
Use 'clone' wording for filter duplication.
| -rw-r--r-- | classes/Pref_Filters.php | 12 | ||||
| -rw-r--r-- | js/PrefFilterTree.js | 11 |
2 files changed, 12 insertions, 11 deletions
diff --git a/classes/Pref_Filters.php b/classes/Pref_Filters.php index 26ae03e16..665693d81 100644 --- a/classes/Pref_Filters.php +++ b/classes/Pref_Filters.php @@ -506,7 +506,7 @@ class Pref_Filters extends Handler_Protected { $sth->execute([...$ids, $_SESSION['uid']]); } - private function _copy_rules_and_actions(int $filter_id, ?int $src_filter_id = null): bool { + private function _clone_rules_and_actions(int $filter_id, ?int $src_filter_id = null): bool { $sth = $this->pdo->prepare('INSERT INTO ttrss_filters2_rules (filter_id, reg_exp, inverse, filter_type, feed_id, cat_id, match_on, cat_filter) SELECT :filter_id, reg_exp, inverse, filter_type, feed_id, cat_id, match_on, cat_filter @@ -646,13 +646,13 @@ class Pref_Filters extends Handler_Protected { if ($src_filter_id === null) $this->_save_rules_and_actions($filter_id); else - $this->_copy_rules_and_actions($filter_id, $src_filter_id); + $this->_clone_rules_and_actions($filter_id, $src_filter_id); } $this->pdo->commit(); } - function copy(): void { + function clone(): void { /** @var array<int, int> */ $src_filter_ids = array_map('intval', array_filter(explode(',', clean($_REQUEST['ids'] ?? '')))); @@ -665,7 +665,7 @@ class Pref_Filters extends Handler_Protected { // see checkbox_to_sql_bool() for 0+1 justification $this->add([ 'src_filter_id' => $src_filter->id, - 'title' => sprintf(__('Copy of %s'), $src_filter->title), + 'title' => sprintf(__('Clone of %s'), $src_filter->title), 'enabled' => 0, 'match_any_rule' => $src_filter->match_any_rule ? 1 : 0, 'inverse' => $src_filter->inverse ? 1 : 0, @@ -707,8 +707,8 @@ class Pref_Filters extends Handler_Protected { <button dojoType="dijit.form.Button" onclick="return Filters.edit()"> <?= __('Create filter') ?></button> - <button dojoType="dijit.form.Button" onclick="return dijit.byId('filterTree').copySelectedFilters()"> - <?= __('Copy') ?></button> + <button dojoType="dijit.form.Button" onclick="return dijit.byId('filterTree').cloneSelectedFilters()"> + <?= __('Clone') ?></button> <button dojoType="dijit.form.Button" onclick="return dijit.byId('filterTree').joinSelectedFilters()"> <?= __('Combine') ?></button> <button dojoType="dijit.form.Button" onclick="return dijit.byId('filterTree').removeSelectedFilters()"> diff --git a/js/PrefFilterTree.js b/js/PrefFilterTree.js index e94542a16..288826202 100644 --- a/js/PrefFilterTree.js +++ b/js/PrefFilterTree.js @@ -167,27 +167,28 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio return false; }, - copySelectedFilters: function() { + cloneSelectedFilters: function() { const sel_rows = this.getSelectedFilters(); if (sel_rows.length > 0) { - const query = {op: "Pref_Filters", method: "copy", ids: sel_rows.toString()}; + const query = {op: "Pref_Filters", method: "clone", ids: sel_rows.toString()}; let proceed = false; if (sel_rows.length === 1) { const selected_filter = this.model.getCheckedItems()[0]; - const new_title = prompt(__("Name for copied filter:"), 'Copy - ' + this.model.store.getValue(selected_filter, "bare_name")); + const new_title = prompt(__("Name for new filter:"), + __("Clone of %s").replace("%s", this.model.store.getValue(selected_filter, "bare_name"))); if (new_title) { query.new_title = new_title; proceed = true; } } else if (sel_rows.length > 1) { - proceed = confirm(__("Copy selected filters?")); + proceed = confirm(__("Clone selected filters?")); } if (proceed) { - Notify.progress("Copying selected filters..."); + Notify.progress(__("Cloning selected filters...")); xhr.post("backend.php", query, () => { this.reload(); |