Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Static Private Attributes
ATContentTypes.criteria.portaltype.ATPortalTypeCriterion Class Reference
Inheritance diagram for ATContentTypes.criteria.portaltype.ATPortalTypeCriterion:
Inheritance graph
[legend]
Collaboration diagram for ATContentTypes.criteria.portaltype.ATPortalTypeCriterion:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def getCurrentValues
def getCriteriaItems

Static Public Attributes

tuple security = ClassSecurityInfo()
 schema = ATPortalTypeCriterionSchema
string meta_type = 'ATPortalTypeCriterion'
string archetype_name = 'Portal Types Criterion'
string shortDesc = 'Select content types'

Static Private Attributes

tuple __implements__ = ATSelectionCriterion.__implements__+(IATTopicSearchCriterion, )

Detailed Description

A portal_types criterion

Definition at line 47 of file portaltype.py.


Member Function Documentation

Definition at line 79 of file portaltype.py.

00079 
00080     def getCriteriaItems(self):
00081         result = []
00082 
00083         if self.Value() is not '':
00084             result.append((self.Field(), self.Value()))
00085 
00086         return tuple(result)
00087 
00088 registerCriterion(ATPortalTypeCriterion, FIELD_INDICES)

Here is the call graph for this function:

Return enabled portal types

Definition at line 58 of file portaltype.py.

00058 
00059     def getCurrentValues(self):
00060          """Return enabled portal types"""
00061          plone_tool = getToolByName(self, 'plone_utils')
00062          portal_types = plone_tool.getUserFriendlyTypes()
00063          getSortTuple = lambda x: ((x.Title() or x).lower(),
00064            unicode(x.Title() or x), x.Title() or x)
00065 
00066          if self.Field() == 'Type':
00067             types_tool = getToolByName(self, 'portal_types')
00068             get_type = types_tool.getTypeInfo
00069             # first item in tuple is sortkey, second is untranslated Title
00070             # and third is Title as a translatable Message object
00071             portal_types = [getSortTuple(get_type(t)) for t in portal_types]
00072          else:
00073             portal_types = [(t.lower(), t, t) for t in portal_types]
00074 
00075          portal_types.sort()
00076          portal_types = [(p[1], p[2]) for p in portal_types]
00077          return DisplayList(portal_types)

Here is the call graph for this function:


Member Data Documentation

tuple ATContentTypes.criteria.portaltype.ATPortalTypeCriterion.__implements__ = ATSelectionCriterion.__implements__+(IATTopicSearchCriterion, ) [static, private]

Definition at line 50 of file portaltype.py.

Definition at line 54 of file portaltype.py.

Definition at line 53 of file portaltype.py.

Definition at line 52 of file portaltype.py.

Definition at line 51 of file portaltype.py.

Definition at line 55 of file portaltype.py.


The documentation for this class was generated from the following file: