示例#1
0
 def get_content_restriction_name(self):
     schema = self.get_content_restriction()
     if schema is not None:
         for addable in extensionRegistry.get_addables(requires=[IBlockable,]):
             if schema is addable['interfaces'][0]:
                 return addable['name']
     return None
def all_content_type_source(context):
   terms = [Term(value=None,
                       token='',
                       title=_(u"-- Choose a content type --"))]
   for addable in extensionRegistry.get_addables(requires=[IPageAware,]):
      terms.append(Term(value=addable['name'],
                              token=addable['name'],
                              title=addable['name']))
   return Vocabulary(terms)
示例#3
0
def content_type_source(context):
    terms = [SimpleTerm(value=IBlockable,
                        token='',
                        title=_(u"No restriction"))]
    for addable in extensionRegistry.get_addables(requires=[IBlockable,]):
        terms.append(
            SimpleTerm(
                value=addable['interfaces'][0],
                token=addable['name'],
                title=addable['name']))
    return SimpleVocabulary(terms)
示例#4
0
 def get_all_addables(self, require=None):
     if require is not None:
         if IInterface.providedBy(require):
             requires = [require,]
         else:
             requires = require
     else:
         requires = list(self.REQUIRES)
     return map(
         operator.itemgetter('name'),
         filter(self._is_installed,
                extensionRegistry.get_addables(requires=requires)))
示例#5
0
 def get_all_addables(self, require=None):
     if require is not None:
         if IInterface.providedBy(require):
             requires = [
                 require,
             ]
         else:
             requires = require
     else:
         requires = list(self.REQUIRES)
     return map(
         operator.itemgetter('name'),
         filter(self._is_installed,
                extensionRegistry.get_addables(requires=requires)))