--- ECHO_content/ECHO_collection.py 2004/04/14 23:45:58 1.39 +++ ECHO_content/ECHO_collection.py 2004/04/16 10:24:09 1.43 @@ -34,6 +34,7 @@ import xml.dom.minidom import urllib import xml.dom.minidom from ECHO_graphicalOverview import javaHandler,javaScriptMain +import ECHO_helpers #List of different types for the graphical linking viewer viewClassificationListMaster=['view point','area'] @@ -264,6 +265,8 @@ class ECHO_resource(Folder): viewClassificationList=viewClassificationListMaster + getSubCols = ECHO_helpers.getSubCols + def content_html(self): """template fuer content""" return content_html(self,'resource') @@ -560,7 +563,7 @@ class ECHO_collection(Folder, Persistent for entry in object.__dict__.keys(): element=getattr(object,entry) try: - if element.meta_type=="ECHO_collection": + if element.meta_type in ["ECHO_collection","ECHO_group"]: collections+="" collections+=getCollection(element,depth)+"\n" except: @@ -740,7 +743,7 @@ class ECHO_collection(Folder, Persistent setECHO_collectionInformation(self,title,label,description,contentType,responsible,credits,weight,coordsnew) - + self.coords=coordsnew[0:] # HACK fehler in setECHO_collection self.sortfield=sortfield @@ -812,39 +815,11 @@ class ECHO_collection(Folder, Persistent return ids - def getSubCols(self,sortfield="weight"): - subColTypes=['ECHO_collection','ECHO_externalLink','ECHO_resource'] - ids=[] - for entry in self.__dict__.keys(): - object=getattr(self,entry) - try: - if object.meta_type in subColTypes: - ids.append(object) - - except: - """nothing""" - try: - sortfield=self.sortfield - except: - """nothing""" - - tmplist=[] - for x in ids: - if hasattr(x,sortfield): - try: - x=int(x) - except: - """nothing""" - tmp=getattr(x,sortfield) - else: - tmp=10000000 - tmplist.append((tmp,x)) - tmplist.sort() - return [x for (key,x) in tmplist] + + + getSubCols = ECHO_helpers.getSubCols - - @@ -889,14 +864,15 @@ class ECHO_group(ECHO_collection): pt=PageTemplateFile('Products/ECHO_content/zpt/ChangeECHO_group.zpt').__of__(self) return pt() - def changeECHO_group(self,title,label,description,contentType,responsible,weight,secondaryLink,secondaryLinkTitle,credits=None,sortfield="weight",coords=None,RESPONSE=None,imageTag="",bgcolour=""): + def changeECHO_group(self,title,label,description,contentType,responsible,weight,secondaryLink,secondaryLinkTitle,credits=None,sortfield="weight",coords=None,RESPONSE=None,imageTag="",bgcolour="",logo=""): """Änderung der Properties""" self.secondaryLink=secondaryLink self.secondaryLinkTitle=secondaryLinkTitle self.imageTag=imageTag self.bgcolour=bgcolour - + self.logo=logo + if coords: coordsnew=[ string.split(x,",") for x in coords] self.coords=coordsnew[0:] @@ -912,7 +888,14 @@ class ECHO_group(ECHO_collection): if RESPONSE is not None: RESPONSE.redirect('manage_main') - + + def getLogo(self): + """logo ausgeben""" + try: + return self.logo + except: + return "ECHO_groups" + def content_html(self): """template fuer content""" return content_html(self,'group') @@ -925,14 +908,15 @@ def manage_addECHO_groupForm(self): return pt() -def manage_addECHO_group(self,id,title,label,description,contentType,responsible,weight,sortfield,coords="",secondaryLinkTitle="",secondaryLink="",credits=None,RESPONSE=None,imageTag="",bgcolour=""): +def manage_addECHO_group(self,id,title,label,description,contentType,responsible,weight,sortfield,coords="",secondaryLinkTitle="",secondaryLink="",credits=None,RESPONSE=None,imageTag="",bgcolour="",logo=""): """add a echo group""" newObj=ECHO_group(id,title,label,description,contentType,responsible,credits,weight,sortfield,coords,secondaryLinkTitle=secondaryLinkTitle,secondaryLink=secondaryLink,imageTag=imageTag,bgcolour="") + setattr(newObj,'logo',logo) self._setObject(id,newObj) - + if RESPONSE is not None: RESPONSE.redirect('manage_main')