[412] | 1 | <%@ page import="com.ether.WebHelper" %> |
---|
[414] | 2 | |
---|
[247] | 3 | <script type="text/javascript"> |
---|
| 4 | var InterfaceTemplate = Class.create( { |
---|
| 5 | |
---|
| 6 | initialize: function() |
---|
| 7 | { |
---|
| 8 | /** *********** CONTAINERS *********** **/ |
---|
| 9 | this.containerTitle = $( "#title" ); |
---|
| 10 | this.containerTools = $( "#tools" ); |
---|
[265] | 11 | this.containerLogin = $( "#loginModule" ); |
---|
[267] | 12 | this.containerMenu = $( "#menuBO" ); |
---|
[247] | 13 | |
---|
| 14 | /** *********** VARIABLES *********** **/ |
---|
[433] | 15 | this.webmaster = "<%=WebHelper.getProperty(request, "mail.webmaster")%>"; |
---|
[412] | 16 | this.jSONUser = <%=WebHelper.getJSONUser( request )%> ? <%=WebHelper.getJSONUser( request )%> : false; |
---|
[247] | 17 | |
---|
| 18 | /** ************ CREATE ************ **/ |
---|
| 19 | this.createTitleTools(); |
---|
[265] | 20 | this.createMenu(); |
---|
[247] | 21 | }, |
---|
| 22 | |
---|
| 23 | // CREATES ******************************************************** |
---|
| 24 | createTitleTools: function() |
---|
| 25 | { |
---|
| 26 | this.containerTitle.addClass( "containerTitle" ); |
---|
| 27 | this.containerTitle.html( templateTexts["bo.fulltitle"] ); |
---|
| 28 | |
---|
| 29 | this.createLogin(); |
---|
| 30 | |
---|
[767] | 31 | var interfaceButton = new Button( {value:templateTexts["bo.site"], parent:this.containerTools, id:"button_interface", className: "gray_button", classNameText:"blue_button_text", onClick:this.onClickTapas} ); |
---|
[247] | 32 | var homeButton = new Button( {value:templateTexts["app.home"], parent:this.containerTools, id:"button_home", className: "gray_button", classNameText:"blue_button_text", onClick:this.onClickHome} ); |
---|
| 33 | }, |
---|
| 34 | |
---|
| 35 | createLogin: function() |
---|
| 36 | { |
---|
[413] | 37 | var buttonLogin = new LoginButton( { parent:this.containerLogin, urlLogin:"project?methodName=login", urlLogout:"project?methodName=logout", classNameToAdd:"gray", webmaster: this.webmaster } ); |
---|
[265] | 38 | buttonLogin.setJSONUser( this.jSONUser ); |
---|
| 39 | buttonLogin.display(); |
---|
| 40 | }, |
---|
[247] | 41 | |
---|
[265] | 42 | createMenu: function() |
---|
| 43 | { |
---|
[267] | 44 | var usersButton = new Button( {value:templateTexts["bo.user"], parent:this.containerMenu, id:"button_home", className: "gray_button", classNameText:"blue_button_text", onClick:this.onClickUser} ); |
---|
[247] | 45 | }, |
---|
| 46 | |
---|
| 47 | // EVENTS ******************************************************** |
---|
| 48 | onClickHome: function() |
---|
| 49 | { |
---|
[285] | 50 | document.location.href = "backoffice?methodName=home"; |
---|
[247] | 51 | }, |
---|
| 52 | |
---|
[767] | 53 | onClickTapas: function() |
---|
[305] | 54 | { |
---|
| 55 | document.location.href = "index.jsp"; |
---|
| 56 | }, |
---|
| 57 | |
---|
[267] | 58 | onClickUser: function() |
---|
[247] | 59 | { |
---|
[267] | 60 | document.location.href = "backoffice?methodName=viewUser"; |
---|
[247] | 61 | } |
---|
[267] | 62 | |
---|
[247] | 63 | } ); |
---|
| 64 | |
---|
| 65 | </script> |
---|