Kawai Wiki

Rev

Rev 209 | Details | Compare with Previous | Last modification | View Log | RSS feed

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