version 1.103.2.3, 2012/01/17 18:39:07
|
version 1.103.2.4, 2012/01/19 19:03:28
|
Line 11 from OFS.SimpleItem import SimpleItem
|
Line 11 from OFS.SimpleItem import SimpleItem
|
from Globals import package_home |
from Globals import package_home |
import Globals |
import Globals |
from AccessControl import ClassSecurityInfo |
from AccessControl import ClassSecurityInfo |
|
from Acquisition import aq_parent,aq_chain,aq_base |
import os.path |
import os.path |
from OFS.Folder import Folder |
from OFS.Folder import Folder |
import ECHO_collection |
import ECHO_collection |
Line 694 def checkOnlyOneInGroup(object):
|
Line 695 def checkOnlyOneInGroup(object):
|
else: return object |
else: return object |
|
|
|
|
|
|
|
def getCrumb(self): |
|
"""returns breadcrumb for this object""" |
|
# ignore this object if title is empty |
|
if not self.title: |
|
return None |
|
|
|
crumb = {'obj': self, |
|
'url': self.absolute_url(), |
|
'label': self.getLabel()} |
|
return crumb |
|
|
|
# roots of the ECHO hierarchy |
|
rootMetaTypes = ['ECHO_root', 'ECHO_main', 'ECHO_nav'] |
|
|
|
def getHierCrumbs(self): |
|
"""returns a list of hierarchical breadcrumbs from self to the ECHO_root""" |
|
crumbs = [] |
|
# walk the acquisition chain |
|
for obj in aq_chain(self): |
|
#logging.debug("getHiercrumbs: obj=%s"%(obj)) |
|
# test if the object really has a getCrumb method |
|
if hasattr(aq_base(obj), 'getCrumb'): |
|
crumb = obj.getCrumb() |
|
#logging.debug("getHiercrumbs: got %s from %s"%(crumb,obj)) |
|
if crumb is not None: |
|
crumbs.insert(0, crumb) |
|
|
|
if obj.meta_type in rootMetaTypes: |
|
# stop when we reach the ECHO root |
|
return crumbs |
|
|
|
return crumbs |
|
|
|
|
def getSubCols(self, sortfield=None, |
def getSubCols(self, sortfield=None, |
subColTypes=displayTypes, |
subColTypes=displayTypes, |
sortFieldMD=None, |
sortFieldMD=None, |