/* * Copyright (C) 2009 SUN Area Technical Institute */ Ext.ns("Sun.CMS.Directory");Sun.CMS.Directory.EmailWindow=function(a){if(!a){a={}}this.toName=a.toName;this.toAddress=a.toAddress;this.toId=a.toId;this.form=new Ext.form.FormPanel({bodyStyle:{padding:"10px"},defaults:{width:200,anchor:"-30",xtype:"textfield"},items:[{id:"to_id",name:"to_id",value:this.toId,xtype:"hidden"},{id:"subject",name:"subject",fieldLabel:"Subject"},{id:"reply_name",name:"reply_name",fieldLabel:"Your Name"},{id:"reply_email",name:"reply_email",fieldLabel:"Your Email"},{id:"message",name:"message",fieldLabel:"Your Message",xtype:"textarea",height:300}]});this.send=function(){this.form.getForm().submit({url:"/cms/directory/send/",params:{format:"json"},success:function(){alert("Your message has been sent.");this.close()},scope:this})};Sun.CMS.Directory.EmailWindow.superclass.constructor.call(this,Ext.apply({title:"Email "+this.toName,height:500,width:500,modal:true,buttons:[{text:"Send",listeners:{click:{fn:this.send,scope:this}}},{text:"Cancel",listeners:{click:{scope:this,fn:function(){this.close()}}}}],layout:"fit",items:[this.form]},a))};Ext.extend(Sun.CMS.Directory.EmailWindow,Ext.Window);Sun.CMS.Directory.EmailUser=function(c,b,a){w=new Sun.CMS.Directory.EmailWindow({toName:b,toId:c,toAddress:a});w.show(Ext.getBody())};