| | |
| | | rcmail.add_element(tab, 'tabs'); |
| | | } |
| | | |
| | | if (rcmail.env.task == 'mail' || rcmail.env.action.indexOf('plugin.managesieve') != -1) { |
| | | if (rcmail.env.task == 'mail' || rcmail.env.action.startsWith('plugin.managesieve')) { |
| | | // Create layer for form tips |
| | | if (!rcmail.env.framed) { |
| | | rcmail.env.ms_tip_layer = $('<div id="managesieve-tip" class="popupmenu"></div>'); |
| | |
| | | rcmail.register_command('plugin.managesieve-setact', function() { rcmail.managesieve_setact() }); |
| | | rcmail.register_command('plugin.managesieve-setget', function() { rcmail.managesieve_setget() }); |
| | | |
| | | if (rcmail.env.action == 'plugin.managesieve' || rcmail.env.action == 'plugin.managesieve-save') { |
| | | if (rcmail.env.action.startsWith('plugin.managesieve')) { |
| | | if (rcmail.gui_objects.sieveform) { |
| | | rcmail.enable_command('plugin.managesieve-save', true); |
| | | |
| | |
| | | var id = this.filters_list.get_single_selection(); |
| | | if (confirm(this.get_label('managesieve.filterdeleteconfirm'))) { |
| | | var lock = this.set_busy(true, 'loading'); |
| | | this.http_post('plugin.managesieve', |
| | | this.http_post('plugin.managesieve-action', |
| | | '_act=delete&_fid='+this.filters_list.rows[id].uid, lock); |
| | | } |
| | | }; |
| | |
| | | var id = this.filters_list.get_single_selection(), |
| | | lock = this.set_busy(true, 'loading'); |
| | | |
| | | this.http_post('plugin.managesieve', |
| | | this.http_post('plugin.managesieve-action', |
| | | '_act=act&_fid='+this.filters_list.rows[id].uid, lock); |
| | | }; |
| | | |
| | |
| | | this.show_contentframe(false); |
| | | this.filters_list.clear(true); |
| | | this.enable_command('plugin.managesieve-setdel', list.rowcount > 1); |
| | | this.enable_command( 'plugin.managesieve-setact', 'plugin.managesieve-setget', true); |
| | | this.enable_command('plugin.managesieve-setact', 'plugin.managesieve-setget', true); |
| | | |
| | | var id = list.get_single_selection(); |
| | | if (id != null) |
| | |
| | | { |
| | | var lock = this.set_busy(true, 'loading'); |
| | | |
| | | this.http_post('plugin.managesieve', '_act=list&_set='+urlencode(script), lock); |
| | | this.http_post('plugin.managesieve-action', '_act=list&_set='+urlencode(script), lock); |
| | | }; |
| | | |
| | | // Script download request |
| | |
| | | var id = this.filtersets_list.get_single_selection(), |
| | | script = this.env.filtersets[id]; |
| | | |
| | | location.href = this.env.comm_path+'&_action=plugin.managesieve&_act=setget&_set='+urlencode(script); |
| | | location.href = this.env.comm_path+'&_action=plugin.managesieve-action&_act=setget&_set='+urlencode(script); |
| | | }; |
| | | |
| | | // Set activate/deactivate request |
| | |
| | | script = this.env.filtersets[id], |
| | | action = $('#rcmrow'+id).hasClass('disabled') ? 'setact' : 'deact'; |
| | | |
| | | this.http_post('plugin.managesieve', '_act='+action+'&_set='+urlencode(script), lock); |
| | | this.http_post('plugin.managesieve-action', '_act='+action+'&_set='+urlencode(script), lock); |
| | | }; |
| | | |
| | | // Set delete request |
| | |
| | | lock = this.set_busy(true, 'loading'), |
| | | script = this.env.filtersets[id]; |
| | | |
| | | this.http_post('plugin.managesieve', '_act=setdel&_set='+urlencode(script), lock); |
| | | this.http_post('plugin.managesieve-action', '_act=setdel&_set='+urlencode(script), lock); |
| | | }; |
| | | |
| | | // Set add request |
| | |
| | | if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) { |
| | | var lock = this.set_busy(true, 'loading'); |
| | | target = window.frames[this.env.contentframe]; |
| | | target.location.href = this.env.comm_path+'&_action=plugin.managesieve&_framed=1&_newset=1&_unlock='+lock; |
| | | target.location.href = this.env.comm_path+'&_action=plugin.managesieve-action&_framed=1&_newset=1&_unlock='+lock; |
| | | } |
| | | }; |
| | | |
| | |
| | | if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) { |
| | | target = window.frames[this.env.contentframe]; |
| | | var msgid = this.set_busy(true, 'loading'); |
| | | target.location.href = this.env.comm_path+'&_action=plugin.managesieve&_framed=1' |
| | | target.location.href = this.env.comm_path+'&_action=plugin.managesieve-action&_framed=1' |
| | | +(has_id ? '&_fid='+id : '')+'&_unlock='+msgid; |
| | | } |
| | | }; |
| | |
| | | var lock = this.set_busy(true, 'loading'); |
| | | |
| | | this.show_contentframe(false); |
| | | this.http_post('plugin.managesieve', '_act=move&_fid='+this.drag_filter |
| | | this.http_post('plugin.managesieve-action', '_act=move&_fid='+this.drag_filter |
| | | +'&_to='+this.drag_filter_target, lock); |
| | | } |
| | | this.drag_active = false; |
| | |
| | | // Operations on filters form |
| | | rcube_webmail.prototype.managesieve_ruleadd = function(id) |
| | | { |
| | | this.http_post('plugin.managesieve', '_act=ruleadd&_rid='+id); |
| | | this.http_post('plugin.managesieve-action', '_act=ruleadd&_rid='+id); |
| | | }; |
| | | |
| | | rcube_webmail.prototype.managesieve_rulefill = function(content, id, after) |
| | |
| | | |
| | | rcube_webmail.prototype.managesieve_actionadd = function(id) |
| | | { |
| | | this.http_post('plugin.managesieve', '_act=actionadd&_aid='+id); |
| | | this.http_post('plugin.managesieve-action', '_act=actionadd&_aid='+id); |
| | | }; |
| | | |
| | | rcube_webmail.prototype.managesieve_actionfill = function(content, id, after) |