-function selectionAssignLabel(id, ids) {
- try {
-
- if (!ids) ids = getSelectedArticleIds2();
-
- if (ids.length == 0) {
- alert(__("No articles are selected."));
- return;
- }
-
- var query = "?op=article&method=assignToLabel&ids=" +
- param_escape(ids.toString()) + "&lid=" + param_escape(id);
-
- console.log(query);
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- handle_rpc_json(transport);
- show_labels_in_headlines(transport);
- } });
-
- } catch (e) {
- exception_error("selectionAssignLabel", e);
-
- }
-}
-
-function selectionToggleUnread(set_state, callback, no_error, ids) {
- try {
- var rows = ids ? ids : getSelectedArticleIds2();
-
- if (rows.length == 0 && !no_error) {
- alert(__("No articles are selected."));
- return;
- }
-
- for (var i = 0; i < rows.length; i++) {
- var row = $("RROW-" + rows[i]);
- if (row) {
- if (set_state == undefined) {
- if (row.hasClassName("Unread")) {
- row.removeClassName("Unread");
- } else {
- row.addClassName("Unread");
- }
- }
-
- if (set_state == false) {
- row.removeClassName("Unread");
- }
-
- if (set_state == true) {
- row.addClassName("Unread");
- }
- }
- }
-
- if (rows.length > 0) {
-
- var cmode = "";
-
- if (set_state == undefined) {
- cmode = "2";
- } else if (set_state == true) {
- cmode = "1";
- } else if (set_state == false) {
- cmode = "0";
- }
-
- var query = "?op=rpc&method=catchupSelected" +
- "&cmode=" + cmode + "&ids=" + param_escape(rows.toString());
-
- notify_progress("Loading, please wait...");
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- handle_rpc_json(transport);
- if (callback) callback(transport);
- } });
-
- }
-
- } catch (e) {
- exception_error("selectionToggleUnread", e);
- }
-}
-