Ext.namespace("Ext.ux");Ext.ux.LoginBox=Ext.extend(Ext.form.FormPanel,{initComponent:function(){this.toolBar=new Ext.Toolbar({scope:this,items:[{xtype:"button",text:this.btnLogin,id:"login-btn",scope:this,handler:function(){this.submitForm('http://www.eco-conception.fr/index.php/login.html',true)}}]});var a={title:this.title,frame:true,bodyStyle:"padding:5px 5px 0",autoWidth:true,autoHeight:true,labelWidth:75,defaults:{anchor:"100%"},defaultType:"textfield",scope:this,items:[{xtype:"textfield",vtype:"email",hideLabel:true,fieldLabel:this.labelField1,name:"login",emptyText:this.emptyTextField1,id:"lb-login",allowBlank:false},{xtype:"textfield",scope:this,hideLabel:true,enableKeyEvents:true,fieldLabel:this.labelField1,name:"passwd",id:"lb-passwd",inputType:"password",emptyText:this.emptyTextField2,listeners:{scope:this,keyup:function(b,c){if(c.getKey()==13){this.submitForm('http://www.eco-conception.fr/index.php/login.html',true)}}}}]};if(this.userId==""){this.bbar=this.toolBar;this.html='<span align="right" style="margin:5px 0 10px 0"><a href="#" onclick="new Ext.ux.FortgotPasswordBox().show();" >'+this.btnFPassword+'</a></span><span align="right" style="margin: 5px 0px 10px 10px"><a href="#" onclick="new Ext.ux.RegisterBox().show();">'+this.btnRegister+'</a></span><div style="height:10px">&nbsp;</div>'}Ext.applyIf(this,a);Ext.ux.LoginBox.superclass.initComponent.apply(this,arguments)},submitForm:function(b,a){if(this.form&&this.form.isValid()){this.form.submit({url:b,method:"POST",reset:false,scope:this,failure:function(d,c){Ext.MessageBox.show({title:this.winReturnTitle,msg:c.result.message,buttons:Ext.MessageBox.OK,icon:"ext-mb-error"})},success:function(d,c){document.location.href=" "}})}},onRender:function(){if(this.userId!=""){this.connect(this.firstName,this.lastName,this.lastseen,this.userLevelLabel,this.userId,false)}Ext.ux.LoginBox.superclass.onRender.apply(this,arguments)},connect:function(c,a,d,f,b,e){if(this.items){this.items.each(function(h){this.remove(h)},this)}this.toolBar.setVisible(false);this.setTitle(this.titleConnected+" "+c);var g=clearurl(c+"-"+a)+".html";this.add({html:"<li> "+this.lastConnection+" : "+d+"</li>"});this.add({html:"<li> "+this.level+" : "+f+"</li>"});this.add({html:"<li> "+this.homePage+' : <a href="'+this.siteUrl+this.dirInstalled+"member/"+b+"/"+g+'">'+this.here+"</a> </li>"});this.add({html:'<hr class="clear"><div align="right"> <a id="logged" href="'+this.siteUrl+this.dirInstalled+'logout.html">'+this.logout+"</a></div><br>"});if(e){this.doLayout()}}});Ext.reg("loginbox",Ext.ux.LoginBox);
