if(obj_manager&&_elems.length>1&&obj_manager.getAllSelected()&&!_action.paste||"readall"==_action.id){if(_confirm){varbuttons=[{text:this.egw.lang("Yes"),id:"all",class:"ui-priority-primary",default:!0},{text:this.egw.lang("Cancel"),id:"cancel"}],messageToDisplay="",actionlabel=_action.id;switch(_action.id){case"readall":messageToDisplay=this.egw.lang("Do you really want to mark ALL messages as read in the current folder?")+" ";break;case"unlabel":messageToDisplay=this.egw.lang("Do you really want to remove ALL labels from ALL messages in the current folder?")+" ";break;case"label1":"label1"==_action.id&&(actionlabel="important");case"label2":"label2"==_action.id&&(actionlabel="job");case"label3":"label3"==_action.id&&(actionlabel="personal");case"label4":"label4"==_action.id&&(actionlabel="to do");case"label5":"label5"==_action.id&&(actionlabel="later");case"flagged":case"read":case"undelete":messageToDisplay=this.egw.lang("Do you really want to toggle flag %1 for ALL messages in the current view?",this.egw.lang(actionlabel))+" ","label"==_action.id.substr(0,5)&&(messageToDisplay=this.egw.lang("Do you really want to toggle label %1 for ALL messages in the current view?",this.egw.lang(actionlabel))+" ");break;default:vartype=null;"move"!=_action.id.substr(0,4)&&"drop_move_mail"!==_action.id||(type="Move"),"copy"!=_action.id.substr(0,4)&&"drop_copy_mail"!==_action.id||(type="Copy"),messageToDisplay=this.egw.lang("Do you really want to apply %1 to ALL messages in the current view?",this.egw.lang(type?type:_action.id))+" "}returnet2_dialog.show_dialog(function(_button_id){varrv=!1;switch(_button_id){case"all":rv=!0;break;case"cancel":rv="cancel"}switch("cancel"!=rv&&that.lock_tree(),_action.id){case"delete":that.mail_callDelete(_action,_elems,rv);break;case"readall":case"unlabel":case"label1":case"label2":case"label3":case"label4":case"label5":case"flagged":case"read":case"undelete":that.mail_callFlagMessages(_action,_elems,rv);break;case"drop_move_mail":that.mail_callMove(_action,_elems,_target,rv);break;case"drop_copy_mail":that.mail_callCopy(_action,_elems,_target,rv);break;default:"move"==_action.id.substr(0,4)&&that.mail_callMove(_action,_elems,_target,rv),"copy"==_action.id.substr(0,4)&&that.mail_callCopy(_action,_elems,_target,rv)}},messageToDisplay,this.egw.lang("Confirm"),_action.id,buttons)}rvMain=!0}switch(_action.id){case"delete":this.mail_callDelete(_action,_elems,rvMain);break;case"unlabel":case"label1":case"label2":case"label3":case"label4":case"label5":case"flagged":case"read":case"undelete":this.mail_callFlagMessages(_action,_elems,rvMain);break;case"drop_move_mail":this.mail_callMove(_action,_elems,_target,rvMain);break;case"drop_copy_mail":this.mail_callCopy(_action,_elems,_target,rvMain);break;default:"move"==_action.id.substr(0,4)&&this.mail_callMove(_action,_elems,_target,rvMain),"copy"==_action.id.substr(0,4)&&this.mail_callCopy(_action,_elems,_target,rvMain)}},mail_doActionCall:function(_action,_elems){},mail_getActiveFilters:function(_action){varobj_manager=egw_getObjectManager(this.appname).getObjectById(this.nm_index);returnobj_manager&&obj_manager.manager&&obj_manager.manager.data&&obj_manager.manager.data.nextmatch&&obj_manager.manager.data.nextmatch.activeFilters?obj_manager.manager.data.nextmatch.activeFilters:!1},mail_flag:function(_action,_elems){this.mail_checkAllSelected(_action,_elems,null,!0)},mail_callFlagMessages:function(_action,_elems,_allMessagesChecked){varfolder="",tree={},formData={},data={msg:[this.et2.getArrayMgr("content").getEntry("mail_id")]||"",all:_allMessagesChecked||!1,popup:egw(window).is_popup()||!1,activeFilters:"readall"==_action.id?!1:this.mail_getActiveFilters(_action)},rowClass=_action.id;switch("undefined"==typeof_elems||0==_elems.length?this.mail_isMainWindow&&this.mail_currentlyFocussed&&(data.msg=[this.mail_currentlyFocussed],_elems=data,data.msg=this.mail_getFormData(_elems).msg):data.msg=this.mail_getFormData(_elems).msg,_action.id){case"read":rowClass="seen",tree=data.popup?opener.etemplate2.getByApplication("mail")[0].widgetContainer.getWidgetById
-1==jQuery.inArray(rights,this.aclCommonRights)&&"lrswipcda"!=rights?aclCommonWidget.set_value("custom"):"lrswipcda"==rights?aclCommonWidget.set_value("aeiklprstwx"):aclCommonWidget.set_value(rights)},edit_sieve:function(_action,_senders){varacc_id=parseInt(_senders[0].id),url=this.egw.link("/index.php",{menuaction:"mail.mail_sieve.index",acc_id:acc_id,ajax:"true"});"undefined"==typeofwindow.framework?this.egw.open_link(url):this.loadIframe(url)},loadIframe:function(_url,_iFrame){varmailSplitter=this.et2.getWidgetById("mail.index.spliter"),quotaipercent=this.et2.getWidgetById("nm[quotainpercent]"),iframe=_iFrame||this.et2.getWidgetById("extra_iframe");if("undefined"!=typeofiframe&&iframe){if(_url&&iframe.set_src(_url),"undefined"!=typeofmailSplitter&&mailSplitter&&"undefined"!=typeofquotaipercent&&(mailSplitter.set_disabled(!!_url),quotaipercent.set_disabled(!!_url),iframe.set_disabled(!_url)),"extra_iframe"==iframe.id){if(egwIsMobile()){varnm=this.et2.getWidgetById(this.nm_index);nm.set_disabled(!!_url),iframe.set_disabled(!_url)}iframe.disabled?iframe.set_class(""):iframe.set_class("mail-index-extra-iframe")}return!0}return!1},edit_vacation:function(_action,_senders){varacc_id=parseInt(_senders[0].id);this.egw.open_link("mail.mail_sieve.editVacation&acc_id="+acc_id,"_blank","700x480")},subscription_refresh:function(_data){console.log(_data)},subscription_apply:function(_egw,_widget){vartree=etemplate2.getByApplication("mail")[0].widgetContainer.getWidgetById("foldertree");tree&&(tree.input._xfullXML=!0,this.subscription_treeLastState=tree.input.serializeTreeToJSON()),this.et2._inst.submit(_widget)},subscription_autoloadingStart:function(_id,_widget){varnode=_widget.input._globalIdStorageFind(_id);if(node&&"undefined"!=typeofnode.htmlNode){varimg=jQuery("img",node.htmlNode)[0];img.src=egw.image("ajax-loader","admin")}return!0},subscription_autoloadingEnd:function(){return!0},edit_subscribe:function(_action,_senders){varacc_id=parseInt(_senders[0].id);this.egw.open_link("mail.mail_ui.subscription&acc_id="+acc_id,"_blank","720x500")},subscribe_folder:function(_action,_senders){varmailbox=_senders[0].id.split("::"),folder=mailbox[1],acc_id=mailbox[0],ftree=this.et2.getWidgetById(this.nm_index+"[foldertree]");this.egw.message(this.egw.lang("Subscribe to Folder %1",ftree.getLabel(_senders[0].id).replace(this._unseen_regexp,""))),egw.json("mail.mail_ui.ajax_foldersubscription",[acc_id,folder,!0]).sendRequest()},unsubscribe_folder:function(_action,_senders){varmailbox=_senders[0].id.split("::"),folder=mailbox[1],acc_id=mailbox[0],ftree=this.et2.getWidgetById(this.nm_index+"[foldertree]");this.egw.message(this.egw.lang("Unsubscribe from Folder %1",ftree.getLabel(_senders[0].id).replace(this._unseen_regexp,""))),egw.json("mail.mail_ui.ajax_foldersubscription",[acc_id,folder,!1]).sendRequest()},subscribe_onclick:function(_id,_widget){_widget.setSubChecked(_id,"toggle")},edit_acl:function(_action,_senders){varmailbox=_senders[0].id.split("::"),folder=mailbox[1]||"INBOX",acc_id=mailbox[0];this.egw.open_link("mail.mail_acl.edit&mailbox="+jQuery.base64Encode(folder)+"&acc_id="+acc_id,"_blank","640x480")},acl_folderChange:function(){varmailbox=this.et2.getWidgetById("mailbox");mailbox&&mailbox.taglist.getValue().length>0&&this.et2._inst.submit()},edit_account:function(_action,_senders){varacc_id=parseInt(_senders[0].id);this.egw.open_link("mail.mail_wizard.edit&acc_id="+acc_id,"_blank","720x500")},compose_fieldExpander_init:function(){varwidgets={cc:{widget:{},jQClass:".mailComposeJQueryCc"},bcc:{widget:{},jQClass:".mailComposeJQueryBcc"},folder:{widget:{},jQClass:".mailComposeJQueryFolder"},replyto:{widget:{},jQClass:".mailComposeJQueryReplyto"}};for(varwidgetinwidgets){varexpanderBtn=widget+"_expander";widgets[widget].widget=this.et2.getWidgetById(widget),widgets[expanderBtn]={widget:this.et2.getWidgetById(expanderBtn)},"undefined"!=typeofwidgets[widget].widget&&"undefined"!=typeofwidgets[expanderBtn].widget&&0==widgets[widget].widget.get_value().length&&(widgets[expanderBtn].widget.set_disabled(!1),jQuery(