[CMF-checkins] CVS: Products/CMFDefault/skins/zpt_generic - folder_factories.py:1.1 folder_factories_template.pt:1.1 unauthRedirect.py:1.4 folder_factories.pt:NONE

Yvo Schubbe y.2004_ at wcm-solutions.de
Tue Aug 3 10:28:51 EDT 2004


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

Modified Files:
	unauthRedirect.py 
Added Files:
	folder_factories.py folder_factories_template.pt 
Removed Files:
	folder_factories.pt 
Log Message:
- refactored folder_factories to avoid ugly error pages
- marked unauthRedirect as deprecated


=== Added File Products/CMFDefault/skins/zpt_generic/folder_factories.py ===
##parameters=add=''
##
form = context.REQUEST.form
if add and \
        context.validateType(**form) and \
        context.validateId(**form) and \
        context.folder_add_control(**form):
    return


options = {}

items = []
type_name = form.get('type_name', None)
for item in context.allowedContentTypes():
    item_id = item.getId()
    items.append( { 'checked': type_name == item_id,
                    'description': item.Description(),
                    'id': item_id,
                    'radio': 'cb_%s' % item_id.replace(' ', '_'),
                    'title': item.Title() } )
if len(items) == 1:
    items[0]['checked'] = True
options['batch'] = { 'listItemInfos': tuple(items) }

target = context.getActionInfo('object/new')['url']
id = form.get('id', '')
options['form'] = { 'action': target,
                    'id': id }

return context.folder_factories_template(**options)


=== Added File Products/CMFDefault/skins/zpt_generic/folder_factories_template.pt ===
<html metal:use-macro="context/main_template/macros/master">
<body>

<metal:slot metal:fill-slot="header" i18n:domain="cmf_default">
<h1 i18n:translate="">Add Content</h1>
</metal:slot>

<metal:slot metal:fill-slot="main" i18n:domain="cmf_default"
   tal:define="batch options/batch;
               form options/form">
<div class="Desktop">

<form action="folder_factories" method="post"
   tal:attributes="action form/action">
 <table class="FormLayout"
 ><tal:loop tal:repeat="item batch/listItemInfos">
  <tr>
   <td
   ><input type="radio" name="type_name" value="" id=""
       tal:attributes="value item/id; id item/radio; checked item/checked"
       /></td>
   <td class="ListName"
   ><label for="" tal:attributes="for item/radio"
       tal:content="item/title" i18n:translate=""></label></td>
  </tr>
  <tr>
   <td>&nbsp;</td>
   <td class="ListDefinition" tal:content="item/description"
      i18n:translate=""></td>
  </tr></tal:loop>
 </table>
 <div class="FormButtons">
  <strong i18n:translate="">ID:</strong>
  <input type="text" name="id" size="20" value=""
     tal:attributes="value form/id" />
  <input type="submit" name="add" value="Add"
     i18n:attributes="value" /></div>
</form>

</div>
</metal:slot>

</body>
</html>


=== Products/CMFDefault/skins/zpt_generic/unauthRedirect.py 1.3 => 1.4 ===
--- Products/CMFDefault/skins/zpt_generic/unauthRedirect.py:1.3	Tue Jun 11 09:17:22 2002
+++ Products/CMFDefault/skins/zpt_generic/unauthRedirect.py	Tue Aug  3 10:28:20 2004
@@ -1,7 +1,5 @@
-## Script (Python) "unauthRedirect.py $Revision$"
 ##parameters=
-##title=clear browser cookie
 ##
+# this script is deprecated
 REQUEST=context.REQUEST
 REQUEST.RESPONSE.redirect( context.absolute_url())
-

=== Removed File Products/CMFDefault/skins/zpt_generic/folder_factories.pt ===



More information about the CMF-checkins mailing list