mirror of https://github.com/tLDP/LDP
Kill cmft stuff, doesn't belong in Lampadas.
This commit is contained in:
parent
ed813a6e36
commit
eea06092ca
|
@ -1,25 +0,0 @@
|
|||
## Script (Python) "collectKeywords"
|
||||
##title=Edit content
|
||||
##bind container=container
|
||||
##bind context=context
|
||||
##bind namespace=
|
||||
##bind script=script
|
||||
##bind subpath=traverse_subpath
|
||||
##parameters=name, index
|
||||
REQUEST=context.REQUEST
|
||||
|
||||
field = context.getField(name)
|
||||
|
||||
allowed = field.Vocabulary(context)
|
||||
enforce = field.enforceVocabulary
|
||||
|
||||
previous = container.portal_catalog.uniqueValuesFor(index)
|
||||
|
||||
if enforce:
|
||||
result = allowed
|
||||
else:
|
||||
result = allowed + previous
|
||||
|
||||
|
||||
result = result.sortedByValue()
|
||||
return result
|
|
@ -1,51 +0,0 @@
|
|||
## Script (Python) "content_edit"
|
||||
##title=Edit content
|
||||
##bind container=container
|
||||
##bind context=context
|
||||
##bind namespace=
|
||||
##bind script=script
|
||||
##bind subpath=traverse_subpath
|
||||
##parameters=id=''
|
||||
REQUEST=context.REQUEST
|
||||
args = {}
|
||||
formatted = {}
|
||||
|
||||
#new_context = context.portal_factory.doCreate(context, id, **args)
|
||||
|
||||
## Look for things with text_formatting
|
||||
for key, value in REQUEST.form.items():
|
||||
if key.endswith("_text_format"): ##FRAGILE, depends on template
|
||||
formatted[key[:-12]] = value
|
||||
else:
|
||||
if key.endswith("_text"):
|
||||
args[key[:-5]] = value
|
||||
else:
|
||||
args[key] = value
|
||||
|
||||
## Pull anything with a file passed in, removing any formatting refs from before
|
||||
for key, value in REQUEST.form.items():
|
||||
if key.endswith("_file"):
|
||||
filename = getattr(value, 'filename', '')
|
||||
if filename != '':
|
||||
value.seek(0)
|
||||
#new_context.set(key[:-5], value)
|
||||
context.set(key[:-5], value)
|
||||
#Remove other formatting associated with this key
|
||||
if formatted.has_key(key[:-5]):
|
||||
del formatted[key[:-5]]
|
||||
del args[key[:-5]]
|
||||
|
||||
#Set Anything complex up and remove it from the simple set
|
||||
for key in formatted.keys():
|
||||
#Set things with content types
|
||||
#new_context.set(key, args[key], formatted[key])
|
||||
context.set(key, args[key], formatted[key])
|
||||
del args[key]
|
||||
|
||||
## EDIT the remaining fields
|
||||
|
||||
#new_context.edit(**args)
|
||||
context.edit(**args)
|
||||
|
||||
#return ('success', new_context, {'portal_status_message':context.REQUEST.get('portal_status_message', 'Content changes saved.')})
|
||||
return ('success', context, {'portal_status_message':context.REQUEST.get('portal_status_message', 'Content changes saved.')})
|
|
@ -1,14 +0,0 @@
|
|||
## Script (Python) "deleteRef"
|
||||
##title=Delete a reference
|
||||
##bind container=container
|
||||
##bind context=context
|
||||
##bind namespace=
|
||||
##bind script=script
|
||||
##bind subpath=traverse_subpath
|
||||
##parameters=oid, tid
|
||||
REQUEST=context.REQUEST
|
||||
|
||||
ct = context.content_tool
|
||||
ct.deleteReference(oid, tid)
|
||||
|
||||
return REQUEST.RESPONSE.redirect("%s/reference_edit" % ct.getObject(oid).absolute_url())
|
|
@ -1,84 +0,0 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
|
||||
lang="en-US"
|
||||
metal:use-macro="here/main_template/macros/master">
|
||||
<body>
|
||||
|
||||
<div metal:fill-slot="main"
|
||||
tal:define="rejection here/rejectAnonymous;
|
||||
errors python:request.get('errors', {});
|
||||
Iterator python:modules['Products.CMFPlone'].IndexIterator;
|
||||
ct here/content_tool;
|
||||
tabindex python:Iterator();">
|
||||
|
||||
|
||||
<form class="group"
|
||||
name="edit_form"
|
||||
action="content_edit"
|
||||
method="post"
|
||||
enctype="multipart/form-data"
|
||||
tal:attributes="action request/URL"
|
||||
>
|
||||
|
||||
<table class="listing"
|
||||
summary="Object References"
|
||||
cellpadding="0" cellspacing="0" width="100%">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<span class="header" i18n:translate="">Referencing</span>
|
||||
</th>
|
||||
<th>
|
||||
<span class="header" i18n:translate="">Referenced By</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="65%">
|
||||
<table border="0" width="100%">
|
||||
<tbody>
|
||||
<tr tal:repeat="ref python:ct.getRefs(here)">
|
||||
<td><a href="#" tal:attributes="href python:ct.getObject(ref).absolute_url() + '/reference_edit';"
|
||||
tal:content="python: ct.getObject(ref).Title()"/>
|
||||
</td>
|
||||
<td>
|
||||
<font color="#f00000"><a href="#" tal:attributes="href string:${here/absolute_url}/deleteRef?oid=${here/UID}&tid=${ref};">X</a></font>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<span tal:repeat="ref python:ct.getBRefs(here)">
|
||||
<a href="#" tal:attributes="href python:ct.getObject(ref).absolute_url() + '/reference_edit';"
|
||||
tal:content="python: ct.getObject(ref).Title()"/><br/>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
<div class="row" tal:condition="here/cb_dataValid">
|
||||
<input class="context"
|
||||
type="submit"
|
||||
name="pasteReference"
|
||||
value="reference"
|
||||
tabindex=""
|
||||
i18n:attributes="value"
|
||||
tal:attributes="tabindex tabindex/next;" />
|
||||
</div>
|
||||
|
||||
<p>
|
||||
Copy objects from folders and then click the reference button. This will create references.
|
||||
</p>
|
||||
<input type="hidden" name="form_submitted" value="1" tal:attributes="value template/id" />
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue