Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def tabs(self):
- url = IURL(self.context, self.request)
- list=[(u"delete",u"Delete",IDeletable),
- (u"display",u"Display",IDisplayable),
- #(u"rename",u"Rename",IRenameable),
- (u"edit",u"Edit",IEditable),
- (u"addContainer",u"Add Container",IAddContainer)
- ]
- for id, name, anInterface in :
- if not anInterface.providedBy(self.context):
- continue
- import pdb; pdb.set_trace()
- yield {
- 'active': (getattr
- (self.view,'cromlech.context').providedBy(self.context)
- is anInterface),
- 'title': title.get(view) or id,
- 'url': '%s/%s' % (url, id),
- }
- for id, view in self._tabs:
- #Basically if the views are for Ileaves
- #And the context is ILeaf,
- #or vice versa display them.
- #Really this should be
- #if not (( getattr(view,'cromlech.context')==ITreeLeaf) ==
- # (ILeaf.providedBy(self.context))):
- if not getattr(view,'cromlech.context').providedBy(self.context):
- continue
- yield {
- 'active': self.view.__class__ is view,
- 'title': title.get(view) or id,
- 'url': '%s/%s' % (url, id),
- }
Advertisement
Add Comment
Please, Sign In to add comment