Back to index

plone3  3.1.7
Public Member Functions
archetypes.kss.fields.InlineEditingEnabledView Class Reference
Inheritance diagram for archetypes.kss.fields.InlineEditingEnabledView:
Inheritance graph
[legend]
Collaboration diagram for archetypes.kss.fields.InlineEditingEnabledView:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __call__

Detailed Description

Definition at line 263 of file fields.py.


Member Function Documentation

With a nasty although not unusual hack, we reach
out to the caller template, and examine the global
tal variable kss_inline_editable. If it is defined,
and if it is defined to false, we will prohibit
inline editing everywhere in the template.
We apply this 'magic' because the signature to getKssClasses
is already too complex, and it would be undesirable to
complicate it some more.

Definition at line 266 of file fields.py.

00266 
00267     def __call__(self):
00268         """With a nasty although not unusual hack, we reach
00269         out to the caller template, and examine the global
00270         tal variable kss_inline_editable. If it is defined,
00271         and if it is defined to false, we will prohibit
00272         inline editing everywhere in the template.
00273         We apply this 'magic' because the signature to getKssClasses
00274         is already too complex, and it would be undesirable to
00275         complicate it some more.
00276         """
00277         econtext = get_econtext()
00278         if econtext is None:
00279             # tests, probably
00280             return True
00281         # kss_inline_editable can be set to false in a template, and this
00282         # will prohibit inline editing in the page
00283         kss_inline_editable = econtext.vars.get('kss_inline_editable', None)
00284         # check the setting in site properties
00285         context = aq_inner(self.context)
00286         portal_properties = getToolByName(context, 'portal_properties')
00287         enable_inline_editing = None
00288         if getattr(aq_base(portal_properties), 'site_properties', None) is not None:
00289             site_properties = portal_properties.site_properties
00290             if getattr(aq_base(site_properties), 'enable_inline_editing', None) is not None:
00291                 enable_inline_editing = site_properties.enable_inline_editing
00292         # If none of these is set, we enable inline editing. The global
00293         # site_property may be overwritten by the kss_inline_editable variable
00294         if kss_inline_editable is None:
00295             inline_editable = enable_inline_editing
00296         else:
00297             inline_editable = kss_inline_editable
00298         if inline_editable is None:
00299             inline_editable = True
00300         # In addition we also check suppress_preview.
00301         # suppress_preview is set by CMFEditions, when version preview is shown
00302         # This means inline editing should be disabled globally
00303         suppress_preview = econtext.vars.get('suppress_preview', False)
00304         return inline_editable and not suppress_preview
00305 
00306 
00307 # --
00308 # (Non-ajax) browser view for decorating the field
00309 # --

Here is the call graph for this function:

Here is the caller graph for this function:


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