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