Back to index

plone3  3.1.7
kupu.py
Go to the documentation of this file.
00001 # -*- coding: UTF-8 -*-
00002 from zope.interface import implements
00003 from plonekssview import PloneKSSView
00004 from kss.core import force_unicode, kssaction
00005 from interfaces import IPloneKSSView
00006 
00007 class KupuSaveView(PloneKSSView):
00008 
00009     # --
00010     # Calendar in-place refreshment
00011     # --
00012 
00013     implements(IPloneKSSView)
00014 
00015     @kssaction
00016     def save(self, text, fieldname):
00017         "In-place saving of kupu text area's."
00018         corecommands = self.getCommandSet('core')
00019         self.context.getField(fieldname).set(self.context, text, mimetype='text/html')
00020         
00021         selector = corecommands.getCssSelector('body')
00022         corecommands.insertHTMLAsLastChild(
00023             selector, '<div class="kupu-save-message">Document saved</div>')