[CMF-checkins] CVS: CMF - css_inline_or_link.py:1.1 discussion_reply.py:1.1 css_inline_or_link.dtml:NONE

Jens Vagelpohl jens@digicool.com
Mon, 18 Jun 2001 18:47:13 -0400 (EDT)


Update of /cvs-repository/CMF/CMFDefault/skins/generic
In directory korak.digicool.com:/tmp/cvs-serv24474

Added Files:
	css_inline_or_link.py discussion_reply.py 
Removed Files:
	css_inline_or_link.dtml 
Log Message:
Changed two deserving methods from filesystem DTML methods to python scripts




--- Added File css_inline_or_link.py in package CMF ---
## Script (Python) "css_inline_or_link"
##parameters=
##bind namespace=_
##title=Browser detection for stylesheet handling

import string

stylesheet_code = ''

if hasattr(context, 'stylesheet_properties'):
    ag = context.REQUEST.get('HTTP_USER_AGENT', '')
    do_inline_css = 1
    sheet = context.stylesheet_properties.select_stylesheet_id

    if sheet:
        if ag[:9] == 'Mozilla/4' and string.find(ag, 'MSIE') < 0:
            s_obj = getattr(context, sheet)
            s_content = s_obj(None, _, do_inline_css=1)
            stylesheet_code = '<style type="text/css">\n<!--\n %s\n -->\n</style>' % s_content
        else:
            s_url = '%s/%s' % (context.portal_url(), sheet)
            stylesheet_code = '<link rel="stylesheet" href="%s" type="text/css" />' % s_url

return stylesheet_code

--- Added File discussion_reply.py in package CMF ---
## Script (Python) "discussion_reply"
##parameters=title,text,Creator
##title=Reply to content

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

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

context.REQUEST.RESPONSE.redirect(target)


--- Removed file css_inline_or_link.dtml from package CMF --