source: tapas/web/resources/templates/templateBackoffice_script.jsp @ 409

Last change on this file since 409 was 409, checked in by vmipsl, 12 years ago

backoffice

File size: 2.8 KB
Line 
1<script type="text/javascript">
2    var InterfaceTemplate = Class.create( {
3
4        initialize: function()
5        {
6            /** *********** CONTAINERS *********** **/
7            this.containerTitle = $( "#title" );
8            this.containerTools = $( "#tools" );
9            this.containerLogin = $( "#loginModule" );
10            this.containerMenu = $( "#menuBO" );
11
12            /** *********** VARIABLES *********** **/
13            <%--this.isLanguageFr = <%=Context.getLangue(request).equals( "fr" )%>;--%>
14            this.path = "<%=request.getContextPath()%>";
15            <%--this.webmaster = "<%=Context.getWebmaster(request)%>";--%>
16            <%--this.relativePageUri = <%=request.getQueryString() != null%> ? "<%=Context.getRelativePath( request )%>?<%=request.getQueryString()%>" : "<%=Context.getRelativePageURI(request)%>";--%>
17            <%--this.jSONUser = <%=Context.getJSONUser( request )%> ? <%=Context.getJSONUser( request )%> : false;--%>
18
19            /** ************ CREATE ************ **/
20            this.createTitleTools();
21            this.createMenu();
22        },
23
24        // CREATES ********************************************************
25        createTitleTools: function()
26        {
27            this.containerTitle.addClass( "containerTitle" );
28            this.containerTitle.html( templateTexts["bo.fulltitle"] );
29
30            this.createLogin();
31
32            var interfaceButton = new Button( {value:templateTexts["bo.site"], parent:this.containerTools, id:"button_interface", className: "gray_button", classNameText:"blue_button_text", onClick:this.onClickMegapoli} );
33            var homeButton = new Button( {value:templateTexts["app.home"], parent:this.containerTools, id:"button_home", className: "gray_button", classNameText:"blue_button_text", onClick:this.onClickHome} );
34        },
35
36        createLogin: function()
37        {
38            var buttonLogin = new LoginButton( { parent:this.containerLogin, urlLogin:"project?methodName=login", urlLogout:"project?methodName=logout", classNameToAdd:"gray" } );
39            buttonLogin.setJSONUser( this.jSONUser );
40            buttonLogin.display();
41        },
42
43        createMenu: function()
44        {
45            var usersButton = new Button( {value:templateTexts["bo.user"], parent:this.containerMenu, id:"button_home", className: "gray_button", classNameText:"blue_button_text", onClick:this.onClickUser} );
46        },
47
48        // EVENTS ********************************************************
49        onClickHome: function()
50        {
51            document.location.href = "backoffice?methodName=home";
52        },
53
54        onClickMegapoli: function()
55        {
56            document.location.href = "index.jsp";
57        },
58
59        onClickUser: function()
60        {
61            document.location.href = "backoffice?methodName=viewUser";
62        }
63
64    } );
65
66</script>
Note: See TracBrowser for help on using the repository browser.