[Zope-CMF] re: changing reply to comment

Jeffrey P Shell jeffrey@cuemedia.com
Wed, 26 Sep 2001 09:14:40 -0600


On 9/25/01 9:53 PM, "zope-cmf-request@zope.org" <zope-cmf-request@zope.org>
wrote:

> Subject: [Zope-CMF] changing "reply" to "comment"
> 
> First, a quick intoduction.  I am the technology coordinator of a new high
> school in Providence, RI.  I have decided to use Zope and the CMF to create
> our community website and digital portfolio system.
> 
> I was very successful using zwiki and squishdot with the teachers over the
> summer with a non-CMF site, although I have had a few problems jumping to the
> CMF, seemingly because of the Python and Zope version changes and
> inconsistencies raised by that.  I am anxously awaiting the CMF's update to
> 2.4 and getting CMFWiki working properly.
> 
> I'm just getting started with the cryptic guts of CMF, but there are a few
> interface changes I'd like to make which don't seem like they'd be too tough
> if I knew where to look.  For example, I've got comments set up, but I don't
> think "Reply" is what people will be looking for.  I think "Comment" or
> something like that might be more intuitive.  Anyhow, where can I change this?

I just did this for a project I'm working on.  I made a new Tool class in
Python that changed the listActions() method as a quick hack (this is
assuming some knowledge of Python):

file: Products/Other/comments.py

from Products.CMFDefault.DiscussionTool import DiscussionTool
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass

class OtherDiscussionTool(DiscussionTool):
    """ Subclassed discussion tool for specific purposes """
    meta_type = 'Other Discussion Tool'
    security = ClassSecurityInfo()

    ### ActionProvider Interface
    security.declarePrivate('listActions')
    def listActions(self, info):
        acts = DiscussionTool.listActions(self, info) # super(info)
        if acts is not None:
            acts[0]['name'] = 'Comment on'
            acts[0]['id'] = 'reply'
        return acts

InitializeClass(OtherDiscussionTool)


file: Products/Other/__init__.py

from Products.CMFCore import utils
import comments

def initialize(context):
    utils.ToolInit(
        'Other Tools',
        tools=(comments.OtherDiscussionTool,),
        product_name='Other',
        icon='tool.gif',
      ).initialize(context)