version 1.49, 2004/04/22 17:35:14
|
version 1.57, 2004/05/06 13:41:41
|
Line 26 from Products.PageTemplates.PageTemplate
|
Line 26 from Products.PageTemplates.PageTemplate
|
from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate |
from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate |
from Globals import Persistent, package_home |
from Globals import Persistent, package_home |
from Acquisition import Implicit |
from Acquisition import Implicit |
|
from ECHO_helpers import displayTypes |
#from psycopg import libpq |
try: |
|
from psycopg import libpq |
|
except: |
|
try: |
from pyPgSQL import libpq |
from pyPgSQL import libpq |
|
except: |
|
print "ECHO_collection: Warning - No libpq imported!" |
|
|
import xml.dom.minidom |
import xml.dom.minidom |
|
|
import urllib |
import urllib |
Line 539 def manage_addECHO_externalLink(self,id,
|
Line 545 def manage_addECHO_externalLink(self,id,
|
RESPONSE.redirect('manage_main') |
RESPONSE.redirect('manage_main') |
|
|
|
|
|
class ECHO_link(ECHO_externalLink): |
|
"""external_link""" |
|
|
|
meta_type="ECHO_link" |
|
|
|
|
|
def content_html(self): |
|
"""template fuer content""" |
|
return content_html(self,'link') |
|
|
|
def manage_addECHO_linkForm(self): |
|
"""Form for external Links""" |
|
pt=PageTemplateFile('Products/ECHO_content/zpt/AddECHO_linkForm.zpt').__of__(self) |
|
return pt() |
|
|
|
|
|
def manage_addECHO_link(self,id,title,label,description,contentType,responsible,link,weight,coords=None,credits=None,RESPONSE=None): |
|
"""Add an external Link""" |
|
|
|
newObj=ECHO_link(id,link,title,label,description,contentType,responsible,credits,weight,coords) |
|
|
|
self._setObject(id,newObj) |
|
|
|
if RESPONSE is not None: |
|
RESPONSE.redirect('manage_main') |
|
|
|
|
class ECHO_collection(Folder, Persistent, Implicit): |
class ECHO_collection(Folder, Persistent, Implicit): |
"""ECHO Collection""" |
"""ECHO Collection""" |
Line 824 class ECHO_collection(Folder, Persistent
|
Line 856 class ECHO_collection(Folder, Persistent
|
return self.showOverview() |
return self.showOverview() |
elif hasattr(self,'collection_index_template'): |
elif hasattr(self,'collection_index_template'): |
return self.collection_index_template() |
return self.collection_index_template() |
|
elif hasattr(self,'main_index_template'): |
|
return self.main_index_template() |
|
|
pt=PageTemplateFile('Products/ECHO_content/zpt/ECHO_content_standard.zpt').__of__(self) |
pt=PageTemplateFile('Products/ECHO_content/zpt/ECHO_main_index_template_standard.zpt').__of__(self) |
pt.content_type="text/html" |
pt.content_type="text/html" |
return pt() |
return pt() |
|
|
Line 902 class ECHO_group(ECHO_collection):
|
Line 936 class ECHO_group(ECHO_collection):
|
{'label':'Rerender Links','action':'ECHO_rerenderLinksMD'}, |
{'label':'Rerender Links','action':'ECHO_rerenderLinksMD'}, |
{'label':'Graphics','action':'ECHO_graphicEntry'}, |
{'label':'Graphics','action':'ECHO_graphicEntry'}, |
) |
) |
|
|
|
def index_html(self): |
|
"""standard page""" |
|
displayedObjects=self.ZopeFind(self,obj_metatypes=displayTypes) |
|
if (len(displayedObjects)==1) and (displayedObjects[0][1].meta_type=="ECHO_collection"): # nur ein Object dann redirect auf dieses Object |
|
return self.REQUEST.RESPONSE.redirect(displayedObjects[0][1].absolute_url()) |
|
|
|
if 'index.html' in self.__dict__.keys(): |
|
return getattr(self,'index.html')() |
|
|
|
elif 'overview' in self.__dict__.keys(): |
|
return self.showOverview() |
|
elif hasattr(self,'group_index_template'): |
|
return self.group_index_template() |
|
elif hasattr(self,'collection_index_template'): |
|
return self.collection_index_template() |
|
elif hasattr(self,'main_index_template'): |
|
return self.main_index_template() |
|
|
|
pt=PageTemplateFile('Products/ECHO_content/zpt/ECHO_main_index_template_standard.zpt').__of__(self) |
|
pt.content_type="text/html" |
|
return pt() |
|
|
def ECHO_group_config(self): |
def ECHO_group_config(self): |
"""Main configuration""" |
"""Main configuration""" |
|
|
Line 998 class ECHO_root(Folder,Persistent,Implic
|
Line 1055 class ECHO_root(Folder,Persistent,Implic
|
retStr="<option>\n" |
retStr="<option>\n" |
|
|
try: |
try: |
for contentType in self.ZopeFind(self.contentTypes,obj_metatypes="ECHO_contentType"): |
for contentType in self.ZopeFind(self.contentTypes,obj_metatypes=["ECHO_contentType"]): |
if selected and (contentType[0]==selected): |
if selected and (contentType[0]==selected): |
retStr+="""<option selected value="%s">%s\n"""%(contentType[0],contentType[0]) |
retStr+="""<option selected value="%s">%s\n"""%(contentType[0],contentType[0]) |
else: |
else: |