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