root / web-presentation / trunk / eneraptor-web-presentation / grails-app / controllers / com / eneraptor / presentation / EditController.groovy @ 86
History | View | Annotate | Download (569 Bytes)
1 | 86 | alexbesir | package com.eneraptor.presentation
|
---|---|---|---|
2 | |||
3 | class EditController { |
||
4 | |||
5 | def index = {
|
||
6 | |||
7 | List pages = new ArrayList() |
||
8 | pages = Content.list() |
||
9 | |||
10 | return [pages: pages] |
||
11 | |||
12 | } |
||
13 | |||
14 | def edit = {
|
||
15 | |||
16 | Content toEdit = Content.findByContentId(params.contentId) |
||
17 | |||
18 | [page: toEdit]
|
||
19 | |||
20 | } |
||
21 | |||
22 | def editDo = {
|
||
23 | |||
24 | Content toChange = Content.findByContentId(params.contentId) |
||
25 | toChange.contentHTML = params.newContent |
||
26 | toChange.save() |
||
27 | redirect(action:'index') |
||
28 | |||
29 | } |
||
30 | |||
31 | def logout = {
|
||
32 | |||
33 | session.invalidate() |
||
34 | redirect(action:'index') |
||
35 | |||
36 | } |
||
37 | |||
38 | } |