Mercurial > hg > MPIWGWeb
annotate MPIWGFeature.py @ 131:c5761a3f3c50
Merge with 741ddaf604b14515efacec8c3110ea04635c1b17
author | casties |
---|---|
date | Thu, 30 May 2013 22:14:00 +0200 |
parents | faaded775a8a |
children | e0b343cee9dd |
rev | line source |
---|---|
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
1 from Products.PageTemplates.PageTemplateFile import PageTemplateFile |
9 | 2 from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate |
16 | 3 from OFS.Folder import Folder |
4 from AccessControl import ClassSecurityInfo | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
5 from Globals import package_home |
16 | 6 |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
7 import string |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
8 import re |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
9 import os |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
10 import logging |
16 | 11 import datetime |
12 | |
13 from SrvTxtUtils import getMonthName | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
14 from MPIWGHelper import * |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
15 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
16 class MPIWGFeature(Folder): |
16 | 17 """special object for feature texts on the MPIWG website. |
18 Has templates for English and German in Folders /en/ and /de/. | |
19 Feature teaser is /(en|de)/teaser.pt. Full page is /(en|de)/main.pt. | |
20 Full title is the title of /(en|de)/main.pt. | |
21 """ | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
22 |
20 | 23 meta_type = "MPIWGFeature" |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
24 |
20 | 25 manage_options = Folder.manage_options + ( |
26 {'label':'Change Weight', 'action':'changeWeightForm'}, | |
27 {'label':'Configure', 'action':'changeForm'}, | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
28 ) |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
29 |
84 | 30 # templates |
16 | 31 changeWeightForm = PageTemplateFile('zpt/feature/manage_change_weight', globals()) |
32 changeForm = PageTemplateFile('zpt/feature/manage_config', globals()) | |
84 | 33 feature_main = PageTemplateFile('zpt/feature/feature_template', globals()) |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
34 |
20 | 35 def __init__(self, id, title=None, weight=0, date=None, title_en=None, title_de=None, author=None, author_id=None): |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
36 self.id = str(id) |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
37 self.weight = weight |
20 | 38 self.author = author |
39 self.author_id = author_id | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
40 if title is None: |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
41 self.title = id |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
42 else: |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
43 self.title = title |
16 | 44 |
45 if date is None: | |
46 self.date = datetime.date.today() | |
47 else: | |
48 self.date = date | |
49 | |
50 # | |
21 | 51 # add language folder and sample templates |
16 | 52 # |
53 mainid = 'main.pt' | |
54 teaserid = 'teaser.pt' | |
55 # english | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
56 self.manage_addFolder('en') |
16 | 57 folder_en = getattr(self, 'en') |
58 folder_en[teaserid] = ZopePageTemplate(teaserid) | |
20 | 59 teaser_en = getattr(folder_en, teaserid) |
60 teaser_en.pt_edit(open(os.path.join(package_home(globals()), 'zpt/feature/default_template_teaser.zpt')).read(), 'text/html') | |
16 | 61 folder_en[mainid] = ZopePageTemplate(mainid) |
20 | 62 main_en = getattr(folder_en, mainid) |
63 main_en.pt_edit(open(os.path.join(package_home(globals()), 'zpt/feature/default_template_main.zpt')).read(), 'text/html') | |
16 | 64 if title_en is not None: |
65 main_en.title = title_en | |
66 # german | |
67 self.manage_addFolder('de') | |
68 folder_de = getattr(self, 'de') | |
69 folder_de[teaserid] = ZopePageTemplate(teaserid) | |
20 | 70 teaser_de = getattr(folder_de, teaserid) |
71 teaser_de.pt_edit(open(os.path.join(package_home(globals()), 'zpt/feature/default_template_teaser.zpt')).read(), 'text/html') | |
16 | 72 folder_de[mainid] = ZopePageTemplate(mainid) |
20 | 73 main_de = getattr(folder_de, mainid) |
74 main_de.pt_edit(open(os.path.join(package_home(globals()), 'zpt/feature/default_template_main.zpt')).read(), 'text/html') | |
16 | 75 if title_de is not None: |
76 main_de.title = title_de | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
77 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
78 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
79 def index_html(self): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
80 """default index page""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
81 return self.getMain() |
20 | 82 |
83 def getAuthor(self): | |
84 """returns the author name""" | |
85 return getattr(self, 'author', None) | |
86 | |
87 def getAuthorId(self): | |
88 """returns the author ID""" | |
89 return getattr(self, 'author_id', None) | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
90 |
16 | 91 def getFullTitle(self, lang=None): |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
92 """returns the full title (from main.pt)""" |
16 | 93 if lang is None: |
94 # get Language from MPIWGRoot | |
95 lang = self.getLang() | |
96 | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
97 dir = getattr(self, lang, self.en) |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
98 pt = getattr(dir, 'main.pt') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
99 t = pt.title |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
100 if not t: |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
101 t = self.title |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
102 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
103 return t |
5 | 104 |
16 | 105 def getDate(self): |
106 """returns the date as a date object""" | |
107 return getattr(self, 'date', None) | |
108 | |
109 def getDateString(self, lang=None): | |
110 """returns the date as a string""" | |
111 d = self.getDate() | |
112 if d is None: | |
113 return '???' | |
114 | |
115 if lang is None: | |
116 # get Language from MPIWGRoot | |
117 lang = self.getLang() | |
118 | |
119 if lang == 'iso': | |
120 return d.isoformat() | |
121 elif lang == 'en': | |
20 | 122 return "%s %s, %s" % (getMonthName(d.month, 'en'), d.day, d.year) |
16 | 123 elif lang == 'de': |
20 | 124 return "%s. %s %s" % (d.day, getMonthName(d.month, 'de'), d.year) |
16 | 125 |
126 return None | |
127 | |
5 | 128 def getUrl(self, baseUrl=None): |
129 """returns URL to this feature""" | |
130 if baseUrl is None: | |
131 return self.absolute_url() | |
132 | |
20 | 133 return '%s/%s' % (baseUrl, self.getId()) |
5 | 134 |
135 def getPath(self, page, relative=True): | |
136 """returns path to template page""" | |
137 # get Language from MPIWGRoot | |
138 lang = self.getLang() | |
139 dir = getattr(self, lang, self.en) | |
140 if relative: | |
20 | 141 return '%s/%s/%s' % (self.getId(), dir.getId(), page) |
5 | 142 |
18
3913a1c5c583
feature's getPath returns None if it can't find the template.
casties
parents:
17
diff
changeset
|
143 pt = getattr(dir, page, None) |
3913a1c5c583
feature's getPath returns None if it can't find the template.
casties
parents:
17
diff
changeset
|
144 if pt is not None: |
3913a1c5c583
feature's getPath returns None if it can't find the template.
casties
parents:
17
diff
changeset
|
145 return pt.absolute_url_path() |
3913a1c5c583
feature's getPath returns None if it can't find the template.
casties
parents:
17
diff
changeset
|
146 |
3913a1c5c583
feature's getPath returns None if it can't find the template.
casties
parents:
17
diff
changeset
|
147 return None |
5 | 148 |
149 def getTeaserPath(self): | |
150 """returns the path to the teaser template""" | |
151 return self.getPath('teaser.pt') | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
152 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
153 def getIntro(self, **args): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
154 """returns the intro as PageTemplate""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
155 # get Language from MPIWGRoot |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
156 lang = self.getLang() |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
157 dir = getattr(self, lang, self.en) |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
158 pt = getattr(dir, 'intro.pt') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
159 return pt(**args) |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
160 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
161 def getMain(self, **args): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
162 """returns the main part as PageTemplate""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
163 # get Language from MPIWGRoot |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
164 lang = self.getLang() |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
165 dir = getattr(self, lang, self.en) |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
166 pt = getattr(dir, 'main.pt') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
167 return pt(**args) |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
168 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
169 def getFrontpageImg(self): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
170 """returns the image object for the frontpage""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
171 img = getattr(self, 'img-frontpage.jpg') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
172 return img |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
173 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
174 def getFrontpageImgUrl(self): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
175 """returns the URL of the image object for the frontpage""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
176 img = getattr(self, 'img-frontpage.jpg') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
177 return img.absolute_url() |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
178 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
179 def getFrontpageThumb(self): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
180 """returns the image object for the frontpage thumbnail""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
181 img = getattr(self, 'img-frontthumb.jpg') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
182 return img |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
183 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
184 def getFrontpageThumbUrl(self): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
185 """returns the URL of the image object for the frontpage thumbnail""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
186 img = getattr(self, 'img-frontthumb.jpg') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
187 return img.absolute_url() |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
188 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
189 def getThumbImg(self): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
190 """returns the image object for the sidebar thumbnail""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
191 img = getattr(self, 'img-thumb.jpg') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
192 return img |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
193 |
84 | 194 def getThumbUrl(self): |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
195 """returns the URL of the image object for the sidebar thumbnail""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
196 img = getattr(self, 'img-thumb.jpg') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
197 return img.absolute_url() |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
198 |
20 | 199 def changeWeight(self, weight, RESPONSE=None): |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
200 """change weight""" |
20 | 201 self.weight = weight |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
202 if RESPONSE is not None: |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
203 RESPONSE.redirect('manage_main') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
204 |
20 | 205 def changeMPIWGFeature(self, title=None, weight=None, date=None, title_en=None, title_de=None, |
206 author=None, author_id=None, RESPONSE=None): | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
207 """change everything""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
208 if title is not None: |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
209 self.title = title |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
210 if weight is not None: |
16 | 211 self.weight = weight |
20 | 212 if author is not None: |
213 self.author = author | |
214 if author_id is not None: | |
215 self.author_id = author_id | |
16 | 216 if date is not None: |
217 try: | |
218 self.date = datetime.datetime.strptime(date, '%Y-%m-%d').date() | |
219 except: | |
220 pass | |
221 | |
222 folder_en = self.get('en', None) | |
223 if folder_en is not None: | |
224 main_en = folder_en.get('main.pt', None) | |
225 if main_en is not None and title_en is not None: | |
226 main_en.title = title_en | |
227 | |
228 folder_de = self.get('de', None) | |
229 if folder_de is not None: | |
230 main_de = folder_de.get('main.pt', None) | |
231 if main_de is not None and title_de is not None: | |
232 main_de.title = title_de | |
233 | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
234 if RESPONSE is not None: |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
235 RESPONSE.redirect('manage_main') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
236 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
237 def getBreadcrumbs(self): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
238 """return list of breadcrumbs from here to the root""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
239 crumbs = [(self.getFullTitle(), self.absolute_url(), self)] |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
240 parent = self.aq_parent |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
241 if hasattr(parent, 'getBreadcrumbs'): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
242 if self.title: |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
243 return parent.getBreadcrumbs() + crumbs |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
244 else: |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
245 # if there's no title, skip this level |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
246 return parent.getBreadcrumbs() |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
247 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
248 return crumbs |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
249 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
250 getSection = getSection |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
251 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
252 getSubSection = getSubSection |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
253 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
254 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
255 def manage_addMPIWGFeatureForm(self): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
256 """Form for adding""" |
20 | 257 pt = PageTemplateFile(os.path.join(package_home(globals()), 'zpt/feature/manage_add_MPIWGFeature.zpt')).__of__(self) |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
258 return pt() |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
259 |
20 | 260 def manage_addMPIWGFeature(self, id, title=None, weight=0, title_en=None, title_de=None, author=None, author_id=None, RESPONSE=None): |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
261 "Add a MPIWG Feature object" |
20 | 262 newObj = MPIWGFeature(id, title=title, weight=weight, title_en=title_en, title_de=title_de, author=author, author_id=author_id) |
263 self.Destination()._setObject(id, newObj) | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
264 if RESPONSE is not None: |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
265 RESPONSE.redirect('manage_main') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
266 |