Kawai Wiki

Rev

Rev 69 | Rev 72 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 69 Rev 71
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<%@taglib prefix="mtw" uri="http://www.mentaframework.org/tags-mtw/"%>
2
<%@taglib prefix="mtw" uri="http://www.mentaframework.org/tags-mtw/"%>
3
<%@ taglib uri="/WEB-INF/tld/taglib.tld" prefix="k" %>
3
<%@ taglib uri="/WEB-INF/tld/taglib.tld" prefix="k" %>
4
4
5
<html>
5
<html>
6
<head>
6
<head>
7
7
8
<title>Mentawai Web Framework</title>
8
<title>Mentawai Web Framework</title>
9
9
10
<style type="text/css" media="all">
10
<style type="text/css" media="all">
11
@import url("<mtw:contextPath/>/GenerateCSS.getCSS.css");
11
@import url("<mtw:contextPath/>/GenerateCSS.getCSS.css");
12
</style>
12
</style>
13
13
14
<meta http-equiv="imagetoolbar" content="no" />
14
<meta http-equiv="imagetoolbar" content="no" />
15
<meta http-equiv="imagetoolbar" content="false" />
15
<meta http-equiv="imagetoolbar" content="false" />
16
16
17
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
17
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
18
<link rel="icon" type="image/gif" href="/favicon.gif" />
18
<link rel="icon" type="image/gif" href="/favicon.gif" />
19
<link rel="stylesheet" href="<mtw:contextPath/>/GenerateCSS.getPrintCSS.css" type="text/css" media="print" />
19
<link rel="stylesheet" href="<mtw:contextPath/>/GenerateCSS.getPrintCSS.css" type="text/css" media="print" />
20
20
21
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
21
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
22
<meta name="author" content="Sergio Oliveira Junior" />
22
<meta name="author" content="Sergio Oliveira Junior" />
23
<meta name="email" content="sergio.oliveira.jr@gmail.com" />
23
<meta name="email" content="sergio.oliveira.jr@gmail.com" />
24
24
25
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
25
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
26
<script type="text/javascript" src="jquery/jquery-1.6.4.min.js"></script>
26
<script type="text/javascript" src="jquery/jquery-1.6.4.min.js"></script>
27
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
27
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
28
28
29
<script language="JavaScript">
29
<script language="JavaScript">
30
    
30
    
31
        $(document).ready(function() {
31
        $(document).ready(function() {
32
        
32
        
33
        	<mtw:if test="showForm" value="login">
33
        	<mtw:if test="showForm" value="login">
34
				showLoginDialog();
34
				showLoginDialog();
35
			</mtw:if>
35
			</mtw:if>
36
			
36
			
37
			<mtw:if test="showForm" value="add">
37
			<mtw:if test="showForm" value="add">
38
				showCreateNewPageDialog();
38
				showCreateNewPageDialog();
39
			</mtw:if>	
39
			</mtw:if>	
40
			
40
			
41
			$('#loginDialog').keyup(function(e) {
41
			$('#loginDialog').keyup(function(e) {
42
    			if (e.keyCode == 13) {
42
    			if (e.keyCode == 13) {
43
        			$('#loginForm').submit();
43
        			$('#loginForm').submit();
44
    			}
44
    			}
45
			});
45
			});
46
			
46
			
47
47
48
        });
48
        });
49
        
49
        
50
        function prepareEditPageDialog(myDialog, theTitle) {
50
        function prepareEditPageDialog(myDialog, theTitle) {
51
51
52
            options = {
52
            options = {
53
                autoOpen: false,
53
                autoOpen: false,
54
                width: 800,
54
                width: 800,
55
                modal: true,
55
                modal: true,
56
                title: theTitle,
56
                title: theTitle,
57
                buttons: [
57
                buttons: [
58
                          {
58
                          {
59
                                text: "Save",
59
                                text: "Save",
60
                                click: function() { $('#editPageForm').submit(); }
60
                                click: function() { $('#editPageForm').submit(); }
61
                          },
61
                          },
62
                          {
62
                          {
63
                                text: "Preview",
63
                                text: "Preview",
64
                                click: function() { $('#editPagePreview').val('true'); $('#editPageForm').submit(); }
64
                                click: function() { $('#editPagePreview').val('true'); $('#editPageForm').submit(); }
65
                          },                          
65
                          },                          
66
                          {
66
                          {
67
                                text: "Cancel",
67
                                text: "Cancel",
68
                                click: function() { $(this).dialog("close"); }
68
                                click: function() { $(this).dialog("close"); }
69
                          }
69
                          }
70
                      ]
70
                      ]
71
           };
71
           };
72
72
73
          myDialog.dialog(options);
73
          myDialog.dialog(options);
74
74
75
          return myDialog;
75
          return myDialog;
76
        }
76
        }
77
77
78
        function prepareListAllPagesDialog(myDialog) {
78
        function prepareListAllPagesDialog(myDialog) {
79
79
80
            options = {
80
            options = {
81
                autoOpen: false,
81
                autoOpen: false,
82
                width: 800,
82
                width: 800,
83
                height: 450,
83
                height: 450,
84
                modal: true,
84
                modal: true,
85
                title: 'Pages:',
85
                title: 'Pages:',
86
                buttons: [
86
                buttons: [
87
                          {
87
                          {
88
                                text: "FrontPage",
88
                                text: "FrontPage",
89
                                click: function() { $('#listAllPagesForm').attr('action', '<mtw:contextPath/>/Page.setFrontPage.mtw'); $('#listAllPagesForm').submit(); }
89
                                click: function() { $('#listAllPagesForm').attr('action', '<mtw:contextPath/>/Page.setFrontPage.mtw'); $('#listAllPagesForm').submit(); }
90
                          },
90
                          },
91
                          {
91
                          {
92
                                text: "Delete",
92
                                text: "Delete",
93
                                click: function() { $('#listAllPagesForm').attr('action', '<mtw:contextPath/>/Page.delete.mtw'); $('#listAllPagesForm').submit(); }
93
                                click: function() { $('#listAllPagesForm').attr('action', '<mtw:contextPath/>/Page.delete.mtw'); $('#listAllPagesForm').submit(); }
94
                          },
94
                          },
95
                          {
95
                          {
96
                                text: "Close",
96
                                text: "Close",
97
                                click: function() { $(this).dialog("close"); }
97
                                click: function() { $(this).dialog("close"); }
98
                          }
98
                          }
99
                      ]
99
                      ]
100
           };
100
           };
101
101
102
          myDialog.dialog(options);
102
          myDialog.dialog(options);
103
103
104
          return myDialog;
104
          return myDialog;
105
        }
105
        }
106
106
107
        
107
        
108
        function showEditPageDialog(pageName, lang) {
108
        function showEditPageDialog(pageName, lang) {
109
109
110
            $.getJSON('<mtw:contextPath />/Page.get.mtw?name=' + pageName + '&lang=' + lang, function(data) {
110
            $.getJSON('<mtw:contextPath />/Page.get.mtw?name=' + pageName + '&lang=' + lang, function(data) {
111
111
112
                $('#editPageTextArea').val(data.page.body);
112
                $('#editPageTextArea').val(data.page.body);
113
                $('#editPageName').val(data.page.name);
113
                $('#editPageName').val(data.page.name);
114
                $('#editPageLang').val(data.page.lang);
114
                $('#editPageLang').val(data.page.lang);
115
115
116
                myDialog = $('#editPageDialog');
116
                myDialog = $('#editPageDialog');
117
                myDialog = prepareEditPageDialog(myDialog, 'Editing <i><font color="darkblue">' + pageName + "</font></i> in <i>" + data.page.language + "<i>...");
117
                myDialog = prepareEditPageDialog(myDialog, 'Editing <i><font color="darkblue">' + pageName + "</font></i> in <i>" + data.page.language + "<i>...");
118
                myDialog.dialog('open');
118
                myDialog.dialog('open');
119
            });
119
            });
120
            
120
            
121
            return false;
121
            return false;
122
        }
122
        }
123
        
123
        
124
        function showEditPreviewDialog(pageName, lang) {
124
        function showEditPreviewDialog(pageName, lang) {
125
125
126
            $.getJSON('<mtw:contextPath />/Page.getPreview.mtw?name=' + pageName + '&lang=' + lang, function(data) {
126
            $.getJSON('<mtw:contextPath />/Page.getPreview.mtw?name=' + pageName + '&lang=' + lang, function(data) {
127
127
128
                $('#editPageTextArea').val(data.page.body);
128
                $('#editPageTextArea').val(data.page.body);
129
                $('#editPageName').val(data.page.name);
129
                $('#editPageName').val(data.page.name);
130
                $('#editPageLang').val(data.page.lang);
130
                $('#editPageLang').val(data.page.lang);
131
131
132
                myDialog = $('#editPageDialog');
132
                myDialog = $('#editPageDialog');
133
                myDialog = prepareEditPageDialog(myDialog, 'Editing <i><font color="darkblue">' + pageName + "</font></i> in <i>" + data.page.language + "<i>...");
133
                myDialog = prepareEditPageDialog(myDialog, 'Editing <i><font color="darkblue">' + pageName + "</font></i> in <i>" + data.page.language + "<i>...");
134
                myDialog.dialog('open');
134
                myDialog.dialog('open');
135
            });
135
            });
136
            
136
            
137
            return false;
137
            return false;
138
        }
138
        }
139
        
139
        
140
        
140
        
141
       	function showEditPreviewNewPageDialog(pageName, lang) {
141
       	function showEditPreviewNewPageDialog(pageName, lang) {
142
142
143
            $.getJSON('<mtw:contextPath />/Page.getPreview.mtw?name=' + pageName + '&lang=' + lang, function(data) {
143
            $.getJSON('<mtw:contextPath />/Page.getPreview.mtw?name=' + pageName + '&lang=' + lang, function(data) {
144
            
144
            
145
           		$('#createNewPageName').val(data.page.name);
145
           		$('#createNewPageName').val(data.page.name);
146
        		$('#createNewPageTitle').val(data.page.title);
146
        		$('#createNewPageTitle').val(data.page.title);
147
        		$('#createNewPageLanguage').val(data.page.languageId);
147
        		$('#createNewPageLanguage').val(data.page.languageId);
148
        		$('#createNewPageTextArea').val(data.page.body);
148
        		$('#createNewPageTextArea').val(data.page.body);
149
        		$('#createNewPageNameError').text('');
149
        		$('#createNewPageNameError').text('');
150
        		$('#createNewPageTitleError').text('');
150
        		$('#createNewPageTitleError').text('');
151
        		$('#createNewPageLanguageError').text('');
151
        		$('#createNewPageLanguageError').text('');
152
        		$('#createNewPageBodyError').text('');
152
        		$('#createNewPageBodyError').text('');
153
        		$('#createPageLanguageCell').hide();
153
        		$('#createPageLanguageCell').hide();
154
            
154
            
155
				showCreateNewPageDialog();
155
				showCreateNewPageDialog();
156
            });
156
            });
157
            
157
            
158
            return false;
158
            return false;
159
        }
159
        }
160
        
160
        
161
        function showListAllPagesDialog() {
161
        function showListAllPagesDialog() {
162
162
163
            $.getJSON('<mtw:contextPath />/Page.list.mtw', function(data) {
163
            $.getJSON('<mtw:contextPath />/Page.list.mtw', function(data) {
164
164
165
                tableData = '';
165
                tableData = '';
166
                tableData += '<tr>';
166
                tableData += '<tr>';
167
                tableData += '<th>&nbsp;</th>';
167
                tableData += '<th>&nbsp;</th>';
168
                tableData += '<th>Name</th>';
168
                tableData += '<th>Name</th>';
169
                tableData += '<th>Language</th>';
169
                tableData += '<th>Language</th>';
170
                tableData += '<th>Created By</th>';
170
                tableData += '<th>Created By</th>';
171
                tableData += '<th>Modified By</th>';
171
                tableData += '<th>Modified By</th>';
172
                tableData += '<th>&nbsp;</th>';
172
                tableData += '<th>&nbsp;</th>';
173
                tableData += '</tr>';
173
                tableData += '</tr>';
174
174
175
                $.each(data.pages, function(i,page) {
175
                $.each(data.pages, function(i,page) {
176
                
176
                
177
                	pageName = page.name;
177
                	pageName = page.name;
178
178
179
                    modifiedBy = '';
179
                    modifiedBy = '';
180
                    if (page.modifiedById > 0) {
180
                    if (page.modifiedById > 0) {
181
                        modifiedBy = page.modifiedBy.username;
181
                        modifiedBy = page.modifiedBy.username;
182
                    }
182
                    }
183
183
184
                    if (page.systemPage == true) {
184
                    if (page.systemPage == true) {
185
                        pageName = '*' + pageName;
185
                        pageName = '*' + pageName;
186
                    }
186
                    }
187
187
188
                    if (page.frontPage == true) {
188
                    if (page.frontPage == true) {
189
                        pageName = '[' + pageName + ']';
189
                        pageName = '[' + pageName + ']';
190
                    }
190
                    }
191
                    
191
                    
192
                    modifiedOnTitle = '';
192
                    modifiedOnTitle = '';
193
                    if (page.formattedModifiedOn != null) {
193
                    if (page.formattedModifiedOn != null) {
194
                    	modifiedOnTitle = ' title="' + page.formattedModifiedOn + '"';
194
                    	modifiedOnTitle = ' title="' + page.formattedModifiedOn + '"';
195
                    }
195
                    }
196
                    
196
                    
197
                    createdOnTitle = '';
197
                    createdOnTitle = '';
198
                    if (page.formattedCreatedOn != null) {
198
                    if (page.formattedCreatedOn != null) {
199
                    	createdOnTitle = ' title="' + page.formattedCreatedOn + '"';
199
                    	createdOnTitle = ' title="' + page.formattedCreatedOn + '"';
200
                    }
200
                    }
201
                    
201
                    
202
                    radioCell = '&nbsp;';
202
                    radioCell = '&nbsp;';
203
                    viewCell = '&nbsp;';
203
                    viewCell = '&nbsp;';
204
                    if (page.CSS == false && page.systemPage == false) {
204
                    if (page.CSS == false && page.systemPage == false) {
205
                    	viewCell = '<a tabindex="-1" href="<mtw:contextPath/>/Page.mtw?name=' + page.name + '&lang=' + page.lang + '"><img src="<mtw:contextPath/>/images/view.png" /></a>';
205
                    	viewCell = '<a tabindex="-1" href="<mtw:contextPath/>/Page.mtw?name=' + page.name + '&lang=' + page.lang + '"><img src="<mtw:contextPath/>/images/view.png" /></a>';
206
                    	if (page.frontPage == false) {
206
                    	if (page.frontPage == false) {
207
                    		radioCell = '<input tabindex="-1" type="radio" name="pageId" id="pageId" value="' + page.id + '" />';
207
                    		radioCell = '<input tabindex="-1" type="radio" name="pageId" id="pageId" value="' + page.id + '" />';
208
                    	}
208
                    	}
209
                    }
209
                    }
210
                    
210
                    
211
                    nameTitle = '';
211
                    nameTitle = '';
212
                    if (page.title != null && page.title != '') {
212
                    if (page.title != null && page.title != '') {
213
                    	nameTitle = ' title="' + page.title + '"';
213
                    	nameTitle = ' title="' + page.title + '"';
214
                    }
214
                    }
215
215
216
                    tableData += '<tr>';
216
                    tableData += '<tr>';
217
                    tableData += '<td>' + radioCell + '</td>';
217
                    tableData += '<td>' + radioCell + '</td>';
218
                    tableData += '<td' + nameTitle + '>' + pageName + '</td>';
218
                    tableData += '<td' + nameTitle + '>' + pageName + '</td>';
219
                    tableData += '<td align="center">' + page.language + '</td>';
219
                    tableData += '<td align="center">' + page.language + '</td>';
220
                    tableData += '<td align="center"' + createdOnTitle + '>' + page.createdBy.username + '</td>';
220
                    tableData += '<td align="center"' + createdOnTitle + '>' + page.createdBy.username + '</td>';
221
                    tableData += '<td align="center"' + modifiedOnTitle + '>' + modifiedBy + '</td>';
221
                    tableData += '<td align="center"' + modifiedOnTitle + '>' + modifiedBy + '</td>';
222
                    tableData += '<td align="center">' + viewCell + '</td>';
222
                    tableData += '<td align="center">' + viewCell + '</td>';
223
                    tableData += '</tr>';
223
                    tableData += '</tr>';
224
                });
224
                });
225
225
226
                $('#listAllPagesTable').html(tableData);
226
                $('#listAllPagesTable').html(tableData);
227
227
228
                myDialog = $('#listAllPagesDialog');
228
                myDialog = $('#listAllPagesDialog');
229
                myDialog = prepareListAllPagesDialog(myDialog);
229
                myDialog = prepareListAllPagesDialog(myDialog);
230
                myDialog.dialog('open');
230
                myDialog.dialog('open');
231
                $('.ui-dialog :button').blur();
231
                $('.ui-dialog :button').blur();
232
             });
232
             });
233
            
233
            
234
            return false;
234
            return false;
235
        }
235
        }
236
        
236
        
237
       	function showCreateNewPageDialog() {
237
       	function showCreateNewPageDialog() {
238
238
239
            $('#createNewPageFormName').val('<mtw:out value="bodyColumn.name" />');
239
            $('#createNewPageFormName').val('<mtw:out value="bodyColumn.name" />');
240
            $('#createNewPageFormLang').val('<mtw:out value="bodyColumn.lang" />');
240
            $('#createNewPageFormLang').val('<mtw:out value="bodyColumn.lang" />');
241
241
242
            myDialog = $('#createNewPageDialog');
242
            myDialog = $('#createNewPageDialog');
243
            myDialog = prepareCreateNewPageDialog(myDialog);
243
            myDialog = prepareCreateNewPageDialog(myDialog);
244
            myDialog.dialog('open');
244
            myDialog.dialog('open');
245
            
245
            
246
            return false;
246
            return false;
247
        }
247
        }
248
        
248
        
249
        function prepareCreateNewPageDialog(myDialog) {
249
        function prepareCreateNewPageDialog(myDialog) {
250
250
251
            options = {
251
            options = {
252
            	close: function() { clearCreateNewPageForm(); },
252
            	close: function() { clearCreateNewPageForm(); },
253
                autoOpen: false,
253
                autoOpen: false,
254
                width: 800,
254
                width: 800,
255
                modal: true,
255
                modal: true,
256
                title: "Create New Page:",
256
                title: "Create New Page:",
257
                buttons: [
257
                buttons: [
258
                          {
258
                          {
259
                                text: "Create",
259
                                text: "Create",
260
                                click: function() { $('#createNewPageForm').submit(); }
260
                                click: function() { $('#createNewPageForm').submit(); }
261
                          },
261
                          },
262
                          {
262
                          {
263
                              text: "Preview",
263
                              text: "Preview",
264
                              click: function() { $('#createNewPageFormPreview').val('true'); $('#createNewPageForm').submit(); }
264
                              click: function() { $('#createNewPageFormPreview').val('true'); $('#createNewPageForm').submit(); }
265
                          },
265
                          },
266
                          {
266
                          {
267
                                text: "Cancel",
267
                                text: "Cancel",
268
                                click: function() {  $(this).dialog("close"); }
268
                                click: function() {  $(this).dialog("close"); }
269
                          }
269
                          }
270
                      ]
270
                      ]
271
           };
271
           };
272
272
273
          myDialog.dialog(options);
273
          myDialog.dialog(options);
274
274
275
          return myDialog;
275
          return myDialog;
276
        }
276
        }
277
        
277
        
278
    
278
    
279
        function showLoginDialog() {
279
        function showLoginDialog() {
280
280
281
            $('#loginFormName').val('<mtw:out value="bodyColumn.name" />');
281
            $('#loginFormName').val('<mtw:out value="bodyColumn.name" />');
282
            $('#loginFormLang').val('<mtw:out value="bodyColumn.lang" />');
282
            $('#loginFormLang').val('<mtw:out value="bodyColumn.lang" />');
283
283
284
            myDialog = $('#loginDialog');
284
            myDialog = $('#loginDialog');
285
            myDialog = prepareLoginDialog(myDialog);
285
            myDialog = prepareLoginDialog(myDialog);
286
            myDialog.dialog('open');
286
            myDialog.dialog('open');
287
287
288
            return false;
288
            return false;
289
        }
289
        }
290
        
290
        
291
        function clearLoginForm() {
291
        function clearLoginForm() {
292
        	$('#loginUsername').val('');
292
        	$('#loginUsername').val('');
293
        	$('#loginPassword').val('');
293
        	$('#loginPassword').val('');
294
        	$('#loginUsernameError').text('');
294
        	$('#loginUsernameError').text('');
295
        	$('#loginPasswordError').text('');
295
        	$('#loginPasswordError').text('');
296
        }
296
        }
297
        
297
        
298
        function clearCreateNewPageForm() {
298
        function clearCreateNewPageForm() {
299
        	$('#createNewPageName').val('');
299
        	$('#createNewPageName').val('');
300
        	$('#createNewPageTitle').val('');
300
        	$('#createNewPageTitle').val('');
301
        	$('#createNewPageLanguage').val('');
301
        	$('#createNewPageLanguage').val('');
302
        	$('#createNewPageTextArea').val('');
302
        	$('#createNewPageTextArea').val('');
303
        	$('#createNewPageNameError').text('');
303
        	$('#createNewPageNameError').text('');
304
        	$('#createNewPageTitleError').text('');
304
        	$('#createNewPageTitleError').text('');
305
        	$('#createNewPageLanguageError').text('');
305
        	$('#createNewPageLanguageError').text('');
306
        	$('#createNewPageBodyError').text('');
306
        	$('#createNewPageBodyError').text('');
307
        }
307
        }
308
        
308
        
309
      	function prepareLoginDialog(myDialog) {
309
      	function prepareLoginDialog(myDialog) {
310
310
311
            options = {
311
            options = {
312
            	close: function() { clearLoginForm(); },
312
            	close: function() { clearLoginForm(); },
313
                autoOpen: false,
313
                autoOpen: false,
314
                width: 290,
314
                width: 290,
315
                modal: true,
315
                modal: true,
316
                title: "Login:",
316
                title: "Login:",
317
                buttons: [
317
                buttons: [
318
                          {
318
                          {
319
                                text: "Login",
319
                                text: "Login",
320
                                click: function() { $('#loginForm').submit(); }
320
                                click: function() { $('#loginForm').submit(); }
321
                          },
321
                          },
322
                          {
322
                          {
323
                                text: "Cancel",
323
                                text: "Cancel",
324
                                click: function() {  $(this).dialog("close"); }
324
                                click: function() {  $(this).dialog("close"); }
325
                          }
325
                          }
326
                      ]
326
                      ]
327
           };
327
           };
328
328
329
          myDialog.dialog(options);
329
          myDialog.dialog(options);
330
330
331
          return myDialog;
331
          return myDialog;
332
        }
332
        }
333
        
333
        
334
      	function prepareConfirmDialog(myDialog) {
334
      	function prepareConfirmDialog(myDialog) {
335
335
336
            options = {
336
            options = {
337
                autoOpen: false,
337
                autoOpen: false,
338
                width: 300,
338
                width: 300,
339
                modal: true,
339
                modal: true,
340
                title: "Confirmation:",
340
                title: "Confirmation:",
341
                buttons: [
341
                buttons: [
342
                          {
342
                          {
343
                                text: "Yes",
343
                                text: "Yes",
344
                                click: function() { $(this).dialog("close"); }
344
                                click: function() { $(this).dialog("close"); }
345
                          },
345
                          },
346
                          {
346
                          {
347
                                text: "No",
347
                                text: "No",
348
                                click: function() {  $(this).dialog("close"); }
348
                                click: function() {  $(this).dialog("close"); }
349
                          }
349
                          }
350
                      ]
350
                      ]
351
           };
351
           };
352
352
353
          myDialog.dialog(options);
353
          myDialog.dialog(options);
354
354
355
          return myDialog;
355
          return myDialog;
356
        }
356
        }
357
        
357
        
358
         function showConfirmDialog() {
358
         function showConfirmDialog() {
359
359
360
            myDialog = $('#confirmDialog');
360
            myDialog = $('#confirmDialog');
361
            myDialog = prepareConfirmDialog(myDialog);
361
            myDialog = prepareConfirmDialog(myDialog);
362
            myDialog.dialog('open');
362
            myDialog.dialog('open');
363
363
364
            return false;
364
            return false;
365
        }
365
        }
366
        
366
        
367
    </script>
367
    </script>
368
368
369
</head>
369
</head>
370
370
371
<body class="composite">
371
<body class="composite">
372
372
373
<!-- For Testing -->
373
<!-- For Testing -->
374
<div id="dialog" title="Dialog Title" style="display: none;">I'm in a dialog</div>
374
<div id="dialog" title="Dialog Title" style="display: none;">I'm in a dialog</div>
375
375
376
<!-- Close Confirm -->
376
<!-- Close Confirm -->
377
<div id="confirmDialog" style="display: none;">
377
<div id="confirmDialog" style="display: none;">
378
	<span id="confirmMessage">The confirmation message goes here.</span>
378
	<span id="confirmMessage">The confirmation message goes here.</span>
379
</div>
379
</div>
380
380
381
<!-- For Editing Pages -->
381
<!-- For Editing Pages -->
382
<div id="editPageDialog" style="display: none;">
382
<div id="editPageDialog" style="display: none;">
383
<form id="editPageForm" action="<mtw:contextPath />/Page.edit.mtw" method="post">
383
<form id="editPageForm" action="<mtw:contextPath />/Page.edit.mtw" method="post">
384
<input type="hidden" name="name" id ="editPageName" value="" />
384
<input type="hidden" name="name" id ="editPageName" value="" />
385
<input type="hidden" name="lang" id="editPageLang" value="" />
385
<input type="hidden" name="lang" id="editPageLang" value="" />
386
<input type="hidden" name="isPreview" id="editPagePreview" value="false" />
386
<input type="hidden" name="isPreview" id="editPagePreview" value="false" />
387
<table>
387
<table>
388
    <tr>
388
    <tr>
389
        <td>&nbsp;</td>
389
        <td>&nbsp;</td>
390
    </tr>
390
    </tr>
391
    <mtw:outError field="html">
391
    <mtw:outError field="html">
392
        <tr>
392
        <tr>
393
            <td colspan="2"><span class="Negative" style="font-weight: bold;"><mtw:out /></span></td>
393
            <td colspan="2"><span class="Negative" style="font-weight: bold;"><mtw:out /></span></td>
394
        </tr>
394
        </tr>
395
    </mtw:outError>
395
    </mtw:outError>
396
    <tr>
396
    <tr>
397
        <td colspan="2"><mtw:textarea id="editPageTextArea" name="body" style="width: 100%; height: 465px;" /></td>
397
        <td colspan="2"><mtw:textarea id="editPageTextArea" name="body" style="width: 100%; height: 465px;" /></td>
398
    </tr>
398
    </tr>
399
</table>
399
</table>
400
</form>
400
</form>
401
</div>
401
</div>
402
402
403
<!-- For Login -->
403
<!-- For Login -->
404
<div id="loginDialog" style="display: none;">
404
<div id="loginDialog" style="display: none;">
405
		<form action="<mtw:contextPath />/Login.mtw" method="post" id="loginForm">
405
		<form action="<mtw:contextPath />/Login.mtw" method="post" id="loginForm">
406
            <input type="hidden" name="name" value="" id="loginFormName" />
406
            <input type="hidden" name="name" value="" id="loginFormName" />
407
            <input type="hidden" name="lang" value="" id="loginFormLang" />
407
            <input type="hidden" name="lang" value="" id="loginFormLang" />
408
			<table>
408
			<table>
409
				<tr>
409
				<tr>
410
					<td>
410
					<td>
411
						Username:
411
						Username:
412
					</td>
412
					</td>
413
					<td>
413
					<td>
414
						<mtw:input id="loginUsername" name="username" size="20" maxlength="20" />
414
						<mtw:input id="loginUsername" name="username" size="20" maxlength="20" />
415
						<span id="loginUsernameError">
415
						<span id="loginUsernameError">
416
						<mtw:outError field="username">
416
						<mtw:outError field="username">
417
							<font color="red">
417
							<font color="red">
418
								<b><mtw:out /></b>
418
								<b><mtw:out /></b>
419
							</font>
419
							</font>
420
						</mtw:outError>
420
						</mtw:outError>
421
						</span>
421
						</span>
422
					</td>
422
					</td>
423
				</tr>
423
				</tr>
424
				<tr>
424
				<tr>
425
					<td>
425
					<td>
426
						Password:
426
						Password:
427
					</td>
427
					</td>
428
					<td>
428
					<td>
429
						<mtw:input id="loginPassword" name="password" type="password" size="20" maxlength="20" />
429
						<mtw:input id="loginPassword" name="password" type="password" size="20" maxlength="20" />
430
						<span id="loginPasswordError"> 
430
						<span id="loginPasswordError"> 
431
						<mtw:outError field="password">
431
						<mtw:outError field="password">
432
							<font color="red">
432
							<font color="red">
433
								<b><mtw:out /></b>
433
								<b><mtw:out /></b>
434
							</font>
434
							</font>
435
						</mtw:outError>
435
						</mtw:outError>
436
						</span>
436
						</span>
437
					</td>
437
					</td>
438
				</tr>
438
				</tr>
439
			</table>
439
			</table>
440
		</form>
440
		</form>
441
</div>
441
</div>
442
442
443
<!-- For displaying all pages -->
443
<!-- For displaying all pages -->
444
<div id="listAllPagesDialog" style="display: none;">
444
<div id="listAllPagesDialog" style="display: none;">
445
    <form action="#" method="post" id="listAllPagesForm">
445
    <form action="#" method="post" id="listAllPagesForm">
446
    <table id="listAllPagesTable">
446
    <table id="listAllPagesTable">
447
    </table>
447
    </table>
448
    </form>
448
    </form>
449
</div>
449
</div>
450
450
451
<!-- Create New Page -->
451
<!-- Create New Page -->
452
<div id="createNewPageDialog" style="display: none;">
452
<div id="createNewPageDialog" style="display: none;">
453
		<form action="<mtw:contextPath />/Page.add.mtw" method="post" id="createNewPageForm">
453
		<form action="<mtw:contextPath />/Page.add.mtw" method="post" id="createNewPageForm">
454
            <input type="hidden" name="name" value="" id="createNewPageFormName" />
454
            <input type="hidden" name="name" value="" id="createNewPageFormName" />
455
            <input type="hidden" name="lang" value="" id="createNewPageFormLang" />
455
            <input type="hidden" name="lang" value="" id="createNewPageFormLang" />
456
            <input type="hidden" name="isPreview" value="false" id="createNewPageFormPreview" />
456
            <input type="hidden" name="isPreview" value="false" id="createNewPageFormPreview" />
457
			<table>
457
			<table>
458
				<tr>
458
				<tr>
459
					<td>
459
					<td>
460
						Name:
460
						Name:
461
					</td>
461
					</td>
462
					<td>
462
					<td>
463
						<mtw:input id="createNewPageName" name="newPage.name" size="40" maxlength="30" />
463
						<mtw:input id="createNewPageName" name="newPage.name" size="40" maxlength="30" />
464
						<span id="createNewPageNameError">
464
						<span id="createNewPageNameError">
465
						<mtw:outError field="newPage.name">
465
						<mtw:outError field="newPage.name">
466
							<font color="red">
466
							<font color="red">
467
								<b><mtw:out /></b>
467
								<b><mtw:out /></b>
468
							</font>
468
							</font>
469
						</mtw:outError>
469
						</mtw:outError>
470
						</span>
470
						</span>
471
					</td>
471
					</td>
472
				</tr>
472
				</tr>
473
				<tr>
473
				<tr>
474
					<td>
474
					<td>
475
						Title:
475
						Title:
476
					</td>
476
					</td>
477
					<td>
477
					<td>
478
						<mtw:input id="createNewPageTitle" name="newPage.title" size="40" maxlength="60" />
478
						<mtw:input id="createNewPageTitle" name="newPage.title" size="40" maxlength="60" />
479
						<span id="createNewPageTitleError">
479
						<span id="createNewPageTitleError">
480
						<mtw:outError field="newPage.title">
480
						<mtw:outError field="newPage.title">
481
							<font color="red">
481
							<font color="red">
482
								<b><mtw:out /></b>
482
								<b><mtw:out /></b>
483
							</font>
483
							</font>
484
						</mtw:outError>
484
						</mtw:outError>
485
						</span>
485
						</span>
486
					</td>
486
					</td>
487
				</tr>
487
				</tr>
488
				<tr id="createPageLanguageCell">
488
				<tr id="createPageLanguageCell">
489
					<td>
489
					<td>
490
						Language:
490
						Language:
491
					</td>
491
					</td>
492
					<td>
492
					<td>
493
						<mtw:select name="newPage.languageId" list="languages" id="createNewPageLanguage" emptyField="true" />
493
						<mtw:select name="newPage.languageId" list="languages" id="createNewPageLanguage" emptyField="true" />
494
						<span id="createNewPageLanguageError">
494
						<span id="createNewPageLanguageError">
495
						<mtw:outError field="newPage.languageId">
495
						<mtw:outError field="newPage.languageId">
496
							<font color="red">
496
							<font color="red">
497
								<b><mtw:out /></b>
497
								<b><mtw:out /></b>
498
							</font>
498
							</font>
499
						</mtw:outError>
499
						</mtw:outError>
500
						</span>
500
						</span>
501
					</td>
501
					</td>
502
				</tr>
502
				</tr>
503
				<tr>
503
				<tr>
504
        			<td colspan="2">
504
        			<td colspan="2">
505
        				<mtw:textarea id="createNewPageTextArea" name="newPage.body" style="width: 100%; height: 465px;" />
505
        				<mtw:textarea id="createNewPageTextArea" name="newPage.body" style="width: 100%; height: 465px;" />
506
        				<span id="createNewPageBodyError">
506
        				<span id="createNewPageBodyError">
507
						<mtw:outError field="newPage.body">
507
						<mtw:outError field="newPage.body">
508
							<font color="red">
508
							<font color="red">
509
								<b><mtw:out /></b>
509
								<b><mtw:out /></b>
510
							</font>
510
							</font>
511
						</mtw:outError>
511
						</mtw:outError>
512
						</span>
512
						</span>
513
        			</td>
513
        			</td>
514
    			</tr>
514
    			</tr>
515
			</table>
515
			</table>
516
		</form>
516
		</form>
517
</div>
517
</div>
518
518
519
519
520
<div>
520
<div>
521
<table border="0">
521
<table border="0">
522
    <tr>
522
    <tr>
523
        <td><a href="<mtw:contextPath/>"><img src="images/logos/logo.png" border="0"></img></a></td>
523
        <td><a href="<mtw:contextPath/>"><img src="images/logos/logo.png" border="0"></img></a></td>
524
        <td align="right" valign="bottom">
524
        <td align="right" valign="bottom">
525
            <mtw:isLogged negate="true">
525
            <mtw:isLogged negate="true">
526
                <a href="#" onclick="return showLoginDialog();">Login</a>
526
                <a href="#" onclick="return showLoginDialog();">Login</a>
527
            </mtw:isLogged>
527
            </mtw:isLogged>
528
            <mtw:isLogged>
528
            <mtw:isLogged>
529
                <a href="#" onclick="return showCreateNewPageDialog();">Create New Page</a> |
529
                <a href="#" onclick="return showCreateNewPageDialog();">Create New Page</a> |
530
                <a href="#" onclick="return showListAllPagesDialog();">List Pages</a> |
530
                <a href="#" onclick="return showListAllPagesDialog();">List Pages</a> |
531
                <mtw:hasAuthorization groups="admin">
531
                <mtw:hasAuthorization groups="admin">
532
                <a href="#" onclick="return showEditPageDialog('CSS', 'en');" title="<k:editTooltip name="css" />">Edit CSS</a> |
532
                <a href="#" onclick="return showEditPageDialog('CSS', 'en');" title="<k:editTooltip name="css" />">Edit CSS</a> |
533
                </mtw:hasAuthorization>
533
                </mtw:hasAuthorization>
534
                <a href="<mtw:contextPath/>/Logout.mtw">Logout</a> (<mtw:out value="sessionUser.username" />)
534
                <a href="<mtw:contextPath/>/Logout.mtw">Logout</a> (<mtw:out value="sessionUser.username" />)
535
            </mtw:isLogged>
535
            </mtw:isLogged>
536
            &nbsp;
536
            &nbsp;
537
            <mtw:isLocale value="pt">
537
            <mtw:isLocale value="pt">
538
	            <a href="<mtw:urlWithLoc loc="pt" />"><img src="images/brazil.gif" border="0" width="20" height="13" style="border: 3px solid #ccc;" /></a>
538
	            <a href="<mtw:urlWithLoc loc="pt" />"><img src="images/brazil.gif" border="0" width="20" height="13" style="border: 3px solid #ccc;" /></a>
539
    	        <a href="<mtw:urlWithLoc loc="en" />"><img src="images/usa.gif" width="20" height="13" border="0" style="border: 3px solid #fff;" /></a>
539
    	        <a href="<mtw:urlWithLoc loc="en" />"><img src="images/usa.gif" width="20" height="13" border="0" style="border: 3px solid #fff;" /></a>
540
            </mtw:isLocale>
540
            </mtw:isLocale>
541
            <mtw:isLocale value="en">
541
            <mtw:isLocale value="en">
542
            	<a href="<mtw:urlWithLoc loc="pt" />"><img src="images/brazil.gif" border="0" width="20" height="13" style="border: 3px solid #fff;" /></a>
542
            	<a href="<mtw:urlWithLoc loc="pt" />"><img src="images/brazil.gif" border="0" width="20" height="13" style="border: 3px solid #fff;" /></a>
543
            	<a href="<mtw:urlWithLoc loc="en" />"><img src="images/usa.gif" width="20" height="13" border="0" style="border: 3px solid #ccc;" /></a>
543
            	<a href="<mtw:urlWithLoc loc="en" />"><img src="images/usa.gif" width="20" height="13" border="0" style="border: 3px solid #ccc;" /></a>
544
            </mtw:isLocale>
544
            </mtw:isLocale>
545
            &nbsp;&nbsp;&nbsp;
545
            &nbsp;&nbsp;&nbsp;
546
        </td>
546
        </td>
547
    </tr>
547
    </tr>
548
</table>
548
</table>
549
</div>
549
</div>
550
550
551
<hr />
551
<hr />
552
552
553
<div id="leftColumn"><mtw:isLogged>
553
<div id="leftColumn"><mtw:isLogged>
554
    <mtw:hasAuthorization groups="admin">
554
    <mtw:hasAuthorization groups="admin">
555
        <div style="text-align: right; padding-right: 14px; padding-top: 6px;"><a href="#" onclick="return showEditPageDialog('LeftColumn', '<mtw:out value="leftColumn.language.locale" />');" title="<k:editTooltip name="leftColumn" />">Edit</a></div>
555
        <div style="text-align: right; padding-right: 14px; padding-top: 6px;"><a href="#" onclick="return showEditPageDialog('LeftColumn', '<mtw:out value="leftColumn.language.locale" />');" title="<k:editTooltip name="leftColumn" />">Edit</a></div>
556
    </mtw:hasAuthorization>
556
    </mtw:hasAuthorization>
557
</mtw:isLogged>
557
</mtw:isLogged>
558
<div id="navcolumn">
558
<div id="navcolumn">
559
    <div>
559
    <div>
560
    <mtw:out value="leftColumn.body" />
560
    <mtw:out value="leftColumn.body" />
561
    </div>
561
    </div>
562
<br />
562
<br />
563
</div>
563
</div>
564
564
565
</div>
565
</div>
566
566
567
<div id="bodyColumn">
567
<div id="bodyColumn">
568
    <mtw:hasAuthorization groups="admin, editor">
568
    <mtw:hasAuthorization groups="admin, editor">
569
569
570
    <mtw:if test="bodyColumn.preview" value="true">
570
    <mtw:if test="bodyColumn.preview" value="true">
571
571
572
    	<mtw:if test="bodyColumn.new" value="true">
572
    	<mtw:if test="bodyColumn.new" value="true">
573
			<div style="text-align: left; padding-left: 14px;">
-
 
574
			<a href="#" onclick="return showEditPreviewNewPageDialog('<mtw:out value="bodyColumn.name" />', '<mtw:out value="bodyColumn.language.locale" />');" title="<k:editTooltip name="bodyColumn" />">This is a Preview</a>
-
 
575
			- <a href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Save</a>
-
 
-
 
573
			<div style="text-align: left; padding-left: 4px;">
-
 
574
			<b>This is a Preview</b>
-
 
575
			&nbsp;-&nbsp;
-
 
576
            <a href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Save</a>&nbsp;&nbsp;
-
 
577
            <a href="#" onclick="return showEditPreviewNewPageDialog('<mtw:out value="bodyColumn.name" />', '<mtw:out value="bodyColumn.language.locale" />');" title="<k:editTooltip name="bodyColumn" />">Edit</a>&nbsp;&nbsp;
576
			<a href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Discard</a>
578
			<a href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Discard</a>
577
			</div>    
579
			</div>    
578
    	</mtw:if>
580
    	</mtw:if>
579
    	<mtw:if test="bodyColumn.new" value="false">
581
    	<mtw:if test="bodyColumn.new" value="false">
580
			<div style="text-align: left; padding-left: 14px;">
-
 
581
			<a href="#" onclick="return showEditPreviewDialog('<mtw:out value="bodyColumn.name" />', '<mtw:out value="bodyColumn.language.locale" />');" title="<k:editTooltip name="bodyColumn" />">This is a Preview</a>
-
 
582
			- <a href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Save</a>
-
 
583
			<a href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Discard</a>
-
 
584
			
-
 
-
 
582
            <div style="text-align: left; padding-left: 4px;">
-
 
583
            <b>This is a Preview</b>
-
 
584
            &nbsp;-&nbsp;
-
 
585
            <a href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Save</a>&nbsp;&nbsp;
-
 
586
            <a href="#" onclick="return showEditPreviewDialog('<mtw:out value="bodyColumn.name" />', '<mtw:out value="bodyColumn.language.locale" />');" title="<k:editTooltip name="bodyColumn" />">Edit</a>&nbsp;&nbsp;
-
 
587
            <a href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Discard</a>
585
			</div>    	
588
			</div>    	
586
    	</mtw:if>
589
    	</mtw:if>
587
    
590
    
588
    </mtw:if>
591
    </mtw:if>
589
592
590
    <mtw:if test="bodyColumn.preview" value="false">
593
    <mtw:if test="bodyColumn.preview" value="false">
591
    <div style="text-align: right; padding-right: 14px;"><a href="#" onclick="return showEditPageDialog('<mtw:out value="bodyColumn.name" />', '<mtw:out value="bodyColumn.language.locale" />');" title="<k:editTooltip name="bodyColumn" />">Edit</a></div>
594
    <div style="text-align: right; padding-right: 14px;"><a href="#" onclick="return showEditPageDialog('<mtw:out value="bodyColumn.name" />', '<mtw:out value="bodyColumn.language.locale" />');" title="<k:editTooltip name="bodyColumn" />">Edit</a></div>
592
    </mtw:if>
595
    </mtw:if>
593
596
594
    </mtw:hasAuthorization>
597
    </mtw:hasAuthorization>
595
    <mtw:out value="bodyColumn.body" />
598
    <mtw:out value="bodyColumn.body" />
596
</div>
599
</div>
597
600
598
<div class="clear">
601
<div class="clear">
599
<hr />
602
<hr />
600
</div>
603
</div>
601
604
602
<div id="footer">
605
<div id="footer">
603
<div class="xright">Copyright (c) 2011</div>
606
<div class="xright">Copyright (c) 2011</div>
604
<div class="clear">
607
<div class="clear">
605
<hr />
608
<hr />
606
</div>
609
</div>
607
</div>
610
</div>
608
611
609
</body>
612
</body>
610
</html>
613
</html>