From f30ef1fa1bd76b497b5c0a64a92e2e0ef7116515 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 12 Dec 2011 22:46:25 +0400 Subject: [PATCH] subop -> method --- backend.php | 14 +++--- include/db.php | 2 +- include/functions.php | 24 +++++----- js/PrefFeedTree.js | 2 +- js/digest.js | 22 ++++----- js/feedlist.js | 18 +++---- js/functions.js | 26 +++++----- js/prefs.js | 88 +++++++++++++++++----------------- js/tt-rss.js | 26 +++++----- js/viewfeed.js | 38 +++++++-------- modules/backend-rpc.php | 98 +++++++++++++++++++------------------- modules/popup-dialog.php | 18 +++---- modules/pref-feeds.php | 62 ++++++++++++------------ modules/pref-filters.php | 16 +++---- modules/pref-instances.php | 12 ++--- modules/pref-labels.php | 20 ++++---- modules/pref-prefs.php | 18 +++---- modules/pref-users.php | 22 ++++----- public.php | 2 +- 19 files changed, 264 insertions(+), 264 deletions(-) diff --git a/backend.php b/backend.php index 247cab38..0e485de7 100644 --- a/backend.php +++ b/backend.php @@ -43,7 +43,7 @@ init_connection($link); - $subop = $_REQUEST["subop"]; + $method = $_REQUEST["method"]; $mode = $_REQUEST["mode"]; if ((!$op || $op == "rss" || $op == "dlg") && !$_REQUEST["noxml"]) { @@ -69,7 +69,7 @@ return; } else if (!($_SESSION["uid"] && validate_session($link))) { - if ($op == 'pref-feeds' && $_REQUEST['subop'] == 'add') { + if ($op == 'pref-feeds' && $_REQUEST['method'] == 'add') { header("Content-Type: text/html"); login_sequence($link); render_login_form($link); @@ -143,10 +143,10 @@ break; // rpc case "feeds": - $subop = $_REQUEST["subop"]; + $method = $_REQUEST["method"]; $root = (bool)$_REQUEST["root"]; - switch($subop) { + switch($method) { case "catchupAll": db_query($link, "UPDATE ttrss_user_entries SET last_read = NOW(),unread = false WHERE owner_uid = " . $_SESSION["uid"]); @@ -254,7 +254,7 @@ $omode = db_escape_string($_REQUEST["omode"]); $feed = db_escape_string($_REQUEST["feed"]); - $subop = db_escape_string($_REQUEST["subop"]); + $method = db_escape_string($_REQUEST["method"]); $view_mode = db_escape_string($_REQUEST["view_mode"]); $limit = (int) get_pref($link, "DEFAULT_ARTICLE_LIMIT"); @$cat_view = db_escape_string($_REQUEST["cat"]) == "true"; @@ -353,7 +353,7 @@ if ($_REQUEST["debug"]) $timing_info = print_checkpoint("04", $timing_info); - $ret = format_headlines_list($link, $feed, $subop, + $ret = format_headlines_list($link, $feed, $method, $view_mode, $limit, $cat_view, $next_unread_feed, $offset, $vgroup_last_feed, $override_order); @@ -386,7 +386,7 @@ $reply['articles'] = $articles; } -// if ($subop) { +// if ($method) { // $reply['counters'] = getAllCounters($link, $omode, $feed); // } diff --git a/include/db.php b/include/db.php index 0682b58f..7a858ca7 100644 --- a/include/db.php +++ b/include/db.php @@ -53,7 +53,7 @@ function db_escape_string($s, $strip_tags = true) { function db_query($link, $query, $die_on_error = true) { //if ($_REQUEST["qlog"]) - // error_log($_SESSION["uid"] . ":" . $_REQUEST["op"] . "/" . $_REQUEST["subop"] . + // error_log($_SESSION["uid"] . ":" . $_REQUEST["op"] . "/" . $_REQUEST["method"] . // " $query\n", 3, "/tmp/ttrss-query.log"); if (DB_TYPE == "pgsql") { diff --git a/include/functions.php b/include/functions.php index 8f46c295..28be5cbe 100644 --- a/include/functions.php +++ b/include/functions.php @@ -4884,7 +4884,7 @@ } - function format_headlines_list($link, $feed, $subop, $view_mode, $limit, $cat_view, + function format_headlines_list($link, $feed, $method, $view_mode, $limit, $cat_view, $next_unread_feed, $offset, $vgr_last_feed = false, $override_order = false) { @@ -4897,22 +4897,22 @@ $topmost_article_ids = array(); if (!$offset) $offset = 0; - if ($subop == "undefined") $subop = ""; + if ($method == "undefined") $method = ""; - $subop_split = explode(":", $subop); + $method_split = explode(":", $method); -/* if ($subop == "CatchupSelected") { +/* if ($method == "CatchupSelected") { $ids = explode(",", db_escape_string($_REQUEST["ids"])); $cmode = sprintf("%d", $_REQUEST["cmode"]); catchupArticlesById($link, $ids, $cmode); } */ - if ($subop == "ForceUpdate" && $feed && is_numeric($feed) > 0) { + if ($method == "ForceUpdate" && $feed && is_numeric($feed) > 0) { update_rss_feed($link, $feed, true); } - if ($subop == "MarkAllRead") { + if ($method == "MarkAllRead") { catchup_feed($link, $feed, $cat_view); if (get_pref($link, 'ON_CATCHUP_SHOW_NEXT_FEED')) { @@ -4922,8 +4922,8 @@ } } - if ($subop_split[0] == "MarkAllReadGR") { - catchup_feed($link, $subop_split[1], false); + if ($method_split[0] == "MarkAllReadGR") { + catchup_feed($link, $method_split[1], false); } // FIXME: might break tag display? @@ -4973,9 +4973,9 @@ if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H0", $timing_info); -// error_log("format_headlines_list: [" . $feed . "] subop [" . $subop . "]"); - if( $search_mode == '' && $subop != '' ){ - $search_mode = $subop; +// error_log("format_headlines_list: [" . $feed . "] method [" . $method . "]"); + if( $search_mode == '' && $method != '' ){ + $search_mode = $method; } // error_log("search_mode: " . $search_mode); $qfh_ret = queryFeedHeadlines($link, $feed, $limit, $view_mode, $cat_view, @@ -5638,7 +5638,7 @@ //$url_path = ($_SERVER['HTTPS'] != "on" ? 'http://' : 'https://') . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); $url_path = get_self_url_prefix() . - "/backend.php?op=pref-feeds&quiet=1&subop=add&feed_url=%s"; + "/backend.php?op=pref-feeds&quiet=1&method=add&feed_url=%s"; return $url_path; } // function add_feed_url diff --git a/js/PrefFeedTree.js b/js/PrefFeedTree.js index 4ea48660..9e2ee066 100644 --- a/js/PrefFeedTree.js +++ b/js/PrefFeedTree.js @@ -11,7 +11,7 @@ dojo.declare("fox.PrefFeedStore", dojo.data.ItemFileWriteStore, { dojo.xhrPost({ url: "backend.php", - content: {op: "pref-feeds", subop: "savefeedorder", + content: {op: "pref-feeds", method: "savefeedorder", payload: newFileContentString}, error: saveFailedCallback, load: saveCompleteCallback}); diff --git a/js/digest.js b/js/digest.js index 7dba6d36..c1cbf876 100644 --- a/js/digest.js +++ b/js/digest.js @@ -26,7 +26,7 @@ function catchup_feed(feed_id, callback) { if (feed_id < 0) is_cat = "true"; // KLUDGE - var query = "?op=rpc&subop=catchupFeed&feed_id=" + + var query = "?op=rpc&method=catchupFeed&feed_id=" + feed_id + "&is_cat=" + is_cat; new Ajax.Request("backend.php", { @@ -68,7 +68,7 @@ function catchup_visible_articles(callback) { if (confirm(__("Mark %d displayed articles as read?").replace("%d", ids.length))) { - var query = "?op=rpc&subop=catchupSelected" + + var query = "?op=rpc&method=catchupSelected" + "&cmode=0&ids=" + param_escape(ids); new Ajax.Request("backend.php", { @@ -88,7 +88,7 @@ function catchup_visible_articles(callback) { function catchup_article(article_id, callback) { try { - var query = "?op=rpc&subop=catchupSelected" + + var query = "?op=rpc&method=catchupSelected" + "&cmode=0&ids=" + article_id; new Ajax.Request("backend.php", { @@ -169,7 +169,7 @@ function update(callback) { window.clearTimeout(_update_timeout); new Ajax.Request("backend.php", { - parameters: "?op=rpc&subop=digest-init", + parameters: "?op=rpc&method=digest-init", onComplete: function(transport) { fatal_error_check(transport); parse_feeds(transport); @@ -220,7 +220,7 @@ function view(article_id) { }, 500); new Ajax.Request("backend.php", { - parameters: "?op=rpc&subop=digest-get-contents&article_id=" + + parameters: "?op=rpc&method=digest-get-contents&article_id=" + article_id, onComplete: function(transport) { fatal_error_check(transport); @@ -315,7 +315,7 @@ function viewfeed(feed_id, offset, replace, no_effects, no_indicator, callback) if (!offset) $("headlines").scrollTop = 0; - var query = "backend.php?op=rpc&subop=digest-update&feed_id=" + + var query = "backend.php?op=rpc&method=digest-update&feed_id=" + param_escape(feed_id) + "&offset=" + offset + "&seq=" + _update_seq; @@ -648,7 +648,7 @@ function parse_headlines(transport, replace, no_effects) { function init_second_stage() { try { new Ajax.Request("backend.php", { - parameters: "backend.php?op=rpc&subop=digest-init", + parameters: "backend.php?op=rpc&method=digest-init", onComplete: function(transport) { parse_feeds(transport); Element.hide("overlay"); @@ -667,7 +667,7 @@ function init() { dojo.require("dijit.Dialog"); new Ajax.Request("backend.php", { - parameters: "?op=rpc&subop=sanityCheck", + parameters: "?op=rpc&method=sanityCheck", onComplete: function(transport) { backend_sanity_check_callback(transport); } }); @@ -681,7 +681,7 @@ function toggle_mark(img, id) { try { - var query = "?op=rpc&id=" + id + "&subop=mark"; + var query = "?op=rpc&id=" + id + "&method=mark"; if (!img) return; @@ -710,7 +710,7 @@ function toggle_pub(img, id, note) { try { - var query = "?op=rpc&id=" + id + "&subop=publ"; + var query = "?op=rpc&id=" + id + "&method=publ"; if (note != undefined) { query = query + "¬e=" + param_escape(note); @@ -798,7 +798,7 @@ function update_title(unread) { function tweet_article(id) { try { - var query = "?op=rpc&subop=getTweetInfo&id=" + param_escape(id); + var query = "?op=rpc&method=getTweetInfo&id=" + param_escape(id); console.log(query); diff --git a/js/feedlist.js b/js/feedlist.js index eaaeaad8..ff4c948d 100644 --- a/js/feedlist.js +++ b/js/feedlist.js @@ -48,14 +48,14 @@ function loadMoreHeadlines() { } -function viewfeed(feed, subop, is_cat, offset, background, infscroll_req) { +function viewfeed(feed, method, is_cat, offset, background, infscroll_req) { try { if (is_cat == undefined) is_cat = false; else is_cat = !!is_cat; - if (subop == undefined) subop = ''; + if (method == undefined) method = ''; if (offset == undefined) offset = 0; if (background == undefined) background = false; if (infscroll_req == undefined) infscroll_req = false; @@ -110,7 +110,7 @@ function viewfeed(feed, subop, is_cat, offset, background, infscroll_req) { _infscroll_disable = 0; } - if (!offset && !subop && cached_headlines && !background) { + if (!offset && !method && cached_headlines && !background) { try { render_local_headlines(feed, is_cat, JSON.parse(cached_headlines)); return; @@ -119,7 +119,7 @@ function viewfeed(feed, subop, is_cat, offset, background, infscroll_req) { } } - if (offset != 0 && !subop) { + if (offset != 0 && !method) { var date = new Date(); var timestamp = Math.round(date.getTime() / 1000); @@ -139,7 +139,7 @@ function viewfeed(feed, subop, is_cat, offset, background, infscroll_req) { var toolbar_query = Form.serialize("main_toolbar_form"); var query = "?op=viewfeed&feed=" + feed + "&" + - toolbar_query + "&subop=" + param_escape(subop); + toolbar_query + "&method=" + param_escape(method); if (!background) { if (_search_query) { @@ -148,7 +148,7 @@ function viewfeed(feed, subop, is_cat, offset, background, infscroll_req) { _search_query = false; } - if (subop == "MarkAllRead") { + if (method == "MarkAllRead") { var show_next_feed = getInitParam("on_catchup_show_next_feed") == "1"; @@ -162,7 +162,7 @@ function viewfeed(feed, subop, is_cat, offset, background, infscroll_req) { render_local_headlines(nuf, false, JSON.parse(cached_nuf)); - var catchup_query = "?op=rpc&subop=catchupFeed&feed_id=" + + var catchup_query = "?op=rpc&method=catchupFeed&feed_id=" + feed + "&is_cat=" + is_cat; console.log(catchup_query); @@ -246,7 +246,7 @@ function request_counters_real() { try { console.log("requesting counters..."); - var query = "?op=rpc&subop=getAllCounters&seq=" + next_seq(); + var query = "?op=rpc&method=getAllCounters&seq=" + next_seq(); query = query + "&omode=flc"; @@ -487,7 +487,7 @@ function catchupFeed(feed, is_cat) { return; } - var catchup_query = "?op=rpc&subop=catchupFeed&feed_id=" + + var catchup_query = "?op=rpc&method=catchupFeed&feed_id=" + feed + "&is_cat=" + is_cat; notify_progress("Loading, please wait...", true); diff --git a/js/functions.js b/js/functions.js index 02fbadf5..e62d576b 100644 --- a/js/functions.js +++ b/js/functions.js @@ -607,7 +607,7 @@ function filterDlgCheckDate() { var reg_exp = dialog.attr('value').reg_exp; - var query = "?op=rpc&subop=checkDate&date=" + reg_exp; + var query = "?op=rpc&method=checkDate&date=" + reg_exp; new Ajax.Request("backend.php", { parameters: query, @@ -756,7 +756,7 @@ function removeFeedIcon(id) { try { if (confirm(__("Remove stored feed icon?"))) { - var query = "backend.php?op=pref-feeds&subop=removeicon&feed_id=" + param_escape(id); + var query = "backend.php?op=pref-feeds&method=removeicon&feed_id=" + param_escape(id); console.log(query); @@ -815,7 +815,7 @@ function addLabel(select, callback) { return false; } - var query = "?op=pref-labels&subop=add&caption=" + + var query = "?op=pref-labels&method=add&caption=" + param_escape(caption); if (select) @@ -893,7 +893,7 @@ function quickAddFeed() { notify_progress("Searching for feed urls...", true); new Ajax.Request("backend.php", { - parameters: 'op=rpc&subop=extractfeedurls&url=' + param_escape(feed_url), + parameters: 'op=rpc&method=extractfeedurls&url=' + param_escape(feed_url), onComplete: function(transport, dialog, feed_url) { notify(''); @@ -978,7 +978,7 @@ function quickAddFilter() { execute: function() { if (this.validate()) { - var query = "?op=rpc&subop=verifyRegexp®_exp=" + + var query = "?op=rpc&method=verifyRegexp®_exp=" + param_escape(dialog.attr('value').reg_exp); notify_progress("Verifying regular expression..."); @@ -1028,7 +1028,7 @@ function resetPubSub(feed_id, title) { if (title == undefined || confirm(msg)) { notify_progress("Loading, please wait..."); - var query = "?op=pref-feeds&quiet=1&subop=resetPubSub&ids=" + feed_id; + var query = "?op=pref-feeds&quiet=1&method=resetPubSub&ids=" + feed_id; new Ajax.Request("backend.php", { parameters: query, @@ -1049,7 +1049,7 @@ function unsubscribeFeed(feed_id, title) { if (title == undefined || confirm(msg)) { notify_progress("Removing feed..."); - var query = "?op=pref-feeds&quiet=1&subop=remove&ids=" + feed_id; + var query = "?op=pref-feeds&quiet=1&method=remove&ids=" + feed_id; new Ajax.Request("backend.php", { parameters: query, @@ -1155,7 +1155,7 @@ function quickAddCat(elem) { if (cat) { - var query = "?op=rpc&subop=quickAddCat&cat=" + param_escape(cat); + var query = "?op=rpc&method=quickAddCat&cat=" + param_escape(cat); notify_progress("Loading, please wait...", true); @@ -1188,7 +1188,7 @@ function genUrlChangeKey(feed, is_cat) { notify_progress("Trying to change address...", true); - var query = "?op=rpc&subop=regenFeedKey&id=" + param_escape(feed) + + var query = "?op=rpc&method=regenFeedKey&id=" + param_escape(feed) + "&is_cat=" + param_escape(is_cat); new Ajax.Request("backend.php", { @@ -1368,7 +1368,7 @@ function editFeed(feed, event) { if (feed <= 0) return alert(__("You can't edit this kind of feed.")); - var query = "backend.php?op=pref-feeds&subop=editfeed&id=" + + var query = "backend.php?op=pref-feeds&method=editfeed&id=" + param_escape(feed); console.log(query); @@ -1464,7 +1464,7 @@ function feedBrowser() { // we use dojo.toJson instead of JSON.stringify because // it somehow escapes everything TWICE, at least in Chrome 9 - var query = "?op=rpc&subop=massSubscribe&payload="+ + var query = "?op=rpc&method=massSubscribe&payload="+ param_escape(dojo.toJson(selected)) + "&mode=" + param_escape(mode); console.log(query); @@ -1524,7 +1524,7 @@ function feedBrowser() { if (confirm(pr)) { Element.show('feed_browser_spinner'); - var query = "?op=rpc&subop=remarchived&ids=" + + var query = "?op=rpc&method=remarchived&ids=" + param_escape(selected.toString());; new Ajax.Request("backend.php", { @@ -1574,7 +1574,7 @@ function showFeedsWithErrors() { if (ok) { notify_progress("Removing selected feeds...", true); - var query = "?op=pref-feeds&subop=remove&ids="+ + var query = "?op=pref-feeds&method=remove&ids="+ param_escape(sel_rows.toString()); new Ajax.Request("backend.php", { diff --git a/js/prefs.js b/js/prefs.js index e40d6d72..760441a3 100644 --- a/js/prefs.js +++ b/js/prefs.js @@ -124,7 +124,7 @@ function addUser() { notify_progress("Adding user..."); - var query = "?op=pref-users&subop=add&login=" + + var query = "?op=pref-users&method=add&login=" + param_escape(login); new Ajax.Request("backend.php", { @@ -148,7 +148,7 @@ function editUser(id, event) { selectTableRows('prefUserList', 'none'); selectTableRowById('UMRR-'+id, 'UMCHK-'+id, true); - var query = "?op=pref-users&subop=edit&id=" + + var query = "?op=pref-users&method=edit&id=" + param_escape(id); new Ajax.Request("backend.php", { @@ -173,7 +173,7 @@ function editUser(id, event) { function editFilter(id) { try { - var query = "backend.php?op=pref-filters&subop=edit&id=" + param_escape(id); + var query = "backend.php?op=pref-filters&method=edit&id=" + param_escape(id); if (dijit.byId("filterEditDlg")) dijit.byId("filterEditDlg").destroyRecursive(); @@ -193,7 +193,7 @@ function editFilter(id) { var id = this.attr('value').id; - var query = "?op=pref-filters&subop=remove&ids="+ + var query = "?op=pref-filters&method=remove&ids="+ param_escape(id); new Ajax.Request("backend.php", { @@ -224,7 +224,7 @@ function editFilter(id) { execute: function() { if (this.validate()) { - var query = "?op=rpc&subop=verifyRegexp®_exp=" + + var query = "?op=rpc&method=verifyRegexp®_exp=" + param_escape(dialog.attr('value').reg_exp); notify_progress("Verifying regular expression..."); @@ -323,7 +323,7 @@ function removeSelectedLabels() { if (ok) { notify_progress("Removing selected labels..."); - var query = "?op=pref-labels&subop=remove&ids="+ + var query = "?op=pref-labels&method=remove&ids="+ param_escape(sel_rows.toString()); new Ajax.Request("backend.php", { @@ -353,7 +353,7 @@ function removeSelectedUsers() { if (ok) { notify_progress("Removing selected users..."); - var query = "?op=pref-users&subop=remove&ids="+ + var query = "?op=pref-users&method=remove&ids="+ param_escape(sel_rows.toString()); new Ajax.Request("backend.php", { @@ -388,7 +388,7 @@ function removeSelectedFilters() { if (ok) { notify_progress("Removing selected filters..."); - var query = "?op=pref-filters&subop=remove&ids="+ + var query = "?op=pref-filters&method=remove&ids="+ param_escape(sel_rows.toString()); new Ajax.Request("backend.php", { @@ -423,7 +423,7 @@ function removeSelectedFeeds() { notify_progress("Unsubscribing from selected feeds...", true); - var query = "?op=pref-feeds&subop=remove&ids="+ + var query = "?op=pref-feeds&method=remove&ids="+ param_escape(sel_rows.toString()); console.log(query); @@ -484,7 +484,7 @@ function purgeSelectedFeeds() { if (pr != undefined) { notify_progress("Purging selected feed..."); - var query = "?op=rpc&subop=purge&ids="+ + var query = "?op=rpc&method=purge&ids="+ param_escape(sel_rows.toString()) + "&days=" + pr; console.log(query); @@ -583,7 +583,7 @@ function resetSelectedUserPass() { var id = rows[0]; - var query = "?op=pref-users&subop=resetPass&id=" + + var query = "?op=pref-users&method=resetPass&id=" + param_escape(id); new Ajax.Request("backend.php", { @@ -619,7 +619,7 @@ function selectedUserDetails() { var id = rows[0]; - var query = "?op=pref-users&subop=user-details&id=" + id; + var query = "?op=pref-users&method=user-details&id=" + id; new Ajax.Request("backend.php", { parameters: query, @@ -682,7 +682,7 @@ function editSelectedFeeds() { notify_progress("Loading, please wait..."); - var query = "backend.php?op=pref-feeds&subop=editfeeds&ids=" + + var query = "backend.php?op=pref-feeds&method=editfeeds&ids=" + param_escape(rows.toString()); console.log(query); @@ -863,7 +863,7 @@ function updatePrefsList() { } }); } -function selectTab(id, noupdate, subop) { +function selectTab(id, noupdate, method) { try { if (!noupdate) { notify_progress("Loading, please wait..."); @@ -905,10 +905,10 @@ function init_second_stage() { if (tab) dijit.byId("pref-tabs").selectChild(tab); } - var subop = getURLParam('subop'); + var method = getURLParam('method'); - if (subop == 'editFeed') { - var param = getURLParam('subopparam'); + if (method == 'editFeed') { + var param = getURLParam('methodparam'); window.setTimeout('editFeed(' + param + ')', 100); } @@ -938,7 +938,7 @@ function init() { loading_set_progress(50); new Ajax.Request("backend.php", { - parameters: {op: "rpc", subop: "sanityCheck"}, + parameters: {op: "rpc", method: "sanityCheck"}, onComplete: function(transport) { backend_sanity_check_callback(transport); } }); @@ -955,7 +955,7 @@ function validatePrefsReset() { if (ok) { - query = "?op=pref-prefs&subop=reset-config"; + query = "?op=pref-prefs&method=reset-config"; console.log(query); new Ajax.Request("backend.php", { @@ -1160,7 +1160,7 @@ function pref_hotkey_handler(e) { function editFeedCats() { try { - var query = "backend.php?op=pref-feeds&subop=editCats"; + var query = "backend.php?op=pref-feeds&method=editCats"; if (dijit.byId("feedCatEditDlg")) dijit.byId("feedCatEditDlg").destroyRecursive(); @@ -1181,7 +1181,7 @@ function editFeedCats() { if (ok) { notify_progress("Removing selected categories...", true); - var query = "?op=pref-feeds&subop=editCats&action=remove&ids="+ + var query = "?op=pref-feeds&method=editCats&action=remove&ids="+ param_escape(sel_rows.toString()); new Ajax.Request("backend.php", { @@ -1202,7 +1202,7 @@ function editFeedCats() { if (this.validate()) { notify_progress("Creating category..."); - var query = "?op=pref-feeds&subop=editCats&action=add&cat=" + + var query = "?op=pref-feeds&method=editCats&action=add&cat=" + param_escape(this.attr('value').newcat); new Ajax.Request("backend.php", { @@ -1252,7 +1252,7 @@ function showInactiveFeeds() { if (ok) { notify_progress("Removing selected feeds...", true); - var query = "?op=pref-feeds&subop=remove&ids="+ + var query = "?op=pref-feeds&method=remove&ids="+ param_escape(sel_rows.toString()); new Ajax.Request("backend.php", { @@ -1291,7 +1291,7 @@ function opmlRegenKey() { notify_progress("Trying to change address...", true); - var query = "?op=rpc&subop=regenOPMLKey"; + var query = "?op=rpc&method=regenOPMLKey"; new Ajax.Request("backend.php", { parameters: query, @@ -1376,7 +1376,7 @@ function clearFeedArticles(feed_id) { notify_progress("Clearing feed..."); - var query = "?op=pref-feeds&quiet=1&subop=clear&id=" + feed_id; + var query = "?op=pref-feeds&quiet=1&method=clear&id=" + feed_id; new Ajax.Request("backend.php", { parameters: query, @@ -1399,7 +1399,7 @@ function rescoreSelectedFeeds() { if (ok) { notify_progress("Rescoring selected feeds...", true); - var query = "?op=pref-feeds&subop=rescore&quiet=1&ids="+ + var query = "?op=pref-feeds&method=rescore&quiet=1&ids="+ param_escape(sel_rows.toString()); new Ajax.Request("backend.php", { @@ -1422,7 +1422,7 @@ function rescore_all_feeds() { if (ok) { notify_progress("Rescoring feeds...", true); - var query = "?op=pref-feeds&subop=rescoreAll&quiet=1"; + var query = "?op=pref-feeds&method=rescoreAll&quiet=1"; new Ajax.Request("backend.php", { parameters: query, @@ -1440,7 +1440,7 @@ function labelColorReset() { var ok = confirm(__("Reset selected labels to default colors?")); if (ok) { - var query = "?op=pref-labels&subop=color-reset&ids="+ + var query = "?op=pref-labels&method=color-reset&ids="+ param_escape(labels.toString()); new Ajax.Request("backend.php", { @@ -1488,7 +1488,7 @@ function editProfiles() { if (ok) { notify_progress("Removing selected profiles...", true); - var query = "?op=rpc&subop=remprofiles&ids="+ + var query = "?op=rpc&method=remprofiles&ids="+ param_escape(sel_rows.toString()); new Ajax.Request("backend.php", { @@ -1514,7 +1514,7 @@ function editProfiles() { if (ok) { notify_progress("Loading, please wait..."); - var query = "?op=rpc&subop=setprofile&id="+ + var query = "?op=rpc&method=setprofile&id="+ param_escape(sel_rows.toString()); new Ajax.Request("backend.php", { @@ -1532,7 +1532,7 @@ function editProfiles() { if (this.validate()) { notify_progress("Creating profile...", true); - var query = "?op=rpc&subop=addprofile&title=" + + var query = "?op=rpc&method=addprofile&title=" + param_escape(dialog.attr('value').newprofile); new Ajax.Request("backend.php", { @@ -1567,7 +1567,7 @@ function activatePrefProfile() { if (ok) { notify_progress("Loading, please wait..."); - var query = "?op=rpc&subop=setprofile&id="+ + var query = "?op=rpc&method=setprofile&id="+ param_escape(sel_rows.toString()); new Ajax.Request("backend.php", { @@ -1591,7 +1591,7 @@ function clearFeedAccessKeys() { if (ok) { notify_progress("Clearing URLs..."); - var query = "?op=rpc&subop=clearKeys"; + var query = "?op=rpc&method=clearKeys"; new Ajax.Request("backend.php", { parameters: query, @@ -1610,7 +1610,7 @@ function clearArticleAccessKeys() { if (ok) { notify_progress("Clearing URLs..."); - var query = "?op=rpc&subop=clearArticleKeys"; + var query = "?op=rpc&method=clearArticleKeys"; new Ajax.Request("backend.php", { parameters: query, @@ -1626,7 +1626,7 @@ function resetFeedOrder() { notify_progress("Loading, please wait..."); new Ajax.Request("backend.php", { - parameters: "?op=pref-feeds&subop=feedsortreset", + parameters: "?op=pref-feeds&method=feedsortreset", onComplete: function(transport) { updateFeedList(); } }); @@ -1642,7 +1642,7 @@ function resetCatOrder() { notify_progress("Loading, please wait..."); new Ajax.Request("backend.php", { - parameters: "?op=pref-feeds&subop=catsortreset", + parameters: "?op=pref-feeds&method=catsortreset", onComplete: function(transport) { updateFeedList(); } }); @@ -1664,7 +1664,7 @@ function editCat(id, item, event) { new Ajax.Request("backend.php", { parameters: { op: 'pref-feeds', - subop: 'renamecat', + method: 'renamecat', id: id, title: new_name, }, @@ -1680,7 +1680,7 @@ function editCat(id, item, event) { function editLabel(id, event) { try { - var query = "backend.php?op=pref-labels&subop=edit&id=" + + var query = "backend.php?op=pref-labels&method=edit&id=" + param_escape(id); if (dijit.byId("labelEditDlg")) @@ -1705,7 +1705,7 @@ function editLabel(id, event) { color = bg; } - var query = "?op=pref-labels&subop=color-set&kind="+kind+ + var query = "?op=pref-labels&method=color-set&kind="+kind+ "&ids=" + param_escape(id) + "&fg=" + param_escape(fg) + "&bg=" + param_escape(bg) + "&color=" + param_escape(color); @@ -1756,7 +1756,7 @@ function clearTwitterCredentials() { if (ok) { notify_progress("Clearing credentials..."); - var query = "?op=pref-feeds&subop=remtwitterinfo"; + var query = "?op=pref-feeds&method=remtwitterinfo"; new Ajax.Request("backend.php", { parameters: query, @@ -1826,7 +1826,7 @@ function addInstance() { style: "width: 600px", regenKey: function() { new Ajax.Request("backend.php", { - parameters: "?op=rpc&subop=genHash", + parameters: "?op=rpc&method=genHash", onComplete: function(transport) { var reply = JSON.parse(transport.responseText); if (reply) @@ -1865,7 +1865,7 @@ function editInstance(id, event) { selectTableRows('prefInstanceList', 'none'); selectTableRowById('LIRR-'+id, 'LICHK-'+id, true); - var query = "backend.php?op=pref-instances&subop=edit&id=" + + var query = "backend.php?op=pref-instances&method=edit&id=" + param_escape(id); if (dijit.byId("instanceEditDlg")) @@ -1877,7 +1877,7 @@ function editInstance(id, event) { style: "width: 600px", regenKey: function() { new Ajax.Request("backend.php", { - parameters: "?op=rpc&subop=genHash", + parameters: "?op=rpc&method=genHash", onComplete: function(transport) { var reply = JSON.parse(transport.responseText); if (reply) @@ -1927,7 +1927,7 @@ function removeSelectedInstances() { if (ok) { notify_progress("Removing selected instances..."); - var query = "?op=pref-instances&subop=remove&ids="+ + var query = "?op=pref-instances&method=remove&ids="+ param_escape(sel_rows.toString()); new Ajax.Request("backend.php", { diff --git a/js/tt-rss.js b/js/tt-rss.js index 58909195..96147b3d 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -82,7 +82,7 @@ function updateFeedList() { var cat_id = id.substr(id.indexOf(":")+1); new Ajax.Request("backend.php", - { parameters: "backend.php?op=feeds&subop=collapse&cid=" + + { parameters: "backend.php?op=feeds&method=collapse&cid=" + param_escape(cat_id) + "&mode=0" } ); }, onClose: function (item, node) { @@ -90,7 +90,7 @@ function updateFeedList() { var cat_id = id.substr(id.indexOf(":")+1); new Ajax.Request("backend.php", - { parameters: "backend.php?op=feeds&subop=collapse&cid=" + + { parameters: "backend.php?op=feeds&method=collapse&cid=" + param_escape(cat_id) + "&mode=1" } ); }, @@ -148,7 +148,7 @@ function catchupAllFeeds() { if (getInitParam("confirm_feed_catchup") != 1 || confirm(str)) { - var query_str = "backend.php?op=feeds&subop=catchupAll"; + var query_str = "backend.php?op=feeds&method=catchupAll"; notify_progress("Marking all feeds as read..."); @@ -165,10 +165,10 @@ function catchupAllFeeds() { } } -function viewCurrentFeed(subop) { +function viewCurrentFeed(method) { if (getActiveFeedId() != undefined) { - viewfeed(getActiveFeedId(), subop, activeFeedIsCat()); + viewfeed(getActiveFeedId(), method, activeFeedIsCat()); } return false; // block unneeded form submits } @@ -186,7 +186,7 @@ function timeout() { window.clearTimeout(counter_timeout_id); - var query_str = "?op=rpc&subop=getAllCounters&seq=" + next_seq(); + var query_str = "?op=rpc&method=getAllCounters&seq=" + next_seq(); var omode; @@ -302,7 +302,7 @@ function init() { var hasAudio = !!((myAudioTag = document.createElement('audio')).canPlayType); new Ajax.Request("backend.php", { - parameters: {op: "rpc", subop: "sanityCheck", hasAudio: hasAudio}, + parameters: {op: "rpc", method: "sanityCheck", hasAudio: hasAudio}, onComplete: function(transport) { backend_sanity_check_callback(transport); } }); @@ -454,7 +454,7 @@ function toggleDispRead() { hideOrShowFeeds(hide); - var query = "?op=rpc&subop=setpref&key=HIDE_READ_FEEDS&value=" + + var query = "?op=rpc&method=setpref&key=HIDE_READ_FEEDS&value=" + param_escape(hide); setInitParam("hide_read_feeds", hide); @@ -555,7 +555,7 @@ function collapse_feedlist() { dijit.byId("main").resize(); - query = "?op=rpc&subop=setpref&key=_COLLAPSED_FEEDLIST&value=true"; + query = "?op=rpc&method=setpref&key=_COLLAPSED_FEEDLIST&value=true"; new Ajax.Request("backend.php", { parameters: query }); } catch (e) { @@ -577,7 +577,7 @@ function viewLimitChanged() { var pr = prompt(__("Assign score to article:"), score); if (pr != undefined) { - var query = "?op=rpc&subop=setScore&id=" + id + "&score=" + pr; + var query = "?op=rpc&method=setScore&id=" + id + "&score=" + pr; new Ajax.Request("backend.php", { parameters: query, @@ -611,7 +611,7 @@ function rescoreCurrentFeed() { if (confirm(pr)) { notify_progress("Rescoring articles..."); - var query = "?op=pref-feeds&subop=rescore&quiet=1&ids=" + actid; + var query = "?op=pref-feeds&method=rescore&quiet=1&ids=" + actid; new Ajax.Request("backend.php", { parameters: query, @@ -1024,7 +1024,7 @@ function inPreferences() { function reverseHeadlineOrder() { try { - var query_str = "?op=rpc&subop=togglepref&key=REVERSE_HEADLINES"; + var query_str = "?op=rpc&method=togglepref&key=REVERSE_HEADLINES"; new Ajax.Request("backend.php", { parameters: query_str, @@ -1049,7 +1049,7 @@ function scheduleFeedUpdate(id, is_cat) { return; } - var query = "?op=rpc&subop=scheduleFeedUpdate&id=" + + var query = "?op=rpc&method=scheduleFeedUpdate&id=" + param_escape(id) + "&is_cat=" + param_escape(is_cat); diff --git a/js/viewfeed.js b/js/viewfeed.js index 9cb90231..363121b1 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -406,7 +406,7 @@ function view(id) { function toggleMark(id, client_only) { try { - var query = "?op=rpc&id=" + id + "&subop=mark"; + var query = "?op=rpc&id=" + id + "&method=mark"; var img = $("FMPIC-" + id); @@ -440,7 +440,7 @@ function toggleMark(id, client_only) { function togglePub(id, client_only, no_effects, note) { try { - var query = "?op=rpc&id=" + id + "&subop=publ"; + var query = "?op=rpc&id=" + id + "&method=publ"; if (note != undefined) { query = query + "¬e=" + param_escape(note); @@ -601,7 +601,7 @@ function toggleUnread(id, cmode, effect) { if (cmode == undefined) cmode = 2; - var query = "?op=rpc&subop=catchupSelected" + + var query = "?op=rpc&method=catchupSelected" + "&cmode=" + param_escape(cmode) + "&ids=" + param_escape(id); // notify_progress("Loading, please wait..."); @@ -629,7 +629,7 @@ function selectionRemoveLabel(id, ids) { return; } - var query = "?op=rpc&subop=removeFromLabel&ids=" + + var query = "?op=rpc&method=removeFromLabel&ids=" + param_escape(ids.toString()) + "&lid=" + param_escape(id); console.log(query); @@ -657,7 +657,7 @@ function selectionAssignLabel(id, ids) { return; } - var query = "?op=rpc&subop=assignToLabel&ids=" + + var query = "?op=rpc&method=assignToLabel&ids=" + param_escape(ids.toString()) + "&lid=" + param_escape(id); console.log(query); @@ -717,7 +717,7 @@ function selectionToggleUnread(set_state, callback, no_error) { cmode = "0"; } - var query = "?op=rpc&subop=catchupSelected" + + var query = "?op=rpc&method=catchupSelected" + "&cmode=" + cmode + "&ids=" + param_escape(rows.toString()); notify_progress("Loading, please wait..."); @@ -752,7 +752,7 @@ function selectionToggleMarked() { if (rows.length > 0) { - var query = "?op=rpc&subop=markSelected&ids=" + + var query = "?op=rpc&method=markSelected&ids=" + param_escape(rows.toString()) + "&cmode=2"; new Ajax.Request("backend.php", { @@ -784,7 +784,7 @@ function selectionTogglePublished() { if (rows.length > 0) { - var query = "?op=rpc&subop=publishSelected&ids=" + + var query = "?op=rpc&method=publishSelected&ids=" + param_escape(rows.toString()) + "&cmode=2"; new Ajax.Request("backend.php", { @@ -910,7 +910,7 @@ function deleteSelection() { return; } - query = "?op=rpc&subop=delete&ids=" + param_escape(rows); + query = "?op=rpc&method=delete&ids=" + param_escape(rows); console.log(query); @@ -956,7 +956,7 @@ function archiveSelection() { return; } - query = "?op=rpc&subop="+op+"&ids=" + param_escape(rows); + query = "?op=rpc&method="+op+"&ids=" + param_escape(rows); console.log(query); @@ -1052,7 +1052,7 @@ function editArticleTags(id) { dojo.disconnect(tmph); new Ajax.Autocompleter('tags_str', 'tags_choices', - "backend.php?op=rpc&subop=completeTags", + "backend.php?op=rpc&method=completeTags", { tokens: ',', paramName: "search" }); }); @@ -1141,7 +1141,7 @@ function catchupBatchedArticles() { try { if (catchup_id_batch.length > 0 && !_infscroll_request_sent) { - var query = "?op=rpc&subop=catchupSelected" + + var query = "?op=rpc&method=catchupSelected" + "&cmode=0&ids=" + param_escape(catchup_id_batch.toString()); new Ajax.Request("backend.php", { @@ -1216,7 +1216,7 @@ function catchupRelativeToArticle(below, id) { e.removeClassName("Unread"); } - var query = "?op=rpc&subop=catchupSelected" + + var query = "?op=rpc&method=catchupSelected" + "&cmode=0" + "&ids=" + param_escape(ids_to_mark.toString()); new Ajax.Request("backend.php", { @@ -1275,7 +1275,7 @@ function cdmExpandArticle(id) { $("CWRAP-" + id).innerHTML = "
" + __("Loading, please wait...") + "
"; - var query = "?op=rpc&subop=cdmGetArticle&id=" + param_escape(id); + var query = "?op=rpc&method=cdmGetArticle&id=" + param_escape(id); var neighbor_ids = getRelativePostIds(id); @@ -1386,7 +1386,7 @@ function zoomToArticle(event, id) { } else { - var query = "?op=rpc&subop=getArticles&ids=" + param_escape(id); + var query = "?op=rpc&method=getArticles&ids=" + param_escape(id); notify_progress("Loading, please wait...", true); @@ -1547,7 +1547,7 @@ function emailArticle(id) { dojo.disconnect(tmph); new Ajax.Autocompleter('emailArticleDlg_destination', 'emailArticleDlg_dst_choices', - "backend.php?op=rpc&subop=completeEmails", + "backend.php?op=rpc&method=completeEmails", { tokens: '', paramName: "search" }); }); @@ -1558,7 +1558,7 @@ function emailArticle(id) { document.forms['article_email_form'].destination.focus(); new Ajax.Autocompleter('destination', 'destination_choices', - "backend.php?op=rpc&subop=completeEmails", + "backend.php?op=rpc&method=completeEmails", { tokens: '', paramName: "search" }); }); */ @@ -1685,7 +1685,7 @@ function cdmClicked(event, id) { active_post_id = id; - var query = "?op=rpc&subop=catchupSelected" + + var query = "?op=rpc&method=catchupSelected" + "&cmode=0&ids=" + param_escape(id); new Ajax.Request("backend.php", { @@ -1996,7 +1996,7 @@ function initHeadlinesMenu() { function tweetArticle(id) { try { - var query = "?op=rpc&subop=getTweetInfo&id=" + param_escape(id); + var query = "?op=rpc&method=getTweetInfo&id=" + param_escape(id); console.log(query); diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php index 34adc8f9..34135348 100644 --- a/modules/backend-rpc.php +++ b/modules/backend-rpc.php @@ -1,11 +1,11 @@ ", $_REQUEST['value']); $key = db_escape_string($_REQUEST["key"]); @@ -147,7 +147,7 @@ return; } - if ($subop == "mark") { + if ($method == "mark") { $mark = $_REQUEST["mark"]; $id = db_escape_string($_REQUEST["id"]); @@ -164,7 +164,7 @@ return; } - if ($subop == "delete") { + if ($method == "delete") { $ids = db_escape_string($_REQUEST["ids"]); $result = db_query($link, "DELETE FROM ttrss_user_entries @@ -174,7 +174,7 @@ return; } - if ($subop == "unarchive") { + if ($method == "unarchive") { $ids = db_escape_string($_REQUEST["ids"]); $result = db_query($link, "UPDATE ttrss_user_entries @@ -185,7 +185,7 @@ return; } - if ($subop == "archive") { + if ($method == "archive") { $ids = explode(",", db_escape_string($_REQUEST["ids"])); foreach ($ids as $id) { @@ -196,7 +196,7 @@ return; } - if ($subop == "publ") { + if ($method == "publ") { $pub = $_REQUEST["pub"]; $id = db_escape_string($_REQUEST["id"]); $note = trim(strip_tags(db_escape_string($_REQUEST["note"]))); @@ -229,13 +229,13 @@ } // Silent - /* if ($subop == "update") { + /* if ($method == "update") { $feed_id = db_escape_string($_REQUEST["feed"]); update_rss_feed($link, $feed_id); return; } */ - if ($subop == "updateAllFeeds" || $subop == "getAllCounters") { + if ($method == "updateAllFeeds" || $method == "getAllCounters") { $last_article_id = (int) $_REQUEST["last_article_id"]; $reply = array(); @@ -259,7 +259,7 @@ } /* GET["cmode"] = 0 - mark as read, 1 - as unread, 2 - toggle */ - if ($subop == "catchupSelected") { + if ($method == "catchupSelected") { $ids = explode(",", db_escape_string($_REQUEST["ids"])); $cmode = sprintf("%d", $_REQUEST["cmode"]); @@ -269,7 +269,7 @@ return; } - if ($subop == "markSelected") { + if ($method == "markSelected") { $ids = explode(",", db_escape_string($_REQUEST["ids"])); $cmode = sprintf("%d", $_REQUEST["cmode"]); @@ -279,7 +279,7 @@ return; } - if ($subop == "publishSelected") { + if ($method == "publishSelected") { $ids = explode(",", db_escape_string($_REQUEST["ids"])); $cmode = sprintf("%d", $_REQUEST["cmode"]); @@ -289,7 +289,7 @@ return; } - if ($subop == "sanityCheck") { + if ($method == "sanityCheck") { $_SESSION["hasAudio"] = $_REQUEST["hasAudio"] === "true"; $reply = array(); @@ -305,7 +305,7 @@ return; } - if ($subop == "setArticleTags") { + if ($method == "setArticleTags") { global $memcache; $id = db_escape_string($_REQUEST["id"]); @@ -377,7 +377,7 @@ return; } - if ($subop == "regenOPMLKey") { + if ($method == "regenOPMLKey") { update_feed_access_key($link, 'OPML:Publish', false, $_SESSION["uid"]); @@ -387,7 +387,7 @@ return; } - if ($subop == "completeTags") { + if ($method == "completeTags") { $search = db_escape_string($_REQUEST["search"]); $result = db_query($link, "SELECT DISTINCT tag_name FROM ttrss_tags @@ -404,7 +404,7 @@ return; } - if ($subop == "purge") { + if ($method == "purge") { $ids = explode(",", db_escape_string($_REQUEST["ids"])); $days = sprintf("%d", $_REQUEST["days"]); @@ -421,7 +421,7 @@ return; } -/* if ($subop == "setScore") { +/* if ($method == "setScore") { $id = db_escape_string($_REQUEST["id"]); $score = sprintf("%d", $_REQUEST["score"]); @@ -434,7 +434,7 @@ } */ - if ($subop == "getArticles") { + if ($method == "getArticles") { $ids = explode(",", db_escape_string($_REQUEST["ids"])); $articles = array(); @@ -448,7 +448,7 @@ return; } - if ($subop == "checkDate") { + if ($method == "checkDate") { $date = db_escape_string($_REQUEST["date"]); $date_parsed = strtotime($date); @@ -457,7 +457,7 @@ return; } - if ($subop == "assignToLabel" || $subop == "removeFromLabel") { + if ($method == "assignToLabel" || $method == "removeFromLabel") { $reply = array(); $ids = explode(",", db_escape_string($_REQUEST["ids"])); @@ -472,7 +472,7 @@ foreach ($ids as $id) { - if ($subop == "assignToLabel") + if ($method == "assignToLabel") label_add_article($link, $id, $label, $_SESSION["uid"]); else label_remove_article($link, $id, $label, $_SESSION["uid"]); @@ -492,7 +492,7 @@ return; } - if ($subop == "updateFeedBrowser") { + if ($method == "updateFeedBrowser") { $search = db_escape_string($_REQUEST["search"]); $limit = db_escape_string($_REQUEST["limit"]); $mode = (int) db_escape_string($_REQUEST["mode"]); @@ -504,7 +504,7 @@ } // Silent - if ($subop == "massSubscribe") { + if ($method == "massSubscribe") { $payload = json_decode($_REQUEST["payload"], false); $mode = $_REQUEST["mode"]; @@ -592,7 +592,7 @@ return; } - if ($subop == "digest-get-contents") { + if ($method == "digest-get-contents") { $article_id = db_escape_string($_REQUEST['article_id']); $result = db_query($link, "SELECT content,title,link,marked,published @@ -614,7 +614,7 @@ return; } - if ($subop == "digest-update") { + if ($method == "digest-update") { $feed_id = db_escape_string($_REQUEST['feed_id']); $offset = db_escape_string($_REQUEST['offset']); $seq = db_escape_string($_REQUEST['seq']); @@ -640,7 +640,7 @@ return; } - if ($subop == "digest-init") { + if ($method == "digest-init") { $tmp_feeds = api_get_feeds($link, -4, true, false, 0); $feeds = array(); @@ -654,7 +654,7 @@ return; } - if ($subop == "catchupFeed") { + if ($method == "catchupFeed") { $feed_id = db_escape_string($_REQUEST['feed_id']); $is_cat = db_escape_string($_REQUEST['is_cat']) == "true"; @@ -664,7 +664,7 @@ return; } - if ($subop == "sendEmail") { + if ($method == "sendEmail") { $secretkey = $_REQUEST['secretkey']; require_once 'lib/phpmailer/class.phpmailer.php'; @@ -723,7 +723,7 @@ return; } - if ($subop == "completeEmails") { + if ($method == "completeEmails") { $search = db_escape_string($_REQUEST["search"]); print "