Kawai Wiki

Rev

Rev 209 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 209 Rev 232
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
<%@page pageEncoding="UTF-8" %>
2
<%@page pageEncoding="UTF-8" %>
3
<%@ page contentType="text/html; charset=UTF-8"%> 
3
<%@ page contentType="text/html; charset=UTF-8"%> 
4
<%@taglib prefix="mtw" uri="http://www.mentaframework.org/tags-mtw/"%>
4
<%@taglib prefix="mtw" uri="http://www.mentaframework.org/tags-mtw/"%>
5
<%@ taglib uri="/WEB-INF/tld/taglib.tld" prefix="k" %>
5
<%@ taglib uri="/WEB-INF/tld/taglib.tld" prefix="k" %>
6
6
7
<html>
7
<html>
8
<head>
8
<head>
9
9
10
<title><mtw:out  value="bodyColumn.title" /></title>
10
<title><mtw:out  value="bodyColumn.title" /></title>
11
11
12
<style type="text/css" media="all">
12
<style type="text/css" media="all">
13
@import url("<mtw:contextPath/>/Page.getCSS.mtw?file=main.css");
13
@import url("<mtw:contextPath/>/Page.getCSS.mtw?file=main.css");
14
</style>
14
</style>
15
15
16
<meta http-equiv="imagetoolbar" content="no" />
16
<meta http-equiv="imagetoolbar" content="no" />
17
<meta http-equiv="imagetoolbar" content="false" />
17
<meta http-equiv="imagetoolbar" content="false" />
18
18
19
<link rel="shortcut icon" type="image/x-icon" href="<mtw:contextPath />/images/kawai.ico" />
19
<link rel="shortcut icon" type="image/x-icon" href="<mtw:contextPath />/images/kawai.ico" />
20
<link rel="icon" type="image/gif" href="<mtw:contextPath />/images/kawai.gif" />
20
<link rel="icon" type="image/gif" href="<mtw:contextPath />/images/kawai.gif" />
21
<link rel="stylesheet" href="<mtw:contextPath/>/Page.getPrintCSS.mtw?file=print.css" type="text/css" media="print" />
21
<link rel="stylesheet" href="<mtw:contextPath/>/Page.getPrintCSS.mtw?file=print.css" type="text/css" media="print" />
22
22
23
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
23
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
24
<meta name="author" content="Sergio Oliveira Junior" />
24
<meta name="author" content="Sergio Oliveira Junior" />
25
<meta name="email" content="sergio.oliveira.jr@gmail.com" />
25
<meta name="email" content="sergio.oliveira.jr@gmail.com" />
26
26
27
<link href="<mtw:contextPath/>/css/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />
27
<link href="<mtw:contextPath/>/css/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />
28
<script type="text/javascript" src="<mtw:contextPath/>/jquery/jquery-1.6.4.min.js"></script>
28
<script type="text/javascript" src="<mtw:contextPath/>/jquery/jquery-1.6.4.min.js"></script>
29
<script src="<mtw:contextPath/>/js/jquery-ui-1.8.16.custom.min.js"></script>
29
<script src="<mtw:contextPath/>/js/jquery-ui-1.8.16.custom.min.js"></script>
30
30
31
<link href="<mtw:contextPath />/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
31
<link href="<mtw:contextPath />/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
32
<script type="text/javascript" src="<mtw:contextPath />/uploadify/swfobject.js"></script>
32
<script type="text/javascript" src="<mtw:contextPath />/uploadify/swfobject.js"></script>
33
<script type="text/javascript" src="<mtw:contextPath />/uploadify/jquery.uploadify.v2.1.4.min.js"></script>
33
<script type="text/javascript" src="<mtw:contextPath />/uploadify/jquery.uploadify.v2.1.4.min.js"></script>
34
34
35
<!-- Include required JS files -->
35
<!-- Include required JS files -->
36
<script type="text/javascript" src="<mtw:contextPath/>/sh/js/shCore.js"></script>
36
<script type="text/javascript" src="<mtw:contextPath/>/sh/js/shCore.js"></script>
37
 
37
 
38
<!--
38
<!--
39
    At least one brush, here we choose JS. You need to include a brush for every 
39
    At least one brush, here we choose JS. You need to include a brush for every 
40
    language you want to highlight
40
    language you want to highlight
41
-->
41
-->
42
<script type="text/javascript" src="<mtw:contextPath/>/sh/js/shBrushJava.js"></script>
42
<script type="text/javascript" src="<mtw:contextPath/>/sh/js/shBrushJava.js"></script>
-
 
43
<script type="text/javascript" src="<mtw:contextPath/>/sh/js/shBrushXml.js"></script>
-
 
44
<script type="text/javascript" src="<mtw:contextPath/>/sh/js/shBrushRuby.js"></script>
43
 
45
 
44
<!-- Include *at least* the core style and default theme -->
46
<!-- Include *at least* the core style and default theme -->
45
<link href="<mtw:contextPath/>/sh/css/shCore.css" rel="stylesheet" type="text/css" />
47
<link href="<mtw:contextPath/>/sh/css/shCore.css" rel="stylesheet" type="text/css" />
46
<link href="<mtw:contextPath/>/sh/css/shThemeDefault.css" rel="stylesheet" type="text/css" />
48
<link href="<mtw:contextPath/>/sh/css/shThemeDefault.css" rel="stylesheet" type="text/css" />
47
 
49
 
48
<!-- Finally, to actually run the highlighter, you need to include this JS on your page -->
50
<!-- Finally, to actually run the highlighter, you need to include this JS on your page -->
49
<script type="text/javascript">
51
<script type="text/javascript">
50
     SyntaxHighlighter.all();
52
     SyntaxHighlighter.all();
51
</script>
53
</script>
52
54
53
<!--  User JavaScript -->
55
<!--  User JavaScript -->
54
<script type="text/javascript">
56
<script type="text/javascript">
55
57
56
<mtw:out value="js.body" />
58
<mtw:out value="js.body" />
57
59
58
</script>
60
</script>
59
61
60
62
61
<script language="JavaScript">
63
<script language="JavaScript">
62
    
64
    
63
        $(document).ready(function() {
65
        $(document).ready(function() {
64
        
66
        
65
        	<mtw:if test="showForm" value="login">
67
        	<mtw:if test="showForm" value="login">
66
				showLoginDialog();
68
				showLoginDialog();
67
			</mtw:if>
69
			</mtw:if>
68
70
69
            <mtw:if test="showForm" value="addNewUser">
71
            <mtw:if test="showForm" value="addNewUser">
70
                showAddNewUserDialog(false);
72
                showAddNewUserDialog(false);
71
            </mtw:if>
73
            </mtw:if>
72
			
74
			
73
			<mtw:if test="showForm" value="add">
75
			<mtw:if test="showForm" value="add">
74
				showCreateNewPageDialog();
76
				showCreateNewPageDialog();
75
			</mtw:if>
77
			</mtw:if>
76
78
77
            <mtw:outMessage>
79
            <mtw:outMessage>
78
                alert('<mtw:out />');
80
                alert('<mtw:out />');
79
            </mtw:outMessage>
81
            </mtw:outMessage>
80
82
81
			$('#loginDialog').keyup(function(e) {
83
			$('#loginDialog').keyup(function(e) {
82
    			if (e.keyCode == 13) {
84
    			if (e.keyCode == 13) {
83
        			$('#loginForm').submit();
85
        			$('#loginForm').submit();
84
    			}
86
    			}
85
			});
87
			});
86
			
88
			
87
			$('#file_upload').uploadify({
89
			$('#file_upload').uploadify({
88
				'uploader'  : '<mtw:contextPath />/uploadify/uploadify.swf',
90
				'uploader'  : '<mtw:contextPath />/uploadify/uploadify.swf',
89
				'script'    : '<mtw:contextPath />/File.upload.mtw;jsessionid=<%= session.getId() %>',
91
				'script'    : '<mtw:contextPath />/File.upload.mtw;jsessionid=<%= session.getId() %>',
90
				'cancelImg' : '<mtw:contextPath />/uploadify/cancel.png',
92
				'cancelImg' : '<mtw:contextPath />/uploadify/cancel.png',
91
				'folder'    : '<mtw:contextPath />/uploads',
93
				'folder'    : '<mtw:contextPath />/uploads',
92
				'scriptData': { 'JSESSIONID': '<%= session.getId() %>'},
94
				'scriptData': { 'JSESSIONID': '<%= session.getId() %>'},
93
				'auto'      : true,
95
				'auto'      : true,
94
				'multi'     : true,
96
				'multi'     : true,
95
				'onComplete'  : function(event, ID, fileObj, response, data) {
97
				'onComplete'  : function(event, ID, fileObj, response, data) {
96
98
97
					var resp = eval('(' + response + ')');
99
					var resp = eval('(' + response + ')');
98
		
100
		
99
					if (resp.status == 'success') {
101
					if (resp.status == 'success') {
100
						$('#uploadResults').append('<tr><td style="color: blue;">' + resp.msg + '</td></tr>');
102
						$('#uploadResults').append('<tr><td style="color: blue;">' + resp.msg + '</td></tr>');
101
					} else if (resp.status == 'error') {
103
					} else if (resp.status == 'error') {
102
						$('#uploadResults').append('<tr><td style="color: red;">' + resp.msg + '</td></tr>');    				
104
						$('#uploadResults').append('<tr><td style="color: red;">' + resp.msg + '</td></tr>');    				
103
					}
105
					}
104
				}
106
				}
105
			});
107
			});
106
108
107
            // ajax add new user:
109
            // ajax add new user:
108
110
109
	        
111
	        
110
            $('#usernameLoading').hide();
112
            $('#usernameLoading').hide();
111
    
113
    
112
            $('#addNewUserUsername').blur( function() {
114
            $('#addNewUserUsername').blur( function() {
113
    
115
    
114
                $('#usernameMessage').hide();
116
                $('#usernameMessage').hide();
115
    
117
    
116
                if ($('#addNewUserUsername').val().trim() != '') {
118
                if ($('#addNewUserUsername').val().trim() != '') {
117
119
118
                    $('#usernameLoading').show();
120
                    $('#usernameLoading').show();
119
    
121
    
120
                    $.post("<mtw:contextPath />/User.check.mtw", {
122
                    $.post("<mtw:contextPath />/User.check.mtw", {
121
                        username : $('#addNewUserUsername').val()
123
                        username : $('#addNewUserUsername').val()
122
                    }, function(response) {
124
                    }, function(response) {
123
                        $('#usernameMessage').fadeOut();
125
                        $('#usernameMessage').fadeOut();
124
                        setTimeout("usernameResult('"
126
                        setTimeout("usernameResult('"
125
                                + escape(response) + "')", 400);
127
                                + escape(response) + "')", 400);
126
                    });
128
                    });
127
                }
129
                }
128
    
130
    
129
                return false;
131
                return false;
130
            });
132
            });
131
133
132
        });
134
        });
133
        
135
        
134
        function prepareEditPageDialog(myDialog, theTitle) {
136
        function prepareEditPageDialog(myDialog, theTitle) {
135
137
136
            options = {
138
            options = {
137
                autoOpen: false,
139
                autoOpen: false,
138
                width: 1000,
140
                width: 1000,
139
                modal: true,
141
                modal: true,
140
                title: theTitle,
142
                title: theTitle,
141
                buttons: [
143
                buttons: [
142
                          {
144
                          {
143
                                text: "Save",
145
                                text: "Save",
144
                                click: function() { $('#editPageForm').submit(); }
146
                                click: function() { $('#editPageForm').submit(); }
145
                          },
147
                          },
146
                          {
148
                          {
147
                                text: "Preview",
149
                                text: "Preview",
148
                                click: function() { $('#editPagePreview').val('true'); $('#editPageForm').submit(); }
150
                                click: function() { $('#editPagePreview').val('true'); $('#editPageForm').submit(); }
149
                          },                          
151
                          },                          
150
                          {
152
                          {
151
                                text: "Cancel",
153
                                text: "Cancel",
152
                                click: function() { $(this).dialog("close"); }
154
                                click: function() { $(this).dialog("close"); }
153
                          }
155
                          }
154
                      ]
156
                      ]
155
           };
157
           };
156
158
157
          myDialog.dialog(options);
159
          myDialog.dialog(options);
158
160
159
          return myDialog;
161
          return myDialog;
160
        }
162
        }
161
163
162
        function prepareShowPageDialog(myDialog, theTitle) {
164
        function prepareShowPageDialog(myDialog, theTitle) {
163
165
164
            options = {
166
            options = {
165
                autoOpen: false,
167
                autoOpen: false,
166
                width: 800,
168
                width: 800,
167
                modal: true,
169
                modal: true,
168
                title: theTitle,
170
                title: theTitle,
169
                buttons: [
171
                buttons: [
170
                          {
172
                          {
171
                                text: "Back",
173
                                text: "Back",
172
                                click: function() { $(this).dialog("close"); }
174
                                click: function() { $(this).dialog("close"); }
173
                          },
175
                          },
174
                          {
176
                          {
175
                                text: "Close",
177
                                text: "Close",
176
                                click: function() { $(this).dialog("close"); $('#listLastRevisionsDialog').dialog('close'); $('#listRevisionsDialog').dialog('close'); $('#listAllPagesDialog').dialog('close'); }
178
                                click: function() { $(this).dialog("close"); $('#listLastRevisionsDialog').dialog('close'); $('#listRevisionsDialog').dialog('close'); $('#listAllPagesDialog').dialog('close'); }
177
                          }
179
                          }
178
                      ]
180
                      ]
179
           };
181
           };
180
182
181
          myDialog.dialog(options);
183
          myDialog.dialog(options);
182
184
183
          return myDialog;
185
          return myDialog;
184
        }
186
        }
185
        
187
        
186
		function prepareFileListDialog(myDialog) {
188
		function prepareFileListDialog(myDialog) {
187
189
188
            options = {
190
            options = {
189
                autoOpen: false,
191
                autoOpen: false,
190
                width: 400,
192
                width: 400,
191
                height: 300,
193
                height: 300,
192
                modal: true,
194
                modal: true,
193
                title: "Files uploaded:",
195
                title: "Files uploaded:",
194
                buttons: [
196
                buttons: [
195
                          {
197
                          {
196
                                text: "Close",
198
                                text: "Close",
197
                                click: function() { $(this).dialog("close"); }
199
                                click: function() { $(this).dialog("close"); }
198
                          }
200
                          }
199
                      ]
201
                      ]
200
           };
202
           };
201
203
202
          myDialog.dialog(options);
204
          myDialog.dialog(options);
203
205
204
          return myDialog;
206
          return myDialog;
205
        }        
207
        }        
206
                
208
                
207
209
208
        function prepareListAllPagesDialog(myDialog, showEdit) {
210
        function prepareListAllPagesDialog(myDialog, showEdit) {
209
211
210
            listAllPagesButtons = [
212
            listAllPagesButtons = [
211
                      {
213
                      {
212
                            text: "Close",
214
                            text: "Close",
213
                            click: function() { $(this).dialog("close"); }
215
                            click: function() { $(this).dialog("close"); }
214
                      }];
216
                      }];
215
217
216
            if (showEdit) {
218
            if (showEdit) {
217
                listAllPagesButtons = [
219
                listAllPagesButtons = [
218
                          {
220
                          {
219
                                text: "FrontPage",
221
                                text: "FrontPage",
220
                                click: function() { $('#listAllPagesForm').attr('action', '<mtw:contextPath/>/Page.setFrontPage.mtw'); $('#listAllPagesForm').submit(); }
222
                                click: function() { $('#listAllPagesForm').attr('action', '<mtw:contextPath/>/Page.setFrontPage.mtw'); $('#listAllPagesForm').submit(); }
221
                          },
223
                          },
222
                          {
224
                          {
223
                                text: "Delete",
225
                                text: "Delete",
224
                                click: function() { $('#listAllPagesForm').attr('action', '<mtw:contextPath/>/Page.delete.mtw'); $('#listAllPagesForm').submit(); }
226
                                click: function() { $('#listAllPagesForm').attr('action', '<mtw:contextPath/>/Page.delete.mtw'); $('#listAllPagesForm').submit(); }
225
                          },
227
                          },
226
                          {
228
                          {
227
                                text: "Close",
229
                                text: "Close",
228
                                click: function() { $(this).dialog("close"); }
230
                                click: function() { $(this).dialog("close"); }
229
                          }];
231
                          }];
230
            }
232
            }
231
233
232
            options = {
234
            options = {
233
                autoOpen: false,
235
                autoOpen: false,
234
                width: 800,
236
                width: 800,
235
                height: 450,
237
                height: 450,
236
                modal: true,
238
                modal: true,
237
                title: 'Pages:',
239
                title: 'Pages:',
238
                buttons: listAllPagesButtons
240
                buttons: listAllPagesButtons
239
           };
241
           };
240
242
241
          myDialog.dialog(options);
243
          myDialog.dialog(options);
242
244
243
          return myDialog;
245
          return myDialog;
244
        }
246
        }
245
247
246
        function prepareListRevisionsDialog(myDialog, name, lang, showBackButton) {
248
        function prepareListRevisionsDialog(myDialog, name, lang, showBackButton) {
247
        
249
        
248
        	theButtons = [
250
        	theButtons = [
249
                          {
251
                          {
250
                                text: "Back",
252
                                text: "Back",
251
                                click: function() { $(this).dialog("close"); }
253
                                click: function() { $(this).dialog("close"); }
252
                          },
254
                          },
253
                          {
255
                          {
254
                                text: "Close",
256
                                text: "Close",
255
                                click: function() { $(this).dialog("close"); $('#listAllPagesDialog').dialog('close'); }
257
                                click: function() { $(this).dialog("close"); $('#listAllPagesDialog').dialog('close'); }
256
                          }
258
                          }
257
                      ];
259
                      ];
258
                      
260
                      
259
			if (!showBackButton) {
261
			if (!showBackButton) {
260
			
262
			
261
        	theButtons = [
263
        	theButtons = [
262
                          {
264
                          {
263
                                text: "Close",
265
                                text: "Close",
264
                                click: function() { $(this).dialog("close"); $('#listAllPagesDialog').dialog('close'); }
266
                                click: function() { $(this).dialog("close"); $('#listAllPagesDialog').dialog('close'); }
265
                          }
267
                          }
266
                      ];
268
                      ];
267
			}                      
269
			}                      
268
            
270
            
269
271
270
            options = {
272
            options = {
271
                autoOpen: false,
273
                autoOpen: false,
272
                width: 800,
274
                width: 800,
273
                height: 450,
275
                height: 450,
274
                modal: true,
276
                modal: true,
275
                title: 'Revisions for ' + name + ' in ' + lang,
277
                title: 'Revisions for ' + name + ' in ' + lang,
276
                buttons: theButtons
278
                buttons: theButtons
277
           };
279
           };
278
280
279
          myDialog.dialog(options);
281
          myDialog.dialog(options);
280
282
281
          return myDialog;
283
          return myDialog;
282
        }
284
        }
283
        
285
        
284
        function prepareListLastRevisionsDialog(myDialog, language) {
286
        function prepareListLastRevisionsDialog(myDialog, language) {
285
        
287
        
286
        	theButtons = [
288
        	theButtons = [
287
                          {
289
                          {
288
                                text: "Close",
290
                                text: "Close",
289
                                click: function() { $(this).dialog("close"); }
291
                                click: function() { $(this).dialog("close"); }
290
                          }
292
                          }
291
                      ];
293
                      ];
292
294
293
            options = {
295
            options = {
294
                autoOpen: false,
296
                autoOpen: false,
295
                width: 800,
297
                width: 800,
296
                height: 450,
298
                height: 450,
297
                modal: true,
299
                modal: true,
298
                title: 'Latest revisions in ' + language,
300
                title: 'Latest revisions in ' + language,
299
                buttons: theButtons
301
                buttons: theButtons
300
           };
302
           };
301
303
302
          myDialog.dialog(options);
304
          myDialog.dialog(options);
303
305
304
          return myDialog;
306
          return myDialog;
305
        }
307
        }
306
        
308
        
307
        
309
        
308
        function prepareFileUploadDialog(myDialog) {
310
        function prepareFileUploadDialog(myDialog) {
309
        
311
        
310
            options = {
312
            options = {
311
                autoOpen: false,
313
                autoOpen: false,
312
                width: 400,
314
                width: 400,
313
                height: 300,
315
                height: 300,
314
                modal: true,
316
                modal: true,
315
                title: 'Uploading files...',
317
                title: 'Uploading files...',
316
                buttons: [
318
                buttons: [
317
                          {
319
                          {
318
                                text: "Close",
320
                                text: "Close",
319
                                click: function() { $(this).dialog("close"); }
321
                                click: function() { $(this).dialog("close"); }
320
                          }
322
                          }
321
                      ]
323
                      ]
322
           };
324
           };
323
325
324
          myDialog.dialog(options);
326
          myDialog.dialog(options);
325
327
326
          return myDialog;
328
          return myDialog;
327
        }        
329
        }        
328
        
330
        
329
        function showEditPageDialog(pageName, lang) {
331
        function showEditPageDialog(pageName, lang) {
330
332
331
            $.getJSON('<mtw:contextPath />/Page.get.mtw?name=' + pageName + '&lang=' + lang, function(data) {
333
            $.getJSON('<mtw:contextPath />/Page.get.mtw?name=' + pageName + '&lang=' + lang, function(data) {
332
334
333
                if (data.page.systemPage) {
335
                if (data.page.systemPage) {
334
                	$('.editPageTitleCell').hide();
336
                	$('.editPageTitleCell').hide();
335
                } else {
337
                } else {
336
                	$('.editPageTitleCell').show();
338
                	$('.editPageTitleCell').show();
337
                	$('#editPageTitle').val(data.page.title);
339
                	$('#editPageTitle').val(data.page.title);
338
                }
340
                }
339
                
341
                
340
                if (data.page.new) {
342
                if (data.page.new) {
341
                	$('#editPageCommentCell').hide();
343
                	$('#editPageCommentCell').hide();
342
                } else {
344
                } else {
343
                	$('#editPageCommentCell').show();
345
                	$('#editPageCommentCell').show();
344
                	if (data.page.preview) {
346
                	if (data.page.preview) {
345
                		$('#editPageComment').val(data.page.comment);
347
                		$('#editPageComment').val(data.page.comment);
346
                	}
348
                	}
347
                }
349
                }
348
                
350
                
349
                $('#editPageTextArea').val(data.page.body);
351
                $('#editPageTextArea').val(data.page.body);
350
                $('#editPageName').val(data.page.name);
352
                $('#editPageName').val(data.page.name);
351
                $('#editPageLang').val(data.page.lang);
353
                $('#editPageLang').val(data.page.lang);
352
354
353
                myDialog = $('#editPageDialog');
355
                myDialog = $('#editPageDialog');
354
                myDialog = prepareEditPageDialog(myDialog, 'Editing <i><font color="darkblue">' + pageName + "</font></i> in <i>" + data.page.language.name + "<i>...");
356
                myDialog = prepareEditPageDialog(myDialog, 'Editing <i><font color="darkblue">' + pageName + "</font></i> in <i>" + data.page.language.name + "<i>...");
355
                myDialog.dialog('open');
357
                myDialog.dialog('open');
356
            });
358
            });
357
            
359
            
358
            return false;
360
            return false;
359
        }
361
        }
360
        
362
        
361
        function showFileListDialog() {
363
        function showFileListDialog() {
362
364
363
            $.getJSON('<mtw:contextPath />/File.listFiles.mtw', function(data) {
365
            $.getJSON('<mtw:contextPath />/File.listFiles.mtw', function(data) {
364
366
365
				$('#fileListTable').html('');
367
				$('#fileListTable').html('');
366
            
368
            
367
            	if (data.files.length == 0) {
369
            	if (data.files.length == 0) {
368
            		$('#fileListTable').html('<tr><td align="center">No files uploaded yet!</td></tr>');
370
            		$('#fileListTable').html('<tr><td align="center">No files uploaded yet!</td></tr>');
369
            	} else {
371
            	} else {
370
            		$.each(data.files, function(i,file) {
372
            		$.each(data.files, function(i,file) {
371
						$('#fileListTable').append('<tr><td>' + file + '</td></tr>');						            			
373
						$('#fileListTable').append('<tr><td>' + file + '</td></tr>');						            			
372
            		});
374
            		});
373
            	}
375
            	}
374
376
375
                myDialog = $('#fileListDialog');
377
                myDialog = $('#fileListDialog');
376
                myDialog = prepareFileListDialog(myDialog);
378
                myDialog = prepareFileListDialog(myDialog);
377
                myDialog.dialog('open');
379
                myDialog.dialog('open');
378
            });
380
            });
379
            
381
            
380
            return false;
382
            return false;
381
        }        
383
        }        
382
384
383
        function showShowPageDialog(pageName, lang, revision) {
385
        function showShowPageDialog(pageName, lang, revision) {
384
386
385
            $.getJSON('<mtw:contextPath />/Page.get.mtw?name=' + pageName + '&lang=' + lang + '&revision=' + revision, function(data) {
387
            $.getJSON('<mtw:contextPath />/Page.get.mtw?name=' + pageName + '&lang=' + lang + '&revision=' + revision, function(data) {
386
            
388
            
387
                if (data.page.systemPage) {
389
                if (data.page.systemPage) {
388
                    $('.showPageTitleCell').hide();
390
                    $('.showPageTitleCell').hide();
389
                } else {
391
                } else {
390
                    $('.showPageTitleCell').show();
392
                    $('.showPageTitleCell').show();
391
                    $('#showPageTitle').val(data.page.title);
393
                    $('#showPageTitle').val(data.page.title);
392
                }
394
                }
393
                $('#showPageTextArea').val(data.page.body);
395
                $('#showPageTextArea').val(data.page.body);
394
396
395
                theTitle = 'Showing <i><font color="darkblue">' + pageName + "</font></i> in <i>" + data.page.language.name + "<i>...";
397
                theTitle = 'Showing <i><font color="darkblue">' + pageName + "</font></i> in <i>" + data.page.language.name + "<i>...";
396
                if (revision > 0) {
398
                if (revision > 0) {
397
                    theTitle += ' (Revision #' + revision + ')';
399
                    theTitle += ' (Revision #' + revision + ')';
398
                }
400
                }
399
401
400
                myDialog = $('#showPageDialog');
402
                myDialog = $('#showPageDialog');
401
                myDialog = prepareShowPageDialog(myDialog, theTitle);
403
                myDialog = prepareShowPageDialog(myDialog, theTitle);
402
                myDialog.dialog('open');
404
                myDialog.dialog('open');
403
            });
405
            });
404
            
406
            
405
            return false;
407
            return false;
406
        }
408
        }
407
409
408
        
410
        
409
        function showEditPreviewDialog(pageName, lang) {
411
        function showEditPreviewDialog(pageName, lang) {
410
412
411
            $.getJSON('<mtw:contextPath />/Page.getPreview.mtw?name=' + pageName + '&lang=' + lang, function(data) {
413
            $.getJSON('<mtw:contextPath />/Page.getPreview.mtw?name=' + pageName + '&lang=' + lang, function(data) {
412
414
413
            	if (data.page.systemPage) {
415
            	if (data.page.systemPage) {
414
                	$('.editPageTitleCell').hide();
416
                	$('.editPageTitleCell').hide();
415
                } else {
417
                } else {
416
                	$('.editPageTitleCell').show();
418
                	$('.editPageTitleCell').show();
417
                	$('#editPageTitle').val(data.page.title);
419
                	$('#editPageTitle').val(data.page.title);
418
                }
420
                }
419
                
421
                
420
                if (data.page.new) {
422
                if (data.page.new) {
421
                	$('#editPageCommentCell').hide();
423
                	$('#editPageCommentCell').hide();
422
                } else {
424
                } else {
423
                	$('#editPageCommentCell').show();
425
                	$('#editPageCommentCell').show();
424
                	if (data.page.preview) {
426
                	if (data.page.preview) {
425
                		$('#editPageComment').val(data.page.comment);
427
                		$('#editPageComment').val(data.page.comment);
426
                	}
428
                	}
427
                }
429
                }
428
                
430
                
429
                
431
                
430
                $('#editPageTextArea').val(data.page.body);
432
                $('#editPageTextArea').val(data.page.body);
431
                $('#editPageName').val(data.page.name);
433
                $('#editPageName').val(data.page.name);
432
                $('#editPageLang').val(data.page.lang);
434
                $('#editPageLang').val(data.page.lang);
433
435
434
                myDialog = $('#editPageDialog');
436
                myDialog = $('#editPageDialog');
435
                myDialog = prepareEditPageDialog(myDialog, 'Editing <i><font color="darkblue">' + pageName + "</font></i> in <i>" + data.page.language.name + "<i>...");
437
                myDialog = prepareEditPageDialog(myDialog, 'Editing <i><font color="darkblue">' + pageName + "</font></i> in <i>" + data.page.language.name + "<i>...");
436
                myDialog.dialog('open');
438
                myDialog.dialog('open');
437
            });
439
            });
438
            
440
            
439
            return false;
441
            return false;
440
        }
442
        }
441
        
443
        
442
        
444
        
443
       	function showEditPreviewNewPageDialog(pageName, lang) {
445
       	function showEditPreviewNewPageDialog(pageName, lang) {
444
446
445
            $.getJSON('<mtw:contextPath />/Page.getPreview.mtw?name=' + pageName + '&lang=' + lang, function(data) {
447
            $.getJSON('<mtw:contextPath />/Page.getPreview.mtw?name=' + pageName + '&lang=' + lang, function(data) {
446
            
448
            
447
           		$('#createNewPageName').val(data.page.name);
449
           		$('#createNewPageName').val(data.page.name);
448
        		$('#createNewPageTitle').val(data.page.title);
450
        		$('#createNewPageTitle').val(data.page.title);
449
        		$('#createNewPageLanguage').val(data.page.languageId);
451
        		$('#createNewPageLanguage').val(data.page.languageId);
450
        		$('#createNewPageTextArea').val(data.page.body);
452
        		$('#createNewPageTextArea').val(data.page.body);
451
        		$('#createNewPageNameError').text('');
453
        		$('#createNewPageNameError').text('');
452
        		$('#createNewPageTitleError').text('');
454
        		$('#createNewPageTitleError').text('');
453
        		$('#createNewPageLanguageError').text('');
455
        		$('#createNewPageLanguageError').text('');
454
        		$('#createNewPageBodyError').text('');
456
        		$('#createNewPageBodyError').text('');
455
            
457
            
456
				showCreateNewPageDialog();
458
				showCreateNewPageDialog();
457
459
458
				$('#createPageLanguageCell').hide();
460
				$('#createPageLanguageCell').hide();
459
            });
461
            });
460
            
462
            
461
            return false;
463
            return false;
462
        }
464
        }
463
        
465
        
464
        function showListAllPagesDialog(isAdmin) {
466
        function showListAllPagesDialog(isAdmin) {
465
467
466
            $.getJSON('<mtw:contextPath />/Page.list.mtw', function(data) {
468
            $.getJSON('<mtw:contextPath />/Page.list.mtw', function(data) {
467
469
468
                tableData = '';
470
                tableData = '';
469
                tableData += '<tr>';
471
                tableData += '<tr>';
470
                if (isAdmin) tableData += '<th>&nbsp;</th>';
472
                if (isAdmin) tableData += '<th>&nbsp;</th>';
471
                tableData += '<th>Name</th>';
473
                tableData += '<th>Name</th>';
472
                tableData += '<th>Language</th>';
474
                tableData += '<th>Language</th>';
473
                tableData += '<th>Created By</th>';
475
                tableData += '<th>Created By</th>';
474
                tableData += '<th>Modified By</th>';
476
                tableData += '<th>Modified By</th>';
475
                tableData += '<th>&nbsp;</th>';
477
                tableData += '<th>&nbsp;</th>';
476
                tableData += '<th>&nbsp;</th>';
478
                tableData += '<th>&nbsp;</th>';
477
                tableData += '<th>&nbsp;</th>';
479
                tableData += '<th>&nbsp;</th>';
478
                tableData += '</tr>';
480
                tableData += '</tr>';
479
481
480
                $.each(data.pages, function(i,page) {
482
                $.each(data.pages, function(i,page) {
481
                
483
                
482
                	pageName = page.name;
484
                	pageName = page.name;
483
485
484
                    modifiedBy = '';
486
                    modifiedBy = '';
485
                    if (page.modifiedById > 0) {
487
                    if (page.modifiedById > 0) {
486
                        modifiedBy = page.modifiedBy.username;
488
                        modifiedBy = page.modifiedBy.username;
487
                    }
489
                    }
488
490
489
                    if (page.systemPage == true) {
491
                    if (page.systemPage == true) {
490
                        pageName = '*' + pageName;
492
                        pageName = '*' + pageName;
491
                    }
493
                    }
492
494
493
                    if (page.frontPage == true) {
495
                    if (page.frontPage == true) {
494
                        pageName = '[' + pageName + ']';
496
                        pageName = '[' + pageName + ']';
495
                    }
497
                    }
496
                    
498
                    
497
                    modifiedOnTitle = '';
499
                    modifiedOnTitle = '';
498
                    if (page.formattedModifiedOn != null) {
500
                    if (page.formattedModifiedOn != null) {
499
                    	modifiedOnTitle = ' title="' + page.formattedModifiedOn + '"';
501
                    	modifiedOnTitle = ' title="' + page.formattedModifiedOn + '"';
500
                    }
502
                    }
501
                    
503
                    
502
                    createdOnTitle = '';
504
                    createdOnTitle = '';
503
                    if (page.formattedCreatedOn != null) {
505
                    if (page.formattedCreatedOn != null) {
504
                    	createdOnTitle = ' title="' + page.formattedCreatedOn + '"';
506
                    	createdOnTitle = ' title="' + page.formattedCreatedOn + '"';
505
                    }
507
                    }
506
                    
508
                    
507
                    radioCell = '&nbsp;';
509
                    radioCell = '&nbsp;';
508
                    viewCell = '&nbsp;';
510
                    viewCell = '&nbsp;';
509
                    if (page.CSS == false && page.systemPage == false) {
511
                    if (page.CSS == false && page.systemPage == false) {
510
                    	viewCell = '<a title="View Page" tabindex="-1" href="<mtw:contextPath/>/Page.mtw?name=' + page.name + '&lang=' + page.lang + '"><img src="<mtw:contextPath/>/images/preview.png" border="0" /></a> ';
512
                    	viewCell = '<a title="View Page" tabindex="-1" href="<mtw:contextPath/>/Page.mtw?name=' + page.name + '&lang=' + page.lang + '"><img src="<mtw:contextPath/>/images/preview.png" border="0" /></a> ';
511
                    	if (page.frontPage == false) {
513
                    	if (page.frontPage == false) {
512
                    		radioCell = '<input tabindex="-1" type="radio" name="pageId" id="pageId" value="' + page.id + '" />';
514
                    		radioCell = '<input tabindex="-1" type="radio" name="pageId" id="pageId" value="' + page.id + '" />';
513
                    	}
515
                    	}
514
                    }
516
                    }
515
517
516
                    viewRevisionsCell = '<a title="View Revisions" class="revisionLink" tabindex="-1" href="#" onclick="return showListRevisionsDialog(\'' + page.name + '\',\'' + page.lang + '\',\'' + page.language.name + '\', true);"><img src="<mtw:contextPath/>/images/folder.png" height="24" height="20" border="0" /></a>';
518
                    viewRevisionsCell = '<a title="View Revisions" class="revisionLink" tabindex="-1" href="#" onclick="return showListRevisionsDialog(\'' + page.name + '\',\'' + page.lang + '\',\'' + page.language.name + '\', true);"><img src="<mtw:contextPath/>/images/folder.png" height="24" height="20" border="0" /></a>';
517
                    
519
                    
518
                    nameTitle = '';
520
                    nameTitle = '';
519
                    if (page.title != null && page.title != '') {
521
                    if (page.title != null && page.title != '') {
520
                    	nameTitle = ' title="' + page.title + '"';
522
                    	nameTitle = ' title="' + page.title + '"';
521
                    }
523
                    }
522
524
523
                    tableData += '<tr>';
525
                    tableData += '<tr>';
524
                    if (isAdmin) tableData += '<td>' + radioCell + '</td>';
526
                    if (isAdmin) tableData += '<td>' + radioCell + '</td>';
525
                    tableData += '<td' + nameTitle + '>' + pageName + '</td>';
527
                    tableData += '<td' + nameTitle + '>' + pageName + '</td>';
526
                    tableData += '<td align="center">' + page.language.name + '</td>';
528
                    tableData += '<td align="center">' + page.language.name + '</td>';
527
                    tableData += '<td align="center"' + createdOnTitle + '>' + page.createdBy.username + '</td>';
529
                    tableData += '<td align="center"' + createdOnTitle + '>' + page.createdBy.username + '</td>';
528
                    tableData += '<td align="center"' + modifiedOnTitle + '>' + modifiedBy + '</td>';
530
                    tableData += '<td align="center"' + modifiedOnTitle + '>' + modifiedBy + '</td>';
529
                    tableData += '<td align="center">' + viewCell + '</td>';
531
                    tableData += '<td align="center">' + viewCell + '</td>';
530
                    tableData += '<td align="center"><a tabindex="-1" title="View Html" href="#" onclick="return showShowPageDialog(\'' + page.name + '\',\'' + page.lang + '\', -1);"><img src="<mtw:contextPath/>/images/view.png" border="0" /></a></td>';
532
                    tableData += '<td align="center"><a tabindex="-1" title="View Html" href="#" onclick="return showShowPageDialog(\'' + page.name + '\',\'' + page.lang + '\', -1);"><img src="<mtw:contextPath/>/images/view.png" border="0" /></a></td>';
531
                    tableData += '<td align="center">' + viewRevisionsCell + '</td>';
533
                    tableData += '<td align="center">' + viewRevisionsCell + '</td>';
532
                    tableData += '</tr>';
534
                    tableData += '</tr>';
533
                });
535
                });
534
536
535
                $('#listAllPagesTable').html(tableData);
537
                $('#listAllPagesTable').html(tableData);
536
538
537
                myDialogDiv = $('#listAllPagesDialog');
539
                myDialogDiv = $('#listAllPagesDialog');
538
                myDialog = prepareListAllPagesDialog(myDialogDiv, isAdmin);
540
                myDialog = prepareListAllPagesDialog(myDialogDiv, isAdmin);
539
                myDialog.dialog('open');
541
                myDialog.dialog('open');
540
                $('.ui-dialog :button').blur();
542
                $('.ui-dialog :button').blur();
541
             });
543
             });
542
            
544
            
543
            return false;
545
            return false;
544
        }
546
        }
545
547
546
        function showListRevisionsDialog(name, lang, language, showBackButton) {
548
        function showListRevisionsDialog(name, lang, language, showBackButton) {
547
549
548
            $.getJSON('<mtw:contextPath />/Page.getRevisions.mtw?name=' + name + '&lang=' + lang, function(data) {
550
            $.getJSON('<mtw:contextPath />/Page.getRevisions.mtw?name=' + name + '&lang=' + lang, function(data) {
549
551
550
                tableData = '';
552
                tableData = '';
551
                tableData += '<tr>';
553
                tableData += '<tr>';
552
                tableData += '<th>Revision</th>';
554
                tableData += '<th>Revision</th>';
553
                tableData += '<th>Author</th>';
555
                tableData += '<th>Author</th>';
554
                tableData += '<th>Date</th>';
556
                tableData += '<th>Date</th>';
555
                
557
                
556
                if (data.isSystemPage == false) {
558
                if (data.isSystemPage == false) {
557
                    tableData += '<th>&nbsp;</th>';
559
                    tableData += '<th>&nbsp;</th>';
558
                }
560
                }
559
                tableData += '<th>&nbsp;</th>';
561
                tableData += '<th>&nbsp;</th>';
560
                tableData += '</tr>';
562
                tableData += '</tr>';
561
563
562
                $.each(data.revisions, function(i,revision) {
564
                $.each(data.revisions, function(i,revision) {
563
                
565
                
564
                	titleForComment = '';
566
                	titleForComment = '';
565
                	if (revision.comment != null && revision.comment != '') {
567
                	if (revision.comment != null && revision.comment != '') {
566
                		titleForComment = ' title="' + revision.comment + '"';
568
                		titleForComment = ' title="' + revision.comment + '"';
567
                	}
569
                	}
568
570
569
                    tableData += '<tr>';
571
                    tableData += '<tr>';
570
                    tableData += '<td' + titleForComment + '>' + revision.revision + '</td>';
572
                    tableData += '<td' + titleForComment + '>' + revision.revision + '</td>';
571
                    tableData += '<td align="center">' + revision.user.username + '</td>';
573
                    tableData += '<td align="center">' + revision.user.username + '</td>';
572
                    tableData += '<td align="center">' + revision.formattedCreatedOn + '</td>';
574
                    tableData += '<td align="center">' + revision.formattedCreatedOn + '</td>';
573
575
574
                    if (data.isSystemPage == false) {
576
                    if (data.isSystemPage == false) {
575
                        tableData += '<td align="center"><a title="View Page" tabindex="-1" href="<mtw:contextPath/>/Page.mtw?name=' + revision.name + '&lang=' + revision.lang + '&revision=' + revision.revision +'"><img src="<mtw:contextPath/>/images/preview.png" border="0" /></a></td>';
577
                        tableData += '<td align="center"><a title="View Page" tabindex="-1" href="<mtw:contextPath/>/Page.mtw?name=' + revision.name + '&lang=' + revision.lang + '&revision=' + revision.revision +'"><img src="<mtw:contextPath/>/images/preview.png" border="0" /></a></td>';
576
                    }
578
                    }
577
                    
579
                    
578
                    tableData += '<td align="center"><a tabindex="-1" title="View Html" href="#" onclick="return showShowPageDialog(\'' + revision.name + '\',\'' + revision.lang + '\',' + revision.revision + ');"><img src="<mtw:contextPath/>/images/view.png" border="0" /></a></td>';
580
                    tableData += '<td align="center"><a tabindex="-1" title="View Html" href="#" onclick="return showShowPageDialog(\'' + revision.name + '\',\'' + revision.lang + '\',' + revision.revision + ');"><img src="<mtw:contextPath/>/images/view.png" border="0" /></a></td>';
579
581
580
                    tableData += '</tr>';
582
                    tableData += '</tr>';
581
                });
583
                });
582
584
583
                $('#listRevisionsTable').html(tableData);
585
                $('#listRevisionsTable').html(tableData);
584
                myDialog = $('#listRevisionsDialog');
586
                myDialog = $('#listRevisionsDialog');
585
                myDialog = prepareListRevisionsDialog(myDialog, name, language, showBackButton);
587
                myDialog = prepareListRevisionsDialog(myDialog, name, language, showBackButton);
586
                myDialog.dialog('open');
588
                myDialog.dialog('open');
587
                $('.ui-dialog :button').blur();
589
                $('.ui-dialog :button').blur();
588
             });
590
             });
589
            
591
            
590
            return false;
592
            return false;
591
        }
593
        }
592
        
594
        
593
        function showListLastRevisionsDialog(lang, language, isLogged) {
595
        function showListLastRevisionsDialog(lang, language, isLogged) {
594
596
595
            $.getJSON('<mtw:contextPath />/Page.getLastRevisions.mtw?lang=' + lang, function(data) {
597
            $.getJSON('<mtw:contextPath />/Page.getLastRevisions.mtw?lang=' + lang, function(data) {
596
598
597
                tableData = '';
599
                tableData = '';
598
                tableData += '<tr>';
600
                tableData += '<tr>';
599
                tableData += '<th>Page</th>';
601
                tableData += '<th>Page</th>';
600
                tableData += '<th>Revision</th>';
602
                tableData += '<th>Revision</th>';
601
                tableData += '<th>Author</th>';
603
                tableData += '<th>Author</th>';
602
                tableData += '<th>Date</th>';
604
                tableData += '<th>Date</th>';
603
                tableData += '<th>Comment</th>';
605
                tableData += '<th>Comment</th>';
604
                tableData += '<th>&nbsp;</th>';
606
                tableData += '<th>&nbsp;</th>';
605
607
606
                if (isLogged) {
608
                if (isLogged) {
607
                    tableData += '<th>&nbsp;</th>';
609
                    tableData += '<th>&nbsp;</th>';
608
                }
610
                }
609
                
611
                
610
                tableData += '</tr>';
612
                tableData += '</tr>';
611
613
612
                $.each(data.revisions, function(i,revision) {
614
                $.each(data.revisions, function(i,revision) {
613
                
615
                
614
                    tableData += '<tr>';
616
                    tableData += '<tr>';
615
                    
617
                    
616
                    pageName = revision.name;
618
                    pageName = revision.name;
617
                    
619
                    
618
                    if (revision.frontPage) {
620
                    if (revision.frontPage) {
619
                    	pageName = '[' + pageName + ']';
621
                    	pageName = '[' + pageName + ']';
620
                    } else if (revision.systemPage) {
622
                    } else if (revision.systemPage) {
621
                    	pageName = '*' + pageName;
623
                    	pageName = '*' + pageName;
622
                    }
624
                    }
623
625
624
                    nameTitle = '';
626
                    nameTitle = '';
625
                    if (revision.title != null && revision.title != '') {
627
                    if (revision.title != null && revision.title != '') {
626
                    	nameTitle = ' title="' + revision.title + '"';
628
                    	nameTitle = ' title="' + revision.title + '"';
627
                    }
629
                    }
628
                    
630
                    
629
                    tableData += '<td' + nameTitle + ' align="center">' + pageName + '</td>';
631
                    tableData += '<td' + nameTitle + ' align="center">' + pageName + '</td>';
630
                    tableData += '<td align="center">' + revision.revision + '</td>';
632
                    tableData += '<td align="center">' + revision.revision + '</td>';
631
                    tableData += '<td align="center">' + revision.user.username + '</td>';
633
                    tableData += '<td align="center">' + revision.user.username + '</td>';
632
                    tableData += '<td align="center">' + revision.formattedCreatedOn + '</td>';
634
                    tableData += '<td align="center">' + revision.formattedCreatedOn + '</td>';
633
                    tableData += '<td align="left">' + revision.comment + '</td>';
635
                    tableData += '<td align="left">' + revision.comment + '</td>';
634
636
635
					if (!revision.systemPage) {
637
					if (!revision.systemPage) {
636
                    	tableData += '<td align="center"><a title="View Page" tabindex="-1" href="<mtw:contextPath/>/Page.mtw?name=' + revision.name + '&lang=' + revision.lang + '&revision=' + revision.revision +'"><img src="<mtw:contextPath/>/images/preview.png" border="0" /></a></td>';
638
                    	tableData += '<td align="center"><a title="View Page" tabindex="-1" href="<mtw:contextPath/>/Page.mtw?name=' + revision.name + '&lang=' + revision.lang + '&revision=' + revision.revision +'"><img src="<mtw:contextPath/>/images/preview.png" border="0" /></a></td>';
637
                    } else {
639
                    } else {
638
                    	tableData += '<td>&nbsp;</td>';
640
                    	tableData += '<td>&nbsp;</td>';
639
                    }
641
                    }
640
642
641
                    if (isLogged) {
643
                    if (isLogged) {
642
                        tableData += '<td align="center"><a tabindex="-1" title="View Html" href="#" onclick="return showShowPageDialog(\'' + revision.name + '\',\'' + revision.lang + '\',' + revision.revision + ');"><img src="<mtw:contextPath/>/images/view.png" border="0" /></a></td>';
644
                        tableData += '<td align="center"><a tabindex="-1" title="View Html" href="#" onclick="return showShowPageDialog(\'' + revision.name + '\',\'' + revision.lang + '\',' + revision.revision + ');"><img src="<mtw:contextPath/>/images/view.png" border="0" /></a></td>';
643
                    }
645
                    }
644
                    
646
                    
645
                    tableData += '</tr>';
647
                    tableData += '</tr>';
646
                });
648
                });
647
649
648
                $('#listLastRevisionsTable').html(tableData);
650
                $('#listLastRevisionsTable').html(tableData);
649
                myDialog = $('#listLastRevisionsDialog');
651
                myDialog = $('#listLastRevisionsDialog');
650
                myDialog = prepareListLastRevisionsDialog(myDialog, language);
652
                myDialog = prepareListLastRevisionsDialog(myDialog, language);
651
                myDialog.dialog('open');
653
                myDialog.dialog('open');
652
                $('.ui-dialog :button').blur();
654
                $('.ui-dialog :button').blur();
653
             });
655
             });
654
            
656
            
655
            return false;
657
            return false;
656
        }
658
        }
657
659
658
660
659
       	function showCreateNewPageDialog() {
661
       	function showCreateNewPageDialog() {
660
662
661
            $('#createNewPageFormName').val('<mtw:out value="bodyColumn.name" />');
663
            $('#createNewPageFormName').val('<mtw:out value="bodyColumn.name" />');
662
            $('#createNewPageFormLang').val('<mtw:out value="bodyColumn.lang" />');
664
            $('#createNewPageFormLang').val('<mtw:out value="bodyColumn.lang" />');
663
            $('#createPageLanguageCell').show();
665
            $('#createPageLanguageCell').show();
664
666
665
            myDialog = $('#createNewPageDialog');
667
            myDialog = $('#createNewPageDialog');
666
            myDialog = prepareCreateNewPageDialog(myDialog);
668
            myDialog = prepareCreateNewPageDialog(myDialog);
667
            myDialog.dialog('open');
669
            myDialog.dialog('open');
668
            
670
            
669
            return false;
671
            return false;
670
        }
672
        }
671
        
673
        
672
        function prepareCreateNewPageDialog(myDialog) {
674
        function prepareCreateNewPageDialog(myDialog) {
673
675
674
            options = {
676
            options = {
675
            	close: function() { clearCreateNewPageForm(); },
677
            	close: function() { clearCreateNewPageForm(); },
676
                autoOpen: false,
678
                autoOpen: false,
677
                width: 800,
679
                width: 800,
678
                modal: true,
680
                modal: true,
679
                title: "Create New Page:",
681
                title: "Create New Page:",
680
                buttons: [
682
                buttons: [
681
                          {
683
                          {
682
                                text: "Create",
684
                                text: "Create",
683
                                click: function() { $('#createNewPageForm').submit(); }
685
                                click: function() { $('#createNewPageForm').submit(); }
684
                          },
686
                          },
685
                          {
687
                          {
686
                              text: "Preview",
688
                              text: "Preview",
687
                              click: function() { $('#createNewPageFormPreview').val('true'); $('#createNewPageForm').submit(); }
689
                              click: function() { $('#createNewPageFormPreview').val('true'); $('#createNewPageForm').submit(); }
688
                          },
690
                          },
689
                          {
691
                          {
690
                                text: "Cancel",
692
                                text: "Cancel",
691
                                click: function() {  $(this).dialog("close"); }
693
                                click: function() {  $(this).dialog("close"); }
692
                          }
694
                          }
693
                      ]
695
                      ]
694
           };
696
           };
695
697
696
          myDialog.dialog(options);
698
          myDialog.dialog(options);
697
699
698
          return myDialog;
700
          return myDialog;
699
        }
701
        }
700
        
702
        
701
        function showFileUploadDialog() {
703
        function showFileUploadDialog() {
702
  			
704
  			
703
  			$('#uploadResults').html('');
705
  			$('#uploadResults').html('');
704
        
706
        
705
        	myDialog = $('#fileUploadDialog');
707
        	myDialog = $('#fileUploadDialog');
706
        	myDialog = prepareFileUploadDialog(myDialog);
708
        	myDialog = prepareFileUploadDialog(myDialog);
707
        	myDialog.dialog('open');
709
        	myDialog.dialog('open');
708
        }
710
        }
709
        
711
        
710
    
712
    
711
        function showLoginDialog() {
713
        function showLoginDialog() {
712
714
713
            $('#loginFormName').val('<mtw:out value="bodyColumn.name" />');
715
            $('#loginFormName').val('<mtw:out value="bodyColumn.name" />');
714
            $('#loginFormLang').val('<mtw:out value="bodyColumn.lang" />');
716
            $('#loginFormLang').val('<mtw:out value="bodyColumn.lang" />');
715
717
716
            myDialog = $('#loginDialog');
718
            myDialog = $('#loginDialog');
717
            myDialog = prepareLoginDialog(myDialog);
719
            myDialog = prepareLoginDialog(myDialog);
718
            myDialog.dialog('open');
720
            myDialog.dialog('open');
719
721
720
            return false;
722
            return false;
721
        }
723
        }
722
724
723
        function showAddNewUserDialog(hideUsernameMessage) {
725
        function showAddNewUserDialog(hideUsernameMessage) {
724
726
725
            myDialog = $('#addNewUserDialog');
727
            myDialog = $('#addNewUserDialog');
726
            myDialog = prepareAddNewUserDialog(myDialog, hideUsernameMessage);
728
            myDialog = prepareAddNewUserDialog(myDialog, hideUsernameMessage);
727
            myDialog.dialog('open');
729
            myDialog.dialog('open');
728
730
729
            return false;
731
            return false;
730
        }
732
        }
731
        
733
        
732
        function clearLoginForm() {
734
        function clearLoginForm() {
733
        	$('#loginUsername').val('');
735
        	$('#loginUsername').val('');
734
        	$('#loginPassword').val('');
736
        	$('#loginPassword').val('');
735
        	$('#loginUsernameError').text('');
737
        	$('#loginUsernameError').text('');
736
        	$('#loginPasswordError').text('');
738
        	$('#loginPasswordError').text('');
737
        }
739
        }
738
740
739
        function clearAddNewUserForm() {
741
        function clearAddNewUserForm() {
740
        	$('#addNewUserUsername').val('');
742
        	$('#addNewUserUsername').val('');
741
        	$('#addNewUserPassword').val('');
743
        	$('#addNewUserPassword').val('');
742
        	$('#addNewUserPassconf').val('');
744
        	$('#addNewUserPassconf').val('');
743
        	$('#addNewUserGroup').val('');
745
        	$('#addNewUserGroup').val('');
744
        	$('#usernameMessage').text('');
746
        	$('#usernameMessage').text('');
745
        	$('#addNewUserPasswordError').text('');
747
        	$('#addNewUserPasswordError').text('');
746
        	$('#addNewUserPassconfError').text('');
748
        	$('#addNewUserPassconfError').text('');
747
        	$('#addNewUserGroupError').text('');
749
        	$('#addNewUserGroupError').text('');
748
        }
750
        }
749
        
751
        
750
        function clearCreateNewPageForm() {
752
        function clearCreateNewPageForm() {
751
        	$('#createNewPageName').val('');
753
        	$('#createNewPageName').val('');
752
        	$('#createNewPageTitle').val('');
754
        	$('#createNewPageTitle').val('');
753
        	$('#createNewPageLanguage').val('');
755
        	$('#createNewPageLanguage').val('');
754
        	$('#createNewPageTextArea').val('');
756
        	$('#createNewPageTextArea').val('');
755
        	$('#createNewPageNameError').text('');
757
        	$('#createNewPageNameError').text('');
756
        	$('#createNewPageTitleError').text('');
758
        	$('#createNewPageTitleError').text('');
757
        	$('#createNewPageLanguageError').text('');
759
        	$('#createNewPageLanguageError').text('');
758
        	$('#createNewPageBodyError').text('');
760
        	$('#createNewPageBodyError').text('');
759
        }
761
        }
760
        
762
        
761
      	function prepareLoginDialog(myDialog) {
763
      	function prepareLoginDialog(myDialog) {
762
764
763
            options = {
765
            options = {
764
            	close: function() { clearLoginForm(); },
766
            	close: function() { clearLoginForm(); },
765
                autoOpen: false,
767
                autoOpen: false,
766
                width: 290,
768
                width: 290,
767
                modal: true,
769
                modal: true,
768
                title: "Login:",
770
                title: "Login:",
769
                buttons: [
771
                buttons: [
770
                          {
772
                          {
771
                                text: "Login",
773
                                text: "Login",
772
                                click: function() { $('#loginForm').submit(); }
774
                                click: function() { $('#loginForm').submit(); }
773
                          },
775
                          },
774
                          {
776
                          {
775
                                text: "Cancel",
777
                                text: "Cancel",
776
                                click: function() {  $(this).dialog("close"); }
778
                                click: function() {  $(this).dialog("close"); }
777
                          }
779
                          }
778
                      ]
780
                      ]
779
           };
781
           };
780
782
781
          myDialog.dialog(options);
783
          myDialog.dialog(options);
782
784
783
          return myDialog;
785
          return myDialog;
784
        }
786
        }
785
787
786
        function prepareAddNewUserDialog(myDialog, hideUsernameMessage) {
788
        function prepareAddNewUserDialog(myDialog, hideUsernameMessage) {
787
789
788
        	$('#usernameLoading').hide();
790
        	$('#usernameLoading').hide();
789
            if (hideUsernameMessage) $('#usernameMessage').text('');
791
            if (hideUsernameMessage) $('#usernameMessage').text('');
790
792
791
            options = {
793
            options = {
792
                close: function() { clearAddNewUserForm(); },
794
                close: function() { clearAddNewUserForm(); },
793
                autoOpen: false,
795
                autoOpen: false,
794
                width: 550,
796
                width: 550,
795
                modal: true,
797
                modal: true,
796
                title: "Add New User:",
798
                title: "Add New User:",
797
                buttons: [
799
                buttons: [
798
                          {
800
                          {
799
                                text: "Add",
801
                                text: "Add",
800
                                click: function() { $('#addNewUserForm').submit(); }
802
                                click: function() { $('#addNewUserForm').submit(); }
801
                          },
803
                          },
802
                          {
804
                          {
803
                                text: "Cancel",
805
                                text: "Cancel",
804
                                click: function() {  $(this).dialog("close"); }
806
                                click: function() {  $(this).dialog("close"); }
805
                          }
807
                          }
806
                      ]
808
                      ]
807
           };
809
           };
808
810
809
          myDialog.dialog(options);
811
          myDialog.dialog(options);
810
812
811
          return myDialog;
813
          return myDialog;
812
        }
814
        }
813
        
815
        
814
      	function prepareConfirmDialog(myDialog) {
816
      	function prepareConfirmDialog(myDialog) {
815
817
816
            options = {
818
            options = {
817
                autoOpen: false,
819
                autoOpen: false,
818
                width: 300,
820
                width: 300,
819
                modal: true,
821
                modal: true,
820
                title: "Confirmation:",
822
                title: "Confirmation:",
821
                buttons: [
823
                buttons: [
822
                          {
824
                          {
823
                                text: "Yes",
825
                                text: "Yes",
824
                                click: function() { $(this).dialog("close"); }
826
                                click: function() { $(this).dialog("close"); }
825
                          },
827
                          },
826
                          {
828
                          {
827
                                text: "No",
829
                                text: "No",
828
                                click: function() {  $(this).dialog("close"); }
830
                                click: function() {  $(this).dialog("close"); }
829
                          }
831
                          }
830
                      ]
832
                      ]
831
           };
833
           };
832
834
833
          myDialog.dialog(options);
835
          myDialog.dialog(options);
834
836
835
          return myDialog;
837
          return myDialog;
836
        }
838
        }
837
        
839
        
838
         function showConfirmDialog() {
840
         function showConfirmDialog() {
839
841
840
            myDialog = $('#confirmDialog');
842
            myDialog = $('#confirmDialog');
841
            myDialog = prepareConfirmDialog(myDialog);
843
            myDialog = prepareConfirmDialog(myDialog);
842
            myDialog.dialog('open');
844
            myDialog.dialog('open');
843
845
844
            return false;
846
            return false;
845
        }
847
        }
846
        
848
        
847
        function usernameResult(response) {
849
        function usernameResult(response) {
848
        
850
        
849
                $('#usernameLoading').hide();
851
                $('#usernameLoading').hide();
850
        
852
        
851
                var res = unescape(response);
853
                var res = unescape(response);
852
        
854
        
853
                if (res == "error") {
855
                if (res == "error") {
854
        
856
        
855
                    $('#usernameMessage')
857
                    $('#usernameMessage')
856
                            .html(
858
                            .html(
857
                                    '<font color="red"><b>Error!</b></font>');
859
                                    '<font color="red"><b>Error!</b></font>');
858
                    $('#usernameMessage').fadeIn();
860
                    $('#usernameMessage').fadeIn();
859
        
861
        
860
                } else if (res == "success") {
862
                } else if (res == "success") {
861
        
863
        
862
                    $('#usernameMessage').html(
864
                    $('#usernameMessage').html(
863
                            '<img src="<mtw:contextPath />/images/chk.gif" />');
865
                            '<img src="<mtw:contextPath />/images/chk.gif" />');
864
                    $('#usernameMessage').fadeIn();
866
                    $('#usernameMessage').fadeIn();
865
        
867
        
866
                } else if (res == "already") {
868
                } else if (res == "already") {
867
        
869
        
868
                    $('#usernameMessage')
870
                    $('#usernameMessage')
869
                            .html(
871
                            .html(
870
                                    '<font color="red"><b>Username already exists!</b></font>');
872
                                    '<font color="red"><b>Username already exists!</b></font>');
871
                    $('#usernameMessage').fadeIn();
873
                    $('#usernameMessage').fadeIn();
872
                }
874
                }
873
            }
875
            }
874
        </script>
876
        </script>
875
        
877
        
876
		<%@ include file="google_analytics.jsp" %>       
878
		<%@ include file="google_analytics.jsp" %>       
877
879
878
</head>
880
</head>
879
881
880
<body class="composite">
882
<body class="composite">
881
883
882
<!--  For adding username -->
884
<!--  For adding username -->
883
<div id="addNewUserDialog" style="display: none;">
885
<div id="addNewUserDialog" style="display: none;">
884
        <form action="<mtw:contextPath />/User.add.mtw" method="post" id="addNewUserForm">
886
        <form action="<mtw:contextPath />/User.add.mtw" method="post" id="addNewUserForm">
885
            <table>
887
            <table>
886
                <tr>
888
                <tr>
887
                    <td width="10%">
889
                    <td width="10%">
888
                        Username:
890
                        Username:
889
                    </td>
891
                    </td>
890
                    <td>
892
                    <td>
891
                        <mtw:input name="username" id="addNewUserUsername" size="20" maxlength="30" />
893
                        <mtw:input name="username" id="addNewUserUsername" size="20" maxlength="30" />
892
                        <span id="usernameLoading">
894
                        <span id="usernameLoading">
893
                            <img src="<mtw:contextPath />/images/loading.gif" />
895
                            <img src="<mtw:contextPath />/images/loading.gif" />
894
                        </span>
896
                        </span>
895
                        <span id="usernameMessage">
897
                        <span id="usernameMessage">
896
                            <mtw:outError field="username">
898
                            <mtw:outError field="username">
897
                                <font color="red">
899
                                <font color="red">
898
                                    <b><mtw:out /></b>
900
                                    <b><mtw:out /></b>
899
                                </font>
901
                                </font>
900
                            </mtw:outError>
902
                            </mtw:outError>
901
                        </span>
903
                        </span>
902
                    </td>
904
                    </td>
903
                </tr>
905
                </tr>
904
                <tr>
906
                <tr>
905
                    <td>
907
                    <td>
906
                        Password:
908
                        Password:
907
                    </td>
909
                    </td>
908
                    <td>
910
                    <td>
909
                        <mtw:input name="password" type="password" size="20" maxlength="20" id="addNewUserPassword" /> 
911
                        <mtw:input name="password" type="password" size="20" maxlength="20" id="addNewUserPassword" /> 
910
                        <span id="addNewUserPasswordError">
912
                        <span id="addNewUserPasswordError">
911
                            <mtw:outError field="password">
913
                            <mtw:outError field="password">
912
                                <font color="red">
914
                                <font color="red">
913
                                    <b><mtw:out /></b>
915
                                    <b><mtw:out /></b>
914
                                </font>
916
                                </font>
915
                        </mtw:outError>
917
                        </mtw:outError>
916
                        </span>
918
                        </span>
917
                    </td>
919
                    </td>
918
                </tr>
920
                </tr>
919
                <tr>
921
                <tr>
920
                    <td>
922
                    <td>
921
                        Confirm:
923
                        Confirm:
922
                    </td>
924
                    </td>
923
                    <td>
925
                    <td>
924
                        <mtw:input name="passconf" type="password" size="20" maxlength="20" id="addNewUserPassconf" /> 
926
                        <mtw:input name="passconf" type="password" size="20" maxlength="20" id="addNewUserPassconf" /> 
925
                        <span id="addNewUserPassconfError">
927
                        <span id="addNewUserPassconfError">
926
                            <mtw:outError field="passconf">
928
                            <mtw:outError field="passconf">
927
                                <font color="red">
929
                                <font color="red">
928
                                <b><mtw:out /></b>
930
                                <b><mtw:out /></b>
929
                            </font>
931
                            </font>
930
                        </mtw:outError>
932
                        </mtw:outError>
931
                        </span>
933
                        </span>
932
                    </td>
934
                    </td>
933
                </tr>
935
                </tr>
934
                <tr>
936
                <tr>
935
                    <td>
937
                    <td>
936
                        Group:
938
                        Group:
937
                    </td>
939
                    </td>
938
                    <td>
940
                    <td>
939
                        <mtw:select name="groupId" list="groups" emptyField="true" id="addNewUserGroup" />
941
                        <mtw:select name="groupId" list="groups" emptyField="true" id="addNewUserGroup" />
940
                        <span id="addNewUserGroupError">
942
                        <span id="addNewUserGroupError">
941
                        <mtw:outError field="groupId">
943
                        <mtw:outError field="groupId">
942
                            <font color="red">
944
                            <font color="red">
943
                                <b><mtw:out /></b>
945
                                <b><mtw:out /></b>
944
                            </font>
946
                            </font>
945
                        </mtw:outError>
947
                        </mtw:outError>
946
                        </span>
948
                        </span>
947
                    </td>
949
                    </td>
948
                </tr>
950
                </tr>
949
            </table>
951
            </table>
950
        </form>
952
        </form>
951
</div>
953
</div>
952
954
953
<!-- For Testing -->
955
<!-- For Testing -->
954
<div id="dialog" title="Dialog Title" style="display: none;">I'm in a dialog</div>
956
<div id="dialog" title="Dialog Title" style="display: none;">I'm in a dialog</div>
955
957
956
<!-- Close Confirm -->
958
<!-- Close Confirm -->
957
<div id="confirmDialog" style="display: none;">
959
<div id="confirmDialog" style="display: none;">
958
	<span id="confirmMessage">The confirmation message goes here.</span>
960
	<span id="confirmMessage">The confirmation message goes here.</span>
959
</div>
961
</div>
960
962
961
<!-- For file upload -->
963
<!-- For file upload -->
962
<div id="fileUploadDialog" style="display: none;">
964
<div id="fileUploadDialog" style="display: none;">
963
<br/>
965
<br/>
964
<input id="file_upload" name="file_upload" type="file" />
966
<input id="file_upload" name="file_upload" type="file" />
965
<table cellspacing="2" cellpadding="5" id="uploadResults" style="margin-top: 10px;">
967
<table cellspacing="2" cellpadding="5" id="uploadResults" style="margin-top: 10px;">
966
</table>
968
</table>
967
</div>
969
</div>
968
970
969
<!-- For files listing -->
971
<!-- For files listing -->
970
<div id="fileListDialog" style="display: none;">
972
<div id="fileListDialog" style="display: none;">
971
<table cellspacing="2" cellpadding="5" id="fileListTable" style="margin-top: 10px;">
973
<table cellspacing="2" cellpadding="5" id="fileListTable" style="margin-top: 10px;">
972
</table>
974
</table>
973
</div>
975
</div>
974
976
975
<!-- For Editing Pages -->
977
<!-- For Editing Pages -->
976
<div id="editPageDialog" style="display: none;">
978
<div id="editPageDialog" style="display: none;">
977
<form id="editPageForm" action="<mtw:contextPath />/Page.edit.mtw" method="post">
979
<form id="editPageForm" action="<mtw:contextPath />/Page.edit.mtw" method="post">
978
<input type="hidden" name="name" id ="editPageName" value="" />
980
<input type="hidden" name="name" id ="editPageName" value="" />
979
<input type="hidden" name="lang" id="editPageLang" value="" />
981
<input type="hidden" name="lang" id="editPageLang" value="" />
980
<input type="hidden" name="isPreview" id="editPagePreview" value="false" />
982
<input type="hidden" name="isPreview" id="editPagePreview" value="false" />
981
<table border="0">
983
<table border="0">
982
    <tr>
984
    <tr>
983
        <td>&nbsp;</td>
985
        <td>&nbsp;</td>
984
    </tr>
986
    </tr>
985
                <tr class="editPageTitleCell">
987
                <tr class="editPageTitleCell">
986
                    <td>
988
                    <td>
987
                        Title:&nbsp;&nbsp;&nbsp;&nbsp;
989
                        Title:&nbsp;&nbsp;&nbsp;&nbsp;
988
                        <mtw:input id="editPageTitle" name="title" size="40" maxlength="100" />
990
                        <mtw:input id="editPageTitle" name="title" size="40" maxlength="100" />
989
                        <span id="editPageTitleError">
991
                        <span id="editPageTitleError">
990
                        <mtw:outError field="title">
992
                        <mtw:outError field="title">
991
                            <font color="red">
993
                            <font color="red">
992
                                <b><mtw:out /></b>
994
                                <b><mtw:out /></b>
993
                            </font>
995
                            </font>
994
                        </mtw:outError>
996
                        </mtw:outError>
995
                        </span>
997
                        </span>
996
                    </td>
998
                    </td>
997
                </tr>
999
                </tr>
998
                <tr class="editPageTitleCell"><td colspan="2">&nbsp;</td></tr>
1000
                <tr class="editPageTitleCell"><td colspan="2">&nbsp;</td></tr>
999
    <tr>
1001
    <tr>
1000
        <td><mtw:textarea id="editPageTextArea" name="body" style="width: 100%; height: 465px;" />
1002
        <td><mtw:textarea id="editPageTextArea" name="body" style="width: 100%; height: 465px;" />
1001
        <span id="editPageTextAreaError">
1003
        <span id="editPageTextAreaError">
1002
                        <mtw:outError field="body">
1004
                        <mtw:outError field="body">
1003
                            <font color="red">
1005
                            <font color="red">
1004
                                <b><mtw:out /></b>
1006
                                <b><mtw:out /></b>
1005
                            </font>
1007
                            </font>
1006
                        </mtw:outError>
1008
                        </mtw:outError>
1007
                        </span>
1009
                        </span>
1008
        
1010
        
1009
        </td>
1011
        </td>
1010
    </tr>
1012
    </tr>
1011
    
1013
    
1012
    <tr id="editPageCommentCell">
1014
    <tr id="editPageCommentCell">
1013
                    <td width="20%">
1015
                    <td width="20%">
1014
                        Edit comment: (<i>optional</i>) &nbsp;&nbsp;&nbsp;&nbsp;
1016
                        Edit comment: (<i>optional</i>) &nbsp;&nbsp;&nbsp;&nbsp;
1015
                        <mtw:input id="editPageComment" name="comment" size="40" maxlength="60" />
1017
                        <mtw:input id="editPageComment" name="comment" size="40" maxlength="60" />
1016
                        <span id="editPageCommentError">
1018
                        <span id="editPageCommentError">
1017
                        <mtw:outError field="comment">
1019
                        <mtw:outError field="comment">
1018
                            <font color="red">
1020
                            <font color="red">
1019
                                <b><mtw:out /></b>
1021
                                <b><mtw:out /></b>
1020
                            </font>
1022
                            </font>
1021
                        </mtw:outError>
1023
                        </mtw:outError>
1022
                        </span>
1024
                        </span>
1023
                    </td>
1025
                    </td>
1024
                </tr>
1026
                </tr>
1025
    
1027
    
1026
</table>
1028
</table>
1027
</form>
1029
</form>
1028
</div>
1030
</div>
1029
1031
1030
<!-- For Showing Page Html -->
1032
<!-- For Showing Page Html -->
1031
<div id="showPageDialog" style="display: none;">
1033
<div id="showPageDialog" style="display: none;">
1032
<form id="showPageForm">
1034
<form id="showPageForm">
1033
<table>
1035
<table>
1034
    <tr>
1036
    <tr>
1035
        <td>&nbsp;</td>
1037
        <td>&nbsp;</td>
1036
    </tr>
1038
    </tr>
1037
                <tr class="showPageTitleCell">
1039
                <tr class="showPageTitleCell">
1038
                    <td>
1040
                    <td>
1039
                        Title:
1041
                        Title:
1040
                    </td>
1042
                    </td>
1041
                    <td>
1043
                    <td>
1042
                        <mtw:input id="showPageTitle" name="title" size="40" maxlength="100" extra="readonly=readonly" />
1044
                        <mtw:input id="showPageTitle" name="title" size="40" maxlength="100" extra="readonly=readonly" />
1043
                    </td>
1045
                    </td>
1044
                </tr>
1046
                </tr>
1045
                <tr class="showPageTitleCell"><td>&nbsp;</td></tr>
1047
                <tr class="showPageTitleCell"><td>&nbsp;</td></tr>
1046
    <tr>
1048
    <tr>
1047
        <td colspan="2">
1049
        <td colspan="2">
1048
        <mtw:textarea id="showPageTextArea" name="body" style="width: 100%; height: 465px;" extra="readonly=readonly" />
1050
        <mtw:textarea id="showPageTextArea" name="body" style="width: 100%; height: 465px;" extra="readonly=readonly" />
1049
        </td>
1051
        </td>
1050
    </tr>
1052
    </tr>
1051
</table>
1053
</table>
1052
</form>
1054
</form>
1053
</div>
1055
</div>
1054
1056
1055
1057
1056
<!-- For Login -->
1058
<!-- For Login -->
1057
<div id="loginDialog" style="display: none;">
1059
<div id="loginDialog" style="display: none;">
1058
		<form action="<mtw:contextPath />/Login.mtw" method="post" id="loginForm">
1060
		<form action="<mtw:contextPath />/Login.mtw" method="post" id="loginForm">
1059
            <input type="hidden" name="name" value="" id="loginFormName" />
1061
            <input type="hidden" name="name" value="" id="loginFormName" />
1060
            <input type="hidden" name="lang" value="" id="loginFormLang" />
1062
            <input type="hidden" name="lang" value="" id="loginFormLang" />
1061
			<table>
1063
			<table>
1062
				<tr>
1064
				<tr>
1063
					<td>
1065
					<td>
1064
						Username:
1066
						Username:
1065
					</td>
1067
					</td>
1066
					<td>
1068
					<td>
1067
						<mtw:input id="loginUsername" name="username" size="20" maxlength="20" />
1069
						<mtw:input id="loginUsername" name="username" size="20" maxlength="20" />
1068
						<span id="loginUsernameError">
1070
						<span id="loginUsernameError">
1069
						<mtw:outError field="username">
1071
						<mtw:outError field="username">
1070
							<font color="red">
1072
							<font color="red">
1071
								<b><mtw:out /></b>
1073
								<b><mtw:out /></b>
1072
							</font>
1074
							</font>
1073
						</mtw:outError>
1075
						</mtw:outError>
1074
						</span>
1076
						</span>
1075
					</td>
1077
					</td>
1076
				</tr>
1078
				</tr>
1077
				<tr>
1079
				<tr>
1078
					<td>
1080
					<td>
1079
						Password:
1081
						Password:
1080
					</td>
1082
					</td>
1081
					<td>
1083
					<td>
1082
						<mtw:input id="loginPassword" name="password" type="password" size="20" maxlength="20" />
1084
						<mtw:input id="loginPassword" name="password" type="password" size="20" maxlength="20" />
1083
						<span id="loginPasswordError"> 
1085
						<span id="loginPasswordError"> 
1084
						<mtw:outError field="password">
1086
						<mtw:outError field="password">
1085
							<font color="red">
1087
							<font color="red">
1086
								<b><mtw:out /></b>
1088
								<b><mtw:out /></b>
1087
							</font>
1089
							</font>
1088
						</mtw:outError>
1090
						</mtw:outError>
1089
						</span>
1091
						</span>
1090
					</td>
1092
					</td>
1091
				</tr>
1093
				</tr>
1092
			</table>
1094
			</table>
1093
		</form>
1095
		</form>
1094
</div>
1096
</div>
1095
1097
1096
<!-- For displaying all pages -->
1098
<!-- For displaying all pages -->
1097
<div id="listAllPagesDialog" style="display: none;">
1099
<div id="listAllPagesDialog" style="display: none;">
1098
    <form action="#" method="post" id="listAllPagesForm">
1100
    <form action="#" method="post" id="listAllPagesForm">
1099
    <table id="listAllPagesTable">
1101
    <table id="listAllPagesTable">
1100
    </table>
1102
    </table>
1101
    </form>
1103
    </form>
1102
</div>
1104
</div>
1103
1105
1104
1106
1105
<!-- For displaying revisions -->
1107
<!-- For displaying revisions -->
1106
<div id="listRevisionsDialog" style="display: none;">
1108
<div id="listRevisionsDialog" style="display: none;">
1107
    <table class="revisionsTable" id="listRevisionsTable">
1109
    <table class="revisionsTable" id="listRevisionsTable">
1108
    </table>
1110
    </table>
1109
</div>
1111
</div>
1110
1112
1111
<!-- For displaying last revisions -->
1113
<!-- For displaying last revisions -->
1112
<div id="listLastRevisionsDialog" style="display: none;">
1114
<div id="listLastRevisionsDialog" style="display: none;">
1113
    <table class="revisionsTable" id="listLastRevisionsTable">
1115
    <table class="revisionsTable" id="listLastRevisionsTable">
1114
    </table>
1116
    </table>
1115
</div>
1117
</div>
1116
1118
1117
1119
1118
<!-- Create New Page -->
1120
<!-- Create New Page -->
1119
<div id="createNewPageDialog" style="display: none;">
1121
<div id="createNewPageDialog" style="display: none;">
1120
		<form action="<mtw:contextPath />/Page.add.mtw" method="post" id="createNewPageForm">
1122
		<form action="<mtw:contextPath />/Page.add.mtw" method="post" id="createNewPageForm">
1121
            <input type="hidden" name="name" value="" id="createNewPageFormName" />
1123
            <input type="hidden" name="name" value="" id="createNewPageFormName" />
1122
            <input type="hidden" name="lang" value="" id="createNewPageFormLang" />
1124
            <input type="hidden" name="lang" value="" id="createNewPageFormLang" />
1123
            <input type="hidden" name="isPreview" value="false" id="createNewPageFormPreview" />
1125
            <input type="hidden" name="isPreview" value="false" id="createNewPageFormPreview" />
1124
			<table>
1126
			<table>
1125
				<tr>
1127
				<tr>
1126
					<td>
1128
					<td>
1127
						Name:
1129
						Name:
1128
					</td>
1130
					</td>
1129
					<td>
1131
					<td>
1130
						<mtw:input id="createNewPageName" name="newPage.name" size="40" maxlength="30" />
1132
						<mtw:input id="createNewPageName" name="newPage.name" size="40" maxlength="30" />
1131
						<span id="createNewPageNameError">
1133
						<span id="createNewPageNameError">
1132
						<mtw:outError field="newPage.name">
1134
						<mtw:outError field="newPage.name">
1133
							<font color="red">
1135
							<font color="red">
1134
								<b><mtw:out /></b>
1136
								<b><mtw:out /></b>
1135
							</font>
1137
							</font>
1136
						</mtw:outError>
1138
						</mtw:outError>
1137
						</span>
1139
						</span>
1138
					</td>
1140
					</td>
1139
				</tr>
1141
				</tr>
1140
				<tr>
1142
				<tr>
1141
					<td>
1143
					<td>
1142
						Title:
1144
						Title:
1143
					</td>
1145
					</td>
1144
					<td>
1146
					<td>
1145
						<mtw:input id="createNewPageTitle" name="newPage.title" size="40" maxlength="100" />
1147
						<mtw:input id="createNewPageTitle" name="newPage.title" size="40" maxlength="100" />
1146
						<span id="createNewPageTitleError">
1148
						<span id="createNewPageTitleError">
1147
						<mtw:outError field="newPage.title">
1149
						<mtw:outError field="newPage.title">
1148
							<font color="red">
1150
							<font color="red">
1149
								<b><mtw:out /></b>
1151
								<b><mtw:out /></b>
1150
							</font>
1152
							</font>
1151
						</mtw:outError>
1153
						</mtw:outError>
1152
						</span>
1154
						</span>
1153
					</td>
1155
					</td>
1154
				</tr>
1156
				</tr>
1155
				<tr id="createPageLanguageCell">
1157
				<tr id="createPageLanguageCell">
1156
					<td>
1158
					<td>
1157
						Language:
1159
						Language:
1158
					</td>
1160
					</td>
1159
					<td>
1161
					<td>
1160
						<mtw:select name="newPage.languageId" list="languages" id="createNewPageLanguage" emptyField="true" />
1162
						<mtw:select name="newPage.languageId" list="languages" id="createNewPageLanguage" emptyField="true" />
1161
						<span id="createNewPageLanguageError">
1163
						<span id="createNewPageLanguageError">
1162
						<mtw:outError field="newPage.languageId">
1164
						<mtw:outError field="newPage.languageId">
1163
							<font color="red">
1165
							<font color="red">
1164
								<b><mtw:out /></b>
1166
								<b><mtw:out /></b>
1165
							</font>
1167
							</font>
1166
						</mtw:outError>
1168
						</mtw:outError>
1167
						</span>
1169
						</span>
1168
					</td>
1170
					</td>
1169
				</tr>
1171
				</tr>
1170
				<tr>
1172
				<tr>
1171
        			<td colspan="2">
1173
        			<td colspan="2">
1172
        				<mtw:textarea id="createNewPageTextArea" name="newPage.body" style="width: 100%; height: 465px;" />
1174
        				<mtw:textarea id="createNewPageTextArea" name="newPage.body" style="width: 100%; height: 465px;" />
1173
        				<span id="createNewPageBodyError">
1175
        				<span id="createNewPageBodyError">
1174
						<mtw:outError field="newPage.body">
1176
						<mtw:outError field="newPage.body">
1175
							<font color="red">
1177
							<font color="red">
1176
								<b><mtw:out /></b>
1178
								<b><mtw:out /></b>
1177
							</font>
1179
							</font>
1178
						</mtw:outError>
1180
						</mtw:outError>
1179
						</span>
1181
						</span>
1180
        			</td>
1182
        			</td>
1181
    			</tr>
1183
    			</tr>
1182
			</table>
1184
			</table>
1183
		</form>
1185
		</form>
1184
</div>
1186
</div>
1185
1187
1186
1188
1187
<div>
1189
<div>
1188
<table border="0">
1190
<table border="0">
1189
    <tr>
1191
    <tr>
1190
        <td>
1192
        <td>
1191
1193
1192
        <k:kcode name="logo" />        
1194
        <k:kcode name="logo" />        
1193
        <mtw:hasAuthorization groups="admin">
1195
        <mtw:hasAuthorization groups="admin">
1194
        
1196
        
1195
        <mtw:if test="logo.preview" value="false">
1197
        <mtw:if test="logo.preview" value="false">
1196
        <br/>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" style="font-size: 8px;" onclick="return showEditPageDialog('logo', '<mtw:out value="logo.lang" />');" title="<k:editTooltip name="logo" />">Edit Logo</a>
1198
        <br/>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" style="font-size: 8px;" onclick="return showEditPageDialog('logo', '<mtw:out value="logo.lang" />');" title="<k:editTooltip name="logo" />">Edit Logo</a>
1197
        </mtw:if>
1199
        </mtw:if>
1198
        
1200
        
1199
        <mtw:if test="logo.preview" value="true">
1201
        <mtw:if test="logo.preview" value="true">
1200
        <br/>&nbsp;&nbsp;&nbsp;&nbsp;
1202
        <br/>&nbsp;&nbsp;&nbsp;&nbsp;
1201
        <span style="font-size: 10px; font-weight: bold;">Preview</span><span style="font-size: 8px;">&nbsp;&nbsp;-&nbsp;</span>
1203
        <span style="font-size: 10px; font-weight: bold;">Preview</span><span style="font-size: 8px;">&nbsp;&nbsp;-&nbsp;</span>
1202
        <a style="font-size: 8px;" href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="logo.name" />&lang=<mtw:out value="logo.language.locale" />">Save</a>&nbsp;
1204
        <a style="font-size: 8px;" href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="logo.name" />&lang=<mtw:out value="logo.language.locale" />">Save</a>&nbsp;
1203
        <a style="font-size: 8px;" href="#" onclick="return showEditPreviewDialog('<mtw:out value="logo.name" />', '<mtw:out value="logo.language.locale" />');" title="<k:editTooltip name="logo" />">Edit</a>&nbsp;
1205
        <a style="font-size: 8px;" href="#" onclick="return showEditPreviewDialog('<mtw:out value="logo.name" />', '<mtw:out value="logo.language.locale" />');" title="<k:editTooltip name="logo" />">Edit</a>&nbsp;
1204
        <a style="font-size: 8px;" href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="logo.name" />&lang=<mtw:out value="logo.language.locale" />">Discard</a>
1206
        <a style="font-size: 8px;" href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="logo.name" />&lang=<mtw:out value="logo.language.locale" />">Discard</a>
1205
        </mtw:if>
1207
        </mtw:if>
1206
        
1208
        
1207
        </mtw:hasAuthorization>
1209
        </mtw:hasAuthorization>
1208
        
1210
        
1209
        </td>
1211
        </td>
1210
        <td align="right" valign="bottom">
1212
        <td align="right" valign="bottom">
1211
            <mtw:isLogged negate="true">
1213
            <mtw:isLogged negate="true">
1212
                <a href="#" onclick="return showListLastRevisionsDialog('<mtw:out value="bodyColumn.language.locale" />', '<mtw:out value="bodyColumn.language" />', false);">Last Updates</a> |
1214
                <a href="#" onclick="return showListLastRevisionsDialog('<mtw:out value="bodyColumn.language.locale" />', '<mtw:out value="bodyColumn.language" />', false);">Last Updates</a> |
1213
                <a href="#" onclick="return showLoginDialog();">Login</a>
1215
                <a href="#" onclick="return showLoginDialog();">Login</a>
1214
            </mtw:isLogged>
1216
            </mtw:isLogged>
1215
            <mtw:isLogged>
1217
            <mtw:isLogged>
1216
                <a href="#" onclick="return showCreateNewPageDialog();">Create New Page</a> |
1218
                <a href="#" onclick="return showCreateNewPageDialog();">Create New Page</a> |
1217
                <a href="#" onclick="return showAddNewUserDialog(true);">Add New User</a> |
1219
                <a href="#" onclick="return showAddNewUserDialog(true);">Add New User</a> |
1218
                <a href="#" onclick="return showListAllPagesDialog(<mtw:out value="sessionUser.admin" />);">List Pages</a> |
1220
                <a href="#" onclick="return showListAllPagesDialog(<mtw:out value="sessionUser.admin" />);">List Pages</a> |
1219
                
1221
                
1220
                <mtw:hasAuthorization groups="admin, editor">
1222
                <mtw:hasAuthorization groups="admin, editor">
1221
                
1223
                
1222
                <mtw:if test="css.preview" value="true">
1224
                <mtw:if test="css.preview" value="true">
1223
                <b>CSS</b> - 
1225
                <b>CSS</b> - 
1224
                <a href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="css.name" />&lang=<mtw:out value="css.language.locale" />">Save</a>&nbsp;
1226
                <a href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="css.name" />&lang=<mtw:out value="css.language.locale" />">Save</a>&nbsp;
1225
                <a href="#" onclick="return showEditPreviewDialog('<mtw:out value="css.name" />', '<mtw:out value="css.language.locale" />');" title="<k:editTooltip name="css" />">Edit</a>&nbsp;
1227
                <a href="#" onclick="return showEditPreviewDialog('<mtw:out value="css.name" />', '<mtw:out value="css.language.locale" />');" title="<k:editTooltip name="css" />">Edit</a>&nbsp;
1226
                <a href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="css.name" />&lang=<mtw:out value="css.language.locale" />">Discard</a> |
1228
                <a href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="css.name" />&lang=<mtw:out value="css.language.locale" />">Discard</a> |
1227
                </mtw:if>
1229
                </mtw:if>
1228
                
1230
                
1229
                <mtw:if test="css.preview" value="false">
1231
                <mtw:if test="css.preview" value="false">
1230
                <a href="#" onclick="return showEditPageDialog('CSS', 'en');" title="<k:editTooltip name="css" />">Edit CSS</a> |
1232
                <a href="#" onclick="return showEditPageDialog('CSS', 'en');" title="<k:editTooltip name="css" />">Edit CSS</a> |
1231
                </mtw:if>
1233
                </mtw:if>
1232
                
1234
                
1233
                </mtw:hasAuthorization>
1235
                </mtw:hasAuthorization>
1234
                
1236
                
1235
                <mtw:hasAuthorization groups="admin, editor">
1237
                <mtw:hasAuthorization groups="admin, editor">
1236
                
1238
                
1237
                <mtw:if test="js.preview" value="true">
1239
                <mtw:if test="js.preview" value="true">
1238
                <b>JavaScript</b> - 
1240
                <b>JavaScript</b> - 
1239
                <a href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="js.name" />&lang=<mtw:out value="js.language.locale" />">Save</a>&nbsp;
1241
                <a href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="js.name" />&lang=<mtw:out value="js.language.locale" />">Save</a>&nbsp;
1240
                <a href="#" onclick="return showEditPreviewDialog('<mtw:out value="js.name" />', '<mtw:out value="js.language.locale" />');" title="<k:editTooltip name="js" />">Edit</a>&nbsp;
1242
                <a href="#" onclick="return showEditPreviewDialog('<mtw:out value="js.name" />', '<mtw:out value="js.language.locale" />');" title="<k:editTooltip name="js" />">Edit</a>&nbsp;
1241
                <a href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="js.name" />&lang=<mtw:out value="js.language.locale" />">Discard</a> |
1243
                <a href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="js.name" />&lang=<mtw:out value="js.language.locale" />">Discard</a> |
1242
                </mtw:if>
1244
                </mtw:if>
1243
                
1245
                
1244
                <mtw:if test="js.preview" value="false">
1246
                <mtw:if test="js.preview" value="false">
1245
                <a href="#" onclick="return showEditPageDialog('JavaScript', 'en');" title="<k:editTooltip name="js" />">Edit JavaScript</a> |
1247
                <a href="#" onclick="return showEditPageDialog('JavaScript', 'en');" title="<k:editTooltip name="js" />">Edit JavaScript</a> |
1246
                </mtw:if>
1248
                </mtw:if>
1247
                
1249
                
1248
                </mtw:hasAuthorization>
1250
                </mtw:hasAuthorization>
1249
                
1251
                
1250
                <mtw:hasAuthorization groups="admin, editor">
1252
                <mtw:hasAuthorization groups="admin, editor">
1251
                
1253
                
1252
                <a href="#" onclick="return showFileUploadDialog();">Upload Files</a> |
1254
                <a href="#" onclick="return showFileUploadDialog();">Upload Files</a> |
1253
                <a href="#" onclick="return showFileListDialog();">List Files</a> |
1255
                <a href="#" onclick="return showFileListDialog();">List Files</a> |
1254
                <a href="#" onclick="return showListLastRevisionsDialog('<mtw:out value="bodyColumn.language.locale" />', '<mtw:out value="bodyColumn.language" />', true);">Last Updates</a> |
1256
                <a href="#" onclick="return showListLastRevisionsDialog('<mtw:out value="bodyColumn.language.locale" />', '<mtw:out value="bodyColumn.language" />', true);">Last Updates</a> |
1255
                
1257
                
1256
                </mtw:hasAuthorization>
1258
                </mtw:hasAuthorization>
1257
                
1259
                
1258
                
1260
                
1259
                <a href="<mtw:contextPath/>/Logout.mtw">Logout</a> (<mtw:out value="sessionUser.username" />)
1261
                <a href="<mtw:contextPath/>/Logout.mtw">Logout</a> (<mtw:out value="sessionUser.username" />)
1260
            </mtw:isLogged>
1262
            </mtw:isLogged>
1261
            &nbsp;
1263
            &nbsp;
1262
            <%--
1264
            <%--
1263
            <mtw:isLocale value="pt">
1265
            <mtw:isLocale value="pt">
1264
	            <a href="<mtw:urlWithLoc loc="pt" tagsToExclude="revision" />"><img src="images/brazil.gif" border="0" width="20" height="13" style="border: 3px solid #ccc;" /></a>
1266
	            <a href="<mtw:urlWithLoc loc="pt" tagsToExclude="revision" />"><img src="images/brazil.gif" border="0" width="20" height="13" style="border: 3px solid #ccc;" /></a>
1265
    	        <a href="<mtw:urlWithLoc loc="en" tagsToExclude="revision" />"><img src="images/usa.gif" width="20" height="13" border="0" style="border: 3px solid #fff;" /></a>
1267
    	        <a href="<mtw:urlWithLoc loc="en" tagsToExclude="revision" />"><img src="images/usa.gif" width="20" height="13" border="0" style="border: 3px solid #fff;" /></a>
1266
            </mtw:isLocale>
1268
            </mtw:isLocale>
1267
            <mtw:isLocale value="en">
1269
            <mtw:isLocale value="en">
1268
            	<a href="<mtw:urlWithLoc loc="pt" tagsToExclude="revision" />"><img src="images/brazil.gif" border="0" width="20" height="13" style="border: 3px solid #fff;" /></a>
1270
            	<a href="<mtw:urlWithLoc loc="pt" tagsToExclude="revision" />"><img src="images/brazil.gif" border="0" width="20" height="13" style="border: 3px solid #fff;" /></a>
1269
            	<a href="<mtw:urlWithLoc loc="en" tagsToExclude="revision" />"><img src="images/usa.gif" width="20" height="13" border="0" style="border: 3px solid #ccc;" /></a>
1271
            	<a href="<mtw:urlWithLoc loc="en" tagsToExclude="revision" />"><img src="images/usa.gif" width="20" height="13" border="0" style="border: 3px solid #ccc;" /></a>
1270
            </mtw:isLocale>
1272
            </mtw:isLocale>
1271
            --%>
1273
            --%>
1272
            <k:listFlags />
1274
            <k:listFlags />
1273
            &nbsp;&nbsp;&nbsp;
1275
            &nbsp;&nbsp;&nbsp;
1274
        </td>
1276
        </td>
1275
    </tr>
1277
    </tr>
1276
</table>
1278
</table>
1277
</div>
1279
</div>
1278
1280
1279
<hr />
1281
<hr />
1280
1282
1281
<div id="leftColumn"><mtw:isLogged>
1283
<div id="leftColumn"><mtw:isLogged>
1282
    <mtw:hasAuthorization groups="admin, editor">
1284
    <mtw:hasAuthorization groups="admin, editor">
1283
    
1285
    
1284
        <mtw:if test="leftColumn.preview" value="true">
1286
        <mtw:if test="leftColumn.preview" value="true">
1285
        <div style="text-align: left; padding-left: 8px; padding-top: 6px;">
1287
        <div style="text-align: left; padding-left: 8px; padding-top: 6px;">
1286
            <b>Preview</b>
1288
            <b>Preview</b>
1287
            &nbsp;-&nbsp;
1289
            &nbsp;-&nbsp;
1288
            <a href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="leftColumn.name" />&lang=<mtw:out value="leftColumn.language.locale" />">Save</a>&nbsp;&nbsp;
1290
            <a href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="leftColumn.name" />&lang=<mtw:out value="leftColumn.language.locale" />">Save</a>&nbsp;&nbsp;
1289
            <a href="#" onclick="return showEditPreviewDialog('<mtw:out value="leftColumn.name" />', '<mtw:out value="leftColumn.language.locale" />');" title="<k:editTooltip name="leftColumn" />">Edit</a>&nbsp;&nbsp;
1291
            <a href="#" onclick="return showEditPreviewDialog('<mtw:out value="leftColumn.name" />', '<mtw:out value="leftColumn.language.locale" />');" title="<k:editTooltip name="leftColumn" />">Edit</a>&nbsp;&nbsp;
1290
            <a href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="leftColumn.name" />&lang=<mtw:out value="leftColumn.language.locale" />">Discard</a>
1292
            <a href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="leftColumn.name" />&lang=<mtw:out value="leftColumn.language.locale" />">Discard</a>
1291
        </div>
1293
        </div>
1292
        </mtw:if>
1294
        </mtw:if>
1293
1295
1294
        <mtw:if test="leftColumn.preview" value="false">
1296
        <mtw:if test="leftColumn.preview" value="false">
1295
        <div style="text-align: right; padding-right: 14px; padding-top: 6px;">
1297
        <div style="text-align: right; padding-right: 14px; padding-top: 6px;">
1296
        <a href="#" onclick="return showEditPageDialog('LeftColumn', '<mtw:out value="leftColumn.language.locale" />');" title="<k:editTooltip name="leftColumn" />">Edit</a>
1298
        <a href="#" onclick="return showEditPageDialog('LeftColumn', '<mtw:out value="leftColumn.language.locale" />');" title="<k:editTooltip name="leftColumn" />">Edit</a>
1297
        &nbsp;&nbsp;
1299
        &nbsp;&nbsp;
1298
        <a href="#" onclick="return showListRevisionsDialog('LeftColumn','<mtw:out value="leftColumn.language.locale" />','<mtw:out value="leftColumn.language" />', false);">Revisions</a>
1300
        <a href="#" onclick="return showListRevisionsDialog('LeftColumn','<mtw:out value="leftColumn.language.locale" />','<mtw:out value="leftColumn.language" />', false);">Revisions</a>
1299
        </div>
1301
        </div>
1300
        </mtw:if>
1302
        </mtw:if>
1301
    
1303
    
1302
        
1304
        
1303
    </mtw:hasAuthorization>
1305
    </mtw:hasAuthorization>
1304
</mtw:isLogged>
1306
</mtw:isLogged>
1305
<div id="navcolumn">
1307
<div id="navcolumn">
1306
    <div>
1308
    <div>
1307
    <k:kcode name="leftColumn" />
1309
    <k:kcode name="leftColumn" />
1308
    </div>
1310
    </div>
1309
<br />
1311
<br />
1310
</div>
1312
</div>
1311
1313
1312
</div>
1314
</div>
1313
1315
1314
<div id="bodyColumn">
1316
<div id="bodyColumn">
1315
    <mtw:hasAuthorization groups="admin, editor">
1317
    <mtw:hasAuthorization groups="admin, editor">
1316
1318
1317
    <mtw:if test="bodyColumn.preview" value="true">
1319
    <mtw:if test="bodyColumn.preview" value="true">
1318
1320
1319
    	<mtw:if test="bodyColumn.new" value="true">
1321
    	<mtw:if test="bodyColumn.new" value="true">
1320
			<div style="text-align: left; padding-left: 4px;">
1322
			<div style="text-align: left; padding-left: 4px;">
1321
			<b>This is a Preview</b>
1323
			<b>This is a Preview</b>
1322
			&nbsp;-&nbsp;
1324
			&nbsp;-&nbsp;
1323
            <a href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Save</a>&nbsp;&nbsp;
1325
            <a href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Save</a>&nbsp;&nbsp;
1324
            <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;
1326
            <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;
1325
			<a href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Discard</a>
1327
			<a href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Discard</a>
1326
			</div>    
1328
			</div>    
1327
    	</mtw:if>
1329
    	</mtw:if>
1328
    	<mtw:if test="bodyColumn.new" value="false">
1330
    	<mtw:if test="bodyColumn.new" value="false">
1329
            <div style="text-align: left; padding-left: 4px;">
1331
            <div style="text-align: left; padding-left: 4px;">
1330
            <b>This is a Preview</b>
1332
            <b>This is a Preview</b>
1331
            &nbsp;-&nbsp;
1333
            &nbsp;-&nbsp;
1332
            <a href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Save</a>&nbsp;&nbsp;
1334
            <a href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Save</a>&nbsp;&nbsp;
1333
            <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;
1335
            <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;
1334
            <a href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Discard</a>
1336
            <a href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Discard</a>
1335
			</div>    	
1337
			</div>    	
1336
    	</mtw:if>
1338
    	</mtw:if>
1337
    
1339
    
1338
    </mtw:if>
1340
    </mtw:if>
1339
1341
1340
    <mtw:if test="bodyColumn.preview" value="false">
1342
    <mtw:if test="bodyColumn.preview" value="false">
1341
        <mtw:if test="bodyColumn.revision" value="true">
1343
        <mtw:if test="bodyColumn.revision" value="true">
1342
            <div style="text-align: left; padding-left: 4px;"><span title="<k:editTooltip name="bodyColumn" />"><b>Revision #<mtw:out value="bodyColumn.revisionNumber" /></b></span></div>
1344
            <div style="text-align: left; padding-left: 4px;"><span title="<k:editTooltip name="bodyColumn" />"><b>Revision #<mtw:out value="bodyColumn.revisionNumber" /></b></span></div>
1343
        </mtw:if>
1345
        </mtw:if>
1344
    
1346
    
1345
        <mtw:if test="bodyColumn.revision" value="false">
1347
        <mtw:if test="bodyColumn.revision" value="false">
1346
            <div style="text-align: right; padding-right: 14px;">
1348
            <div style="text-align: right; padding-right: 14px;">
1347
            <a href="#" onclick="return showEditPageDialog('<mtw:out value="bodyColumn.name" />', '<mtw:out value="bodyColumn.language.locale" />');" title="<k:editTooltip name="bodyColumn" />">Edit</a>
1349
            <a href="#" onclick="return showEditPageDialog('<mtw:out value="bodyColumn.name" />', '<mtw:out value="bodyColumn.language.locale" />');" title="<k:editTooltip name="bodyColumn" />">Edit</a>
1348
            &nbsp;&nbsp;
1350
            &nbsp;&nbsp;
1349
            <a href="#" onclick="return showListRevisionsDialog('<mtw:out value="bodyColumn.name" />','<mtw:out value="bodyColumn.language.locale" />','<mtw:out value="bodyColumn.language" />', false);">Revisions</a>
1351
            <a href="#" onclick="return showListRevisionsDialog('<mtw:out value="bodyColumn.name" />','<mtw:out value="bodyColumn.language.locale" />','<mtw:out value="bodyColumn.language" />', false);">Revisions</a>
1350
            </div>
1352
            </div>
1351
        </mtw:if>
1353
        </mtw:if>
1352
    </mtw:if>
1354
    </mtw:if>
1353
1355
1354
    </mtw:hasAuthorization>
1356
    </mtw:hasAuthorization>
1355
    <k:kcode name="bodyColumn" />
1357
    <k:kcode name="bodyColumn" />
1356
</div>
1358
</div>
1357
1359
1358
<div class="clear">
1360
<div class="clear">
1359
<hr />
1361
<hr />
1360
</div>
1362
</div>
1361
<br/><br/><br/>
1363
<br/><br/><br/>
1362
<div id="footer">
1364
<div id="footer">
1363
<div><center>Copyright (c) 2011 - Powered by <a href="http://www.kawaiwiki.org" target="_blank"><b>Kawai</b></a></center></div>
1365
<div><center>Copyright (c) 2011 - Powered by <a href="http://www.kawaiwiki.org" target="_blank"><b>Kawai</b></a></center></div>
1364
<div class="clear">
1366
<div class="clear">
1365
<hr />
1367
<hr />
1366
</div>
1368
</div>
1367
</div>
1369
</div>
1368
1370
1369
</body>
1371
</body>
1370
</html>
1372
</html>