Kawai Wiki

Rev

Rev 76 | Rev 80 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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