[CMF-checkins] CVS: Products/CMFDefault/skins/zpt_generic - TitleOrId.py:1.1 clearCookie.py:1.1 discussion_reply.py:1.1 filterCookie.py:1.1 truncID.py:1.1

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


Update of /cvs-repository/Products/CMFDefault/skins/zpt_generic
In directory cvs.zope.org:/tmp/cvs-serv15093/CMFDefault/skins/zpt_generic

Added Files:
	TitleOrId.py clearCookie.py discussion_reply.py 
	filterCookie.py truncID.py 
Log Message:
- copied files to remove dependency on skins/generic


=== Added File Products/CMFDefault/skins/zpt_generic/TitleOrId.py ===
## Script (Python) "TitleOrId"
##parameters=dontCall=0
##title=Return Title or getId
if dontCall:
    title = context.Title
    id = context.id
else:
    title = context.Title()
    id = context.getId()
if title:
    return title 
else:
    return id 


=== Added File Products/CMFDefault/skins/zpt_generic/clearCookie.py ===
## Script (Python) "clearCookie.py $Revision: 1.1 $"
##parameters=
##title=clear browser cookie
##
REQUEST=context.REQUEST
REQUEST.RESPONSE.expireCookie('folderfilter', path='/')
REQUEST.RESPONSE.redirect( context.absolute_url() + '/folder_contents?portal_status_message=Filter+cleared.')



=== Added File Products/CMFDefault/skins/zpt_generic/discussion_reply.py ===
## Script (Python) "discussion_reply"
##parameters=title,text
##title=Reply to content

replyID = context.createReply( title = title
                             , text = text
                             )

target = '%s/%s' % (context.absolute_url(), replyID)

context.REQUEST.RESPONSE.redirect(target)



=== Added File Products/CMFDefault/skins/zpt_generic/filterCookie.py ===
## Script (Python) "filterCookie.py $Revision: 1.1 $"
##parameters=
##title=Manage filter cookie
##
REQUEST=context.REQUEST
if REQUEST.get('clear_view_filter', 0):
  context.clearCookie()
  REQUEST.set('folderfilter', '')
  REQUEST.set('close_filter_form', '1')
elif REQUEST.get('set_view_filter', 0):
  filter=context.encodeFolderFilter(REQUEST)
  REQUEST.RESPONSE.setCookie('folderfilter', filter, path='/',
                              expires='Wed, 19 Feb 2020 14:28:00 GMT')
  REQUEST.set('folderfilter', '%s' % filter)


=== Added File Products/CMFDefault/skins/zpt_generic/truncID.py ===
## Script (Python) "truncID.py $Revision: 1.1 $"
##parameters=objID, size 
##title=return truncated objID
##
if len(objID) > size:
    return objID[:size] + '...'
else:
   return objID



More information about the CMF-checkins mailing list