1 | <%@ page import="com.ether.WebHelper" %> |
---|
2 | <script type="text/javascript"> |
---|
3 | var InterfaceTemplate = Class.create( { |
---|
4 | |
---|
5 | initialize: function() |
---|
6 | { |
---|
7 | /** *********** CONTAINERS *********** **/ |
---|
8 | this.containerTitle = $( "#title" ); |
---|
9 | this.containerTools = $( "#tools" ); |
---|
10 | this.containerLogin = $( "#loginModule" ); |
---|
11 | this.containerMenu = $( "#menuBO" ); |
---|
12 | |
---|
13 | /** *********** VARIABLES *********** **/ |
---|
14 | this.path = "<%=request.getContextPath()%>"; |
---|
15 | this.webmaster = "rboipsl@ipsl.jussieu.fr"; |
---|
16 | this.jSONUser = <%=WebHelper.getJSONUser( request )%> ? <%=WebHelper.getJSONUser( request )%> : false; |
---|
17 | |
---|
18 | /** ************ CREATE ************ **/ |
---|
19 | this.createTitleTools(); |
---|
20 | this.createMenu(); |
---|
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 | |
---|
31 | var interfaceButton = new Button( {value:templateTexts["bo.site"], parent:this.containerTools, id:"button_interface", className: "gray_button", classNameText:"blue_button_text", onClick:this.onClickMegapoli} ); |
---|
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 | { |
---|
37 | var buttonLogin = new LoginButton( { parent:this.containerLogin, urlLogin:"project?methodName=login", urlLogout:"project?methodName=logout", classNameToAdd:"gray", webmaster: this.webmaster } ); |
---|
38 | buttonLogin.setJSONUser( this.jSONUser ); |
---|
39 | buttonLogin.display(); |
---|
40 | }, |
---|
41 | |
---|
42 | createMenu: function() |
---|
43 | { |
---|
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} ); |
---|
45 | }, |
---|
46 | |
---|
47 | // EVENTS ******************************************************** |
---|
48 | onClickHome: function() |
---|
49 | { |
---|
50 | document.location.href = "backoffice?methodName=home"; |
---|
51 | }, |
---|
52 | |
---|
53 | onClickMegapoli: function() |
---|
54 | { |
---|
55 | document.location.href = "index.jsp"; |
---|
56 | }, |
---|
57 | |
---|
58 | onClickUser: function() |
---|
59 | { |
---|
60 | document.location.href = "backoffice?methodName=viewUser"; |
---|
61 | } |
---|
62 | |
---|
63 | } ); |
---|
64 | |
---|
65 | </script> |
---|