1 <html metal:use-macro="here/main_template/macros/master">
3 <meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
4 <title>folder_factories</title>
5 <link href="zpt_stylesheet.css" rel="stylesheet" media="screen"/>
6 <link href="../content/plinn_style.css" rel="stylesheet" media="screen"/>
9 <div metal:fill-slot="main" i18n:domain="plinn">
10 <div tal:condition="python: not(here.portal_membership.checkPermission('Access contents information', here))">
11 <span tal:define="dummy here/unauthRedirect"/>
13 <form tal:attributes="action string:${here/absolute_url}/add_content" method="post" id="factories_form">
14 <table cellspacing="0" tal:define="ucn here/getUntitledContentName" class="FolderFactories">
17 <th i18n:translate="">Type</th>
18 <th i18n:translate="">Name</th>
21 <div tal:repeat="item here/allowedContentTypes" tal:omit-tag="">
22 <tr tal:define="icon python:here.restrictedTraverse(item.getIcon())">
24 <img tal:attributes="src icon/absolute_url ; alt item/Title ; height icon/height ; width icon/width" i18n:attributes="alt"/>
26 <td tal:content="item/Title" i18n:translate="" class="ListName">Content name</td>
27 <td tal:condition="python:not item.listActionInfos('object/create', check_visibility=0)">
28 <input type="text" name="id" size="24" tal:attributes="name string:${item/id}.id:record; value ucn"/>
30 <td tal:condition="python:item.listActionInfos('object/create', check_visibility=0)">
31 <input type="hidden" value="1" tal:attributes="name string:${item/id}.create_form:record"/>
34 <input type="submit" value="Add" tal:attributes="name string:${item/id}.type:record" i18n:attributes="value"/>
38 <td colspan="4" class="spacing"></td>
43 <script type="text/javascript" charset="utf-8">
45 var fform = document.getElementById('factories_form');
46 var fm = new FormManager(fform);
48 fm.onBeforeSubmit = function(self, evt) {
49 if (!fm.submitButton && submitButton)
50 self.submitButton = submitButton;
52 var id2type = /(^[^\.]+)\.id:record$/;
53 function trackFocus(evt) {
54 var input = getTargetedObject(evt);
55 var matches = id2type.exec(input.name);
56 if (matches && matches.length == 2)
57 submitButton = fform.elements[matches[1] + '.type:record'];
60 for (var i = 0 ; i < fform.elements.length ; i++) {
61 e = fform.elements[i];
63 addListener(e, 'focus', trackFocus);