예제 #1
0
 def hide_hidden_attributes(self):
     """Use the bika_listing's contentFilter's portal_type
     values, if any, to remove fields from review_states if they
     are marked as hidden in the registry.
     """
     if 'portal_type' not in self.bika_listing.contentFilter:
         return
     ptlist = self.bika_listing.contentFilter['portal_type']
     if isinstance(ptlist, basestring):
         ptlist = [ptlist, ]
     new_states = []
     for portal_type in ptlist:
         hiddenattributes = getHiddenAttributesForClass(portal_type)
         for i, state in enumerate(self.bika_listing.review_states):
             for field in state['columns']:
                 if field in hiddenattributes:
                     state['columns'].remove(field)
             new_states.append(state)
     self.bika_listing.review_states = new_states
예제 #2
0
 def __call__(self, context, mode, field, default):
     state = default if default else 'visible'
     hiddenattributes = getHiddenAttributesForClass(context.portal_type)
     if field.getName() in hiddenattributes:
         state = "hidden"
     return state
예제 #3
0
 def __call__(self, context, mode, field, default):
     state = default if default else 'visible'
     hiddenattributes = getHiddenAttributesForClass(context.portal_type)
     if field.getName() in hiddenattributes:
         state = "hidden"
     return state