version 1.6, 2004/06/08 15:25:11
|
version 1.9, 2004/06/08 17:49:31
|
Line 18 class VLP_essay(Folder):
|
Line 18 class VLP_essay(Folder):
|
|
|
meta_type="VLP_essay" |
meta_type="VLP_essay" |
|
|
|
manage_options = Folder.manage_options+( |
|
{'label':'Main Config','action':'ConfigVLP_essayForm'}, |
|
) |
|
|
|
def content_html(self,type='collection'): |
|
"""template fuer content""" |
|
#templates = self.ZopeFind(self.aq_parent,obj_ids=[type+"_template"]) |
|
# |
|
#if templates: |
|
# return templates[0][1]() |
|
|
|
if hasattr(self,type+"_template"): |
|
obj=getattr(self,type+"_template") |
|
return obj() |
|
else: |
|
pt=PageTemplateFile('Products/ECHO_content/zpt/ECHO_%s_template_standard.zpt'%type).__of__(self) |
|
pt.content_type="text/html" |
|
return pt() |
|
|
|
def ConfigVLP_essayForm(self): |
|
"""Form for adding""" |
|
pt=PageTemplateFile('Products/ECHO_content/vlp/ChangeVLP_essay.zpt').__of__(self) |
|
return pt() |
|
|
|
def ChangeVLP_essay(self,title,label,description,RESPONSE=None): |
|
"""Change vlp_essay""" |
|
self.title=title |
|
self.label=label |
|
self.description=description |
|
|
|
if RESPONSE is not None: |
|
RESPONSE.redirect('manage_main') |
|
|
def __init__(self,id,title,label): |
def __init__(self,id,title,label): |
"""init""" |
"""init""" |
self.id=id |
self.id=id |
Line 34 class VLP_essay(Folder):
|
Line 67 class VLP_essay(Folder):
|
pages.sort(sortFind) |
pages.sort(sortFind) |
#print str(pages[int(pagenum)][1]()) |
#print str(pages[int(pagenum)][1]()) |
if pages[int(pagenum)-1][1].meta_type=='File': |
if pages[int(pagenum)-1][1].meta_type=='File': |
return str(pages[int(pagenum)-1][1]) |
return self.xml2html(str(pages[int(pagenum)-1][1])) |
else: |
else: |
return str(pages[int(pagenum)-1][1]()) |
return str(self.xml2html(pages[int(pagenum)-1][1]())) |
|
|
def nextPage(self,pagenum,url): |
def nextPage(self,pagenum,url): |
pages=len(self.ZopeFind(self,obj_metatypes=['DTML Document'])) # teste ob performance ok, sonst in variable |
pages=len(self.ZopeFind(self,obj_metatypes=['DTML Document','File'])) # teste ob performance ok, sonst in variable |
if int(pagenum)+1 <= pages: |
if int(pagenum)+1 <= pages: |
retstr=url+"?p="+str(int(pagenum)+1) |
retstr=url+"?p="+str(int(pagenum)+1) |
return """<td align="right" <a href="%s">next</a></td>"""%retstr |
return """<td align="right" <a href="%s">next</a></td>"""%retstr |
|
|
def previousPage(self,pagenum,url): |
def previousPage(self,pagenum,url): |
pages=len(self.ZopeFind(self,obj_metatypes=['DTML Document'])) # teste ob performance ok, sonst in variable |
|
if int(pagenum)-1 > 0: |
if int(pagenum)-1 > 0: |
retstr=url+"?p="+str(int(pagenum)-1) |
retstr=url+"?p="+str(int(pagenum)-1) |
return """<td align="left" <a href="%s">previous</a></td>"""%retstr |
return """<td align="left" <a href="%s">previous</a></td>"""%retstr |