Changeset 3336 in products for quintagroup.portlet.static/trunk/quintagroup/portlet/static/vocabularies.py
- Timestamp:
- Jan 5, 2012 12:12:37 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.portlet.static/trunk/quintagroup/portlet/static/vocabularies.py
r3214 r3336 2 2 from zope.interface import implements 3 3 from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary 4 from zope.i18n import translate 4 5 5 6 from Products.CMFCore.utils import getToolByName … … 41 42 42 43 PortletCSSVocabulary = PortletCSSVocabulary() 44 45 46 class 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 60 GlobalRolesVocabulary = GlobalRolesVocabulary()
Note: See TracChangeset
for help on using the changeset viewer.