--- MPIWGWeb/Attic/MPIWGTemplate.py 2008/09/03 11:13:43 1.1.2.4 +++ MPIWGWeb/Attic/MPIWGTemplate.py 2009/04/17 08:55:32 1.1.2.9 @@ -9,31 +9,17 @@ from OFS.Folder import Folder from AccessControl import ClassSecurityInfo from MPIWGHelper import * +# dummy definitions for backwards compatibility +import MPIWGFeature -def getBreadcrumbs(self): - """return list of breadcrumbs from here to the root""" - crumbs = [(self.title, self.absolute_url(), self)] - parent = self.aq_parent - if hasattr(parent, 'getBreadcrumbs'): - if self.title: - return parent.getBreadcrumbs() + crumbs - else: - # if there's no title, skip this level - return parent.getBreadcrumbs() - - return crumbs +class MPIWGFeature(MPIWGFeature.MPIWGFeature): + """deprecated! use class in MPIWGFeature.py""" +import MPIWGFolder + +class MPIWGFolder(MPIWGFolder.MPIWGFolder): + """deprecated! use class in MPIWGFolder.py""" -def getSection(self): - """returns the current section name""" - p = self - sec = None - # descend parents to the root (and remember the last id) - while p is not None and p.meta_type != 'MPIWGRoot': - sec = p.getId() - p = p.aq_parent - - return sec class MPIWGTemplate(ZopePageTemplate): @@ -75,9 +61,9 @@ class MPIWGTemplate(ZopePageTemplate): return "" getBreadcrumbs = getBreadcrumbs - getSection = getSection - + getSubSection = getSubSection + def harvest_page(self): """harvest main""" try: @@ -134,67 +120,4 @@ def manage_addMPIWGTemplate(self, MPIWGT REQUEST.RESPONSE.redirect(u+'/manage_main') return '' - - - -class MPIWGFolder(Folder): - """special Folder object for MPIWG website """ - - meta_type="MPIWGFolder" - - manage_options=Folder.manage_options+( - {'label':'Change Weight','action':'changeWeightForm'}, - {'label':'Main Config','action':'changeForm'}, - ) - - changeWeightForm = PageTemplateFile('zpt/MPIWGFolderChangeWeight', globals()) - changeForm = PageTemplateFile('zpt/MPIWGFolderConfig', globals()) - - def __init__(self, id, title=None, weight=0, canonicalName=None): - self.id = str(id) - self.weight = weight - if title is None: - self.title = id - else: - self.title = title - - if canonicalName is None: - self.canonicalName = self.id - else: - self.canonicalName = canonicalName - - def changeWeight(self,weight,RESPONSE=None): - """change weight""" - self.weight=weight - if RESPONSE is not None: - RESPONSE.redirect('manage_main') - - def changeMPIWGFolder(self, title=None, weight=None, canonicalName=None, RESPONSE=None): - """change everything""" - if title is not None: - self.title = title - if weight is not None: - self.weight = weight - if canonicalName is not None: - self.canonicalName = canonicalName - if RESPONSE is not None: - RESPONSE.redirect('manage_main') - - getBreadcrumbs = getBreadcrumbs - - getSection = getSection - - -def manage_addMPIWGFolderForm(self): - """Form for adding""" - pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt/AddMPIWGFolder.zpt')).__of__(self) - return pt() - -def manage_addMPIWGFolder(self, id, title=None,weight=0,RESPONSE=None): - "Add a MPIWG Folder." - newObj=MPIWGFolder(id,title,weight) - self.Destination()._setObject(id,newObj) - if RESPONSE is not None: - RESPONSE.redirect('manage_main') - \ No newline at end of file