[Zapp-cvs-commit] ZApp/skins/zapp_generic zapp_cmf_object_export.py,NONE,1.1 zapp_cmf_xml_edit.py,NO
Brought to you by:
sspickle
|
From: <ssp...@us...> - 2004-01-20 03:42:56
|
Update of /cvsroot/zapp/ZApp/skins/zapp_generic
In directory sc8-pr-cvs1:/tmp/cvs-serv19164/skins/zapp_generic
Added Files:
zapp_cmf_object_export.py zapp_cmf_xml_edit.py
zapp_cmf_xml_form.pt
Log Message:
adde new skin methods/templates
--- NEW FILE: zapp_cmf_object_export.py ---
## Script (Python) "setCurrentStack"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=currStack
##title=
##
import xmlrpclib
return xmlrpclib.dumps(context.safeMiscData.getXMLDict()
--- NEW FILE: zapp_cmf_xml_edit.py ---
## Script (Python) "zapp_cmf_xml_edit"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=xml, dataType="", no_redir=0, redirect_url=''
##title=
##
"""
Save xml directly....
"""
miscData = context.getMiscData( dataType=dataType, createIfNone=1 )
if not miscData:
raise RuntimeError, "Dang... can't find misc data object...."
miscData.change( xml = xml )
if no_redir:
return "OK!"
else:
if not redirect_url:
redirect_url = context.absolute_url() + '/zapp_cmf_xml_form?portal_status_message=ZApp+CMF+Object+Changed.'
context.REQUEST.RESPONSE.redirect(redirect_url)
return "redirecting.. "
--- NEW FILE: zapp_cmf_xml_form.pt ---
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
metal:use-macro="here/main_template/macros/master">
<metal:block fill-slot="base">
<base href=""
tal:attributes="href python: here.absolute_url() + '/'">
</metal:block>
<body>
<div metal:fill-slot="main">
<form action="" tal:attributes="action string:${here/absolute_url}/zapp_cmf_xml_edit"
tal:define="dataType here/dataType | request/dataType | nothing;
miscData python:here.getMiscData( dataType=dataType or '', createIfNone=1);"
method="post">
<textarea tal:condition="miscData" rows="30" cols="70" name="xml" tal:content="miscData/xml"/>
<span tal:condition="not:miscData" tal:content="string:Sorry... no misc data"/>
<input type="submit" name="save"/>
</form>
</div>
</body>
</html>
|