Kawai Wiki

Rev

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