Kawai Wiki

Rev

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