Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | Static Private Attributes
CMFEditions.Modifiers.ConditionalTalesModifier Class Reference
Inheritance diagram for CMFEditions.Modifiers.ConditionalTalesModifier:
Inheritance graph
[legend]
Collaboration diagram for CMFEditions.Modifiers.ConditionalTalesModifier:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def edit
def isApplicable
def getTalesCondition
def edit
def isEnabled
def getModifier

Public Attributes

 id
 title
 meta_type

Static Public Attributes

tuple modifierEditForm
tuple manage_options = ({'label' : 'Edit', 'action' : 'modifierEditForm'},)
 manage = manage_mainmodifierEditForm

Private Attributes

 _condition

Static Private Attributes

tuple __implements__

Detailed Description

This is a wrapper with a tales condition for a modifier.

Definition at line 106 of file Modifiers.py.


Constructor & Destructor Documentation

def CMFEditions.Modifiers.ConditionalTalesModifier.__init__ (   self,
  id,
  modifier,
  title = '' 
)
See IConditionalTalesModifier.

Reimplemented from CMFEditions.Modifiers.ConditionalModifier.

Definition at line 119 of file Modifiers.py.

00119 
00120     def __init__(self, id, modifier, title=''):
00121         """See IConditionalTalesModifier.
00122         """
00123         ConditionalModifier.__init__(self, id, modifier, title)
00124         self._condition = None


Member Function Documentation

def CMFEditions.Modifiers.ConditionalModifier.edit (   self,
  enabled = None,
  title = '',
  REQUEST = None 
) [inherited]
See IConditionalModifier.

Definition at line 68 of file Modifiers.py.

00068 
00069     def edit(self, enabled=None, title='', REQUEST=None):
00070         """See IConditionalModifier.
00071         """
00072         self.title = title
00073 
00074         if enabled is not None and (enabled=='True' or enabled==True):
00075             self._enabled = enabled
00076         else:
00077             self._enabled = False
00078 
00079         if REQUEST:
00080             REQUEST.set("manage_tabs_message", "Changed")
00081             return self.modifierEditForm(self, REQUEST)

Here is the caller graph for this function:

def CMFEditions.Modifiers.ConditionalTalesModifier.edit (   self,
  enabled = None,
  condition = None,
  title = '',
  REQUEST = None 
)
See IConditionalTalesModifier.

Definition at line 125 of file Modifiers.py.

00125 
00126     def edit(self, enabled=None, condition=None, title='', REQUEST=None):
00127         """See IConditionalTalesModifier.
00128         """
00129         ConditionalModifier.edit(self, enabled, title)
00130         if condition is not None and condition != self.getTalesCondition():
00131             self._condition = Expression(condition)
00132 
00133         if REQUEST:
00134             REQUEST.set("manage_tabs_message", "Changed")
00135             return self.modifierEditForm(self, REQUEST)

Here is the call graph for this function:

Here is the caller graph for this function:

See IConditionalModifier.

Definition at line 94 of file Modifiers.py.

00094 
00095     def getModifier(self):
00096         """See IConditionalModifier.
00097         """
00098         return self._modifier
00099 
00100 InitializeClass(ConditionalModifier)
00101 

See IConditionalTalesModifier.

Definition at line 147 of file Modifiers.py.

00147 
00148     def getTalesCondition(self):
00149         """See IConditionalTalesModifier.
00150         """
00151         return getattr(self._condition, 'text', '')
00152 
00153 InitializeClass(ConditionalTalesModifier)
00154 

Here is the caller graph for this function:

def CMFEditions.Modifiers.ConditionalTalesModifier.isApplicable (   self,
  obj,
  portal = None 
)
See IConditionalTalesModifier.

Reimplemented from CMFEditions.Modifiers.ConditionalModifier.

Definition at line 136 of file Modifiers.py.

00136 
00137     def isApplicable(self, obj, portal=None):
00138         """See IConditionalTalesModifier.
00139         """
00140         # check if disabled or an empty condition
00141         if not self._enabled or not self.getTalesCondition():
00142             return False
00143 
00144         # create the expression context and return result
00145         context = createExpressionContext(obj, portal)
00146         return self._condition(context)

Here is the call graph for this function:

See IConditionalModifier.

Definition at line 89 of file Modifiers.py.

00089 
00090     def isEnabled(self):
00091         """See IConditionalModifier.
00092         """
00093         return self._enabled


Member Data Documentation

Initial value:
(
        IConditionalTalesModifier,
    )

Reimplemented from CMFEditions.Modifiers.ConditionalModifier.

Definition at line 110 of file Modifiers.py.

Definition at line 123 of file Modifiers.py.

Definition at line 62 of file Modifiers.py.

CMFEditions.Modifiers.ConditionalModifier.manage = manage_mainmodifierEditForm [static, inherited]

Definition at line 56 of file Modifiers.py.

tuple CMFEditions.Modifiers.ConditionalTalesModifier.manage_options = ({'label' : 'Edit', 'action' : 'modifierEditForm'},) [static]

Reimplemented from CMFEditions.Modifiers.ConditionalModifier.

Definition at line 117 of file Modifiers.py.

Definition at line 64 of file Modifiers.py.

Initial value:
PageTemplateFile('www/talesModifierEditForm.pt',
                                        globals(),
                                        __name__='modifierEditForm')

Reimplemented from CMFEditions.Modifiers.ConditionalModifier.

Definition at line 114 of file Modifiers.py.

Definition at line 63 of file Modifiers.py.


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