def __call__(self, context): items = [] styles = getVocabulary(context) charset = self._charset(context) for value, title in styles: if not isinstance(title, unicode): title = title.decode(charset) if not isinstance(value, unicode): value = value.decode(charset) items.append(SimpleTerm(value, value, _(title))) items.sort(lambda x,y:cmp(x.title,y.title)) return SimpleVocabulary(items)
def get_portlet_styles_menu(self): return [ValueTitlePair(v,t) for (v,t) in getVocabulary(self.context)]