From: Helge T. <te...@us...> - 2005-02-06 00:30:06
|
Update of /cvsroot/collective/Ploneboard/types In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9236/types Modified Files: Ploneboard.py PloneboardComment.py PloneboardForum.py Log Message: Enabled transform for preview, fixed a couple of other small issues, updated the todo list. Index: Ploneboard.py =================================================================== RCS file: /cvsroot/collective/Ploneboard/types/Ploneboard.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Ploneboard.py 27 Sep 2004 10:32:54 -0000 1.3 +++ Ploneboard.py 6 Feb 2005 00:29:50 -0000 1.4 @@ -48,8 +48,8 @@ schema = BaseBTreeFolderSchema + Schema(( TextField('description', searchable = 1, - default_content_type = 'text/plain', - default_output_type = 'text/html', + default_content_type = 'text/html', + default_output_type = 'text/plain', widget = TextAreaWidget(description = "Enter a brief description of the board.", description_msgid = "help_description", label = "Description", Index: PloneboardForum.py =================================================================== RCS file: /cvsroot/collective/Ploneboard/types/PloneboardForum.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- PloneboardForum.py 27 Sep 2004 10:32:54 -0000 1.3 +++ PloneboardForum.py 6 Feb 2005 00:29:50 -0000 1.4 @@ -58,8 +58,8 @@ schema = BaseBTreeFolderSchema + Schema(( TextField('description', searchable = 1, - default_content_type = 'text/plain', - default_output_type = 'text/html', + default_content_type = 'text/html', + default_output_type = 'text/plain', widget = TextAreaWidget(description = "Enter a brief description of the forum.", description_msgid = "help_description", label = "Description", Index: PloneboardComment.py =================================================================== RCS file: /cvsroot/collective/Ploneboard/types/PloneboardComment.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- PloneboardComment.py 27 Sep 2004 10:32:54 -0000 1.3 +++ PloneboardComment.py 6 Feb 2005 00:29:50 -0000 1.4 @@ -349,28 +349,23 @@ ############################################ + security.declareProtected(ViewBoard, 'getText') def getText(self, mimetype=None, **kwargs): """ """ - # Maybe we need to set cashing for transform? + # Maybe we need to set caching for transform? orig = self.text.getRaw() pb_tool = getToolByName(self, 'portal_ploneboard') - transform_tool = getToolByName(self, 'portal_transforms') - - # This one is very important, because transform object has no - # acquisition context inside it, so we need to pass it our one - kwargs.update({ 'context' : self }) - - data = transform_tool._wrap('text/plain') - - for transform in map(lambda x: x[1], pb_tool.getEnabledTransforms()): - data = transform.convert(orig, data, **kwargs) - orig = data.getData() - transform_tool._setMetaData(data, transform) - - orig = orig.replace('\n', '<br/>') - return orig + return pb_tool.performCommentTransform(orig, context=self) + + security.declareProtected(ViewBoard, 'Description') + def Description(self, **kwargs): + """We have to override Description here to handle arbitrary + arguments since PortalFolder defines it.""" + if kwargs.get('mimetype', None) is None: + kwargs['mimetype'] = 'text/plain' + return self.getField('text').get(self, **kwargs) def __nonzero__(self): return 1 |