Ignore:
Timestamp:
Jan 5, 2012 12:12:37 PM (12 years ago)
Author:
kroman0
Message:

Excluded/required roles in Static Stylish portlet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.portlet.static/trunk/quintagroup/portlet/static/vocabularies.py

    r3214 r3336  
    22from zope.interface import implements 
    33from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary 
     4from zope.i18n import translate 
    45 
    56from Products.CMFCore.utils import getToolByName 
     
    4142 
    4243PortletCSSVocabulary = PortletCSSVocabulary() 
     44 
     45 
     46class GlobalRolesVocabulary(object): 
     47    implements(IVocabularyFactory) 
     48 
     49    def __call__(self, context): 
     50        roles = context.getGlobalPortalRoles() 
     51 
     52        return SimpleVocabulary( 
     53            [SimpleTerm( 
     54                role, role, 
     55                translate(role, domain="plone", context=context.REQUEST) \ 
     56                ) for role in roles] 
     57            ) 
     58 
     59 
     60GlobalRolesVocabulary = GlobalRolesVocabulary() 
Note: See TracChangeset for help on using the changeset viewer.