Back to index

plone3  3.1.7
navigationCurrent.py
Go to the documentation of this file.
00001 ## Script (Python) "navigationCurrent"
00002 ##bind container=container
00003 ##bind context=context
00004 ##bind namespace=
00005 ##bind script=script
00006 ##bind subpath=traverse_subpath
00007 ##parameters=obj=None
00008 ##title=encapsulates the current and up one level box contents
00009 ##a
00010 
00011 context.plone_log("The navigationCurrent script is deprecated and will be "
00012                   "removed in Plone 4.0.")
00013 
00014 checkPermission=context.portal_membership.checkPermission
00015 
00016 listing=[]
00017 folder=None
00018 if obj is None:
00019     obj=context
00020 
00021 path_ids=context.portal_url.getRelativeContentPath(obj)
00022 
00023 if len(path_ids)>1:
00024     folder=obj.getParentNode()
00025 else:
00026     folder=context.portal_url.getPortalObject()
00027 
00028 if checkPermission('List folder contents', folder):
00029     for o in folder.listFolderContents():
00030         if o.getId()=='Folder' and o.Title()!='Favorites':
00031             if checkPermission('List folder contents', o):
00032                 listing.append(o)
00033         else:
00034             listing.append(o)
00035 
00036 return listing