You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.4 KiB
JavaScript
62 lines
1.4 KiB
JavaScript
13 years ago
|
function emailArticle(id) {
|
||
|
try {
|
||
|
if (!id) {
|
||
|
var ids = getSelectedArticleIds2();
|
||
|
|
||
|
if (ids.length == 0) {
|
||
|
alert(__("No articles are selected."));
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
id = ids.toString();
|
||
|
}
|
||
|
|
||
|
if (dijit.byId("emailArticleDlg"))
|
||
|
dijit.byId("emailArticleDlg").destroyRecursive();
|
||
|
|
||
12 years ago
|
var query = "backend.php?op=pluginhandler&plugin=mail&method=emailArticle¶m=" + param_escape(id);
|
||
13 years ago
|
|
||
|
dialog = new dijit.Dialog({
|
||
|
id: "emailArticleDlg",
|
||
|
title: __("Forward article by email"),
|
||
|
style: "width: 600px",
|
||
|
execute: function() {
|
||
|
if (this.validate()) {
|
||
|
|
||
|
new Ajax.Request("backend.php", {
|
||
|
parameters: dojo.objectToQuery(this.attr('value')),
|
||
|
onComplete: function(transport) {
|
||
|
|
||
|
var reply = JSON.parse(transport.responseText);
|
||
|
|
||
|
var error = reply['error'];
|
||
|
|
||
|
if (error) {
|
||
|
alert(__('Error sending email:') + ' ' + error);
|
||
|
} else {
|
||
|
notify_info('Your message has been sent.');
|
||
|
dialog.hide();
|
||
|
}
|
||
|
|
||
|
} });
|
||
|
}
|
||
|
},
|
||
|
href: query});
|
||
|
|
||
|
var tmph = dojo.connect(dialog, 'onLoad', function() {
|
||
|
dojo.disconnect(tmph);
|
||
|
|
||
|
new Ajax.Autocompleter('emailArticleDlg_destination', 'emailArticleDlg_dst_choices',
|
||
12 years ago
|
"backend.php?op=pluginhandler&plugin=mail&method=completeEmails",
|
||
13 years ago
|
{ tokens: '', paramName: "search" });
|
||
|
});
|
||
|
|
||
|
dialog.show();
|
||
|
|
||
|
} catch (e) {
|
||
|
exception_error("emailArticle", e);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|