[CMF-checkins] CVS: Products/CMFTopic/skins/zpt_topic - topic_addCriterion.py:1.1 topic_addSubtopic.py:1.1 topic_deleteCriteria.py:1.1 topic_editCriteria.py:1.1 topic_editTopic.py:1.1 topic_icon.gif:1.1

Yvo Schubbe y.2004_ at wcm-solutions.de
Tue Jul 6 18:41:35 EDT 2004


Update of /cvs-repository/Products/CMFTopic/skins/zpt_topic
In directory cvs.zope.org:/tmp/cvs-serv22655/CMFTopic/skins/zpt_topic

Added Files:
	topic_addCriterion.py topic_addSubtopic.py 
	topic_deleteCriteria.py topic_editCriteria.py 
	topic_editTopic.py topic_icon.gif 
Log Message:
- copied files to remove dependency on skins/topic


=== Added File Products/CMFTopic/skins/zpt_topic/topic_addCriterion.py ===
## Script (Python) "topic_addCriterion"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=REQUEST, RESPONSE, field, criterion_type
##title=
##

context.addCriterion(field=field, criterion_type=criterion_type)

RESPONSE.redirect('%s/topic_criteria_form' % context.absolute_url())


=== Added File Products/CMFTopic/skins/zpt_topic/topic_addSubtopic.py ===
## Script (Python) "topic_addSubtopic"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=REQUEST, RESPONSE, new_id
##title=
##

topictype = context.getTypeInfo()
context.addSubtopic(new_id)

action = topictype.getActionById('subtopics')
url = '%s/%s?portal_status_message=%s' % (
    context.absolute_url(),
    action,
    "Subtopic+'%s'+added" % new_id
    )
RESPONSE.redirect(url)


=== Added File Products/CMFTopic/skins/zpt_topic/topic_deleteCriteria.py ===
## Script (Python) "topic_deleteCriteria"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=REQUEST, RESPONSE, criterion_ids
##title=
##

for cid in criterion_ids:
    context.deleteCriterion(cid)

message = 'Criteria+deleted.'
RESPONSE.redirect('%s/topic_criteria_form?portal_status_message=%s' % (
    context.absolute_url(), message)
                  )


=== Added File Products/CMFTopic/skins/zpt_topic/topic_editCriteria.py ===
## Script (Python) "topic_editCriteria"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=REQUEST, RESPONSE, criteria
##title=
##
"""\
Save changes to the list of criteria.  This is done by going over
the submitted criteria records and comparing them against the
criteria object's editable attributes.  A 'command' object is
built to send to the Criterion objects 'apply' method, which in turn
applies the command to the Criterion objects 'edit' method.
"""

for rec in criteria:
    crit = context.getCriterion(rec.id)
    command = {}
    for attr in crit.editableAttributes():
        tmp = getattr(rec, attr, None)
        # Due to having multiple radio buttons on the same page
        # with the same name but belonging to different records,
        # they needed to be associated with different records with ids
        if tmp is None:
            tmp = getattr(rec, '%s__%s' % (attr, rec.id), None)
        command[attr] = tmp
    crit.apply(command)

message='Changes+saved.'
RESPONSE.redirect('%s/topic_criteria_form?portal_status_message=%s' % (
    context.absolute_url(), message)
                  )



=== Added File Products/CMFTopic/skins/zpt_topic/topic_editTopic.py ===
## Script (Python) "topic_editTopic"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=REQUEST, RESPONSE, acquireCriteria, title=None, description=None
##title=
##

context.edit(acquireCriteria=acquireCriteria,
             title=title,
             description=description)

RESPONSE.redirect('%s/topic_view' % context.absolute_url())


=== Added File Products/CMFTopic/skins/zpt_topic/topic_icon.gif ===
  <Binary-ish file>


More information about the CMF-checkins mailing list