You operate with full rights, usually that's dangerously too much.
|
|
<html xmlns:dsssl="http://www.askemos.org/2000/NameSpaceDSSSL" xmlns:xslt="http://www.w3.org/1999/XSL/Transform">
<xslt:variable name="formid">
<dsssl:copy-of select="
(literal (data (form-field 'id (current-node))))"></dsssl:copy-of>
</xslt:variable>
<xslt:variable name="selected">
<dsssl:copy-of select="#CONTENT">
(node-list
(let ((id (data (xsl-variable "formid"))))
(node-list-filter
(lambda (node) (and (match-element? 'person node)
(equal? id (attribute-string 'id node))))
(xsl-variable "persons")))
(xsl-variable "schema"))
</dsssl:copy-of>
</xslt:variable>
<head>
<title>gcai</title>
</head>
<body bccolor="white">
<dsssl:if test="(service-level)">
<h1>Take Care!</h1>
<p>You operate with full rights, usually that's dangerously too
much.</p>
<hr></hr>
</dsssl:if>
<h1>gcai</h1>
<table>
<tr valign="top">
<td>
<table>
<tr>
<td>Name</td>
<td>Vorname</td>
</tr>
<dsssl:for-each select="(xsl-variable "persons")">
<tr>
<td>
<dsssl:a href="
(read-locator
(msg 'location-format)
(cons (string-append "?id="
(attribute-string 'id (current-node)))
(msg 'location)))">
<dsssl:copy-of select="(children (node-list-first
(select-elements (children (current-node)) 'firstname)))"></dsssl:copy-of>
</dsssl:a>
</td>
<td>
<dsssl:copy-of select="(children (node-list-first
(select-elements (children (current-node)) 'name)))"></dsssl:copy-of>
</td>
</tr>
</dsssl:for-each>
</table>
</td>
<td>
<dsssl:form action="'()" method="POST">
<table bgcolor="black" border="2" cellspacing="5">
<tr>
<td bgcolor="white">
<table border="0">
<tr>
<td>Vorname</td>
<td>
<input name="firstname" type="text">
<xslt:attribute name="value">
<dsssl:copy-of select="#CONTENT">
(select-elements (children (node-list-first (xsl-variable "selected")))
'firstname)
</dsssl:copy-of>
</xslt:attribute>
</input>
</td>
</tr>
<!--
Now let's introduce another short hand. The next input element
is equivalent to the last one. Attributes in the dsssl name space
are evaluated.
-->
<tr>
<td>Name</td>
<td>
<dsssl:input name="name" type="text" dsssl:value="
(select-elements
(children (node-list-first (xsl-variable "selected")))
'name) "></dsssl:input>
</td>
</tr>
<tr>
<td>Kürzel</td>
<td>
<dsssl:copy-of select="(xsl-variable "formid")"></dsssl:copy-of>
</td>
</tr>
<tr>
<td>Oid</td>
<td>
<dsssl:copy-of select="
(let ((id (string->oid
(data (select-elements
(children (node-list-first (xsl-variable "selected")))
'id)))))
(if id (literal id)
(make element
gi: 'input
attributes: '((name "oid")
(type "text")))))
"></dsssl:copy-of>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="white">
<p>Benutzer-Optionen</p>
<dsssl:copy-of select="#CONTENT">
(let ((roles (xsl-variable "roles"))
(rights (node-list-reduce
(children (select-elements (children (xsl-variable "selected"))
'rights))
(lambda (c n) (let ((v (node-list->right n)))
(or (and v (cons v c)) c)))
'())))
(node-list-map
(lambda (node)
(node-list
(make element gi: 'input
attributes: `(,@(if (member
(node-list->right
(node-list-first
(select-elements (children node) 'right)))
rights)
'((checked "checked"))
'())
(value ,(attribute-string 'id node))
(name "as") (type "checkbox")))
(children (select-elements (children node) 'description))
(make element gi: 'br)))
roles))
</dsssl:copy-of>
<!--
<dsssl:for-each select="(xsl-variable "roles")">
<dsssl:input dsssl:value="
(attribute-string 'id (current-node)) " type="checkbox" name="as"/>
<dsssl:copy-of select="
(select-elements (children (current-node)) 'description)"/>
<br/>
</dsssl:for-each>
-->
<p>
<input name="action" type="hidden" value="change-entry"></input>
<dsssl:input name="id" type="hidden" dsssl:value="
(xsl-variable "formid")"></dsssl:input>
<input type="submit" value="change"></input>
</p>
</td>
</tr>
</table>
</dsssl:form>
</td>
</tr>
</table>
</body>
<!--
;;; Local Variables: ***
;;; mode: indented-text ***
;;; End: ***
-->
</html>
Diese Seite findet man von: overview, .
Letzte Modifikation:
Autor(en): jfw,
Dokument Nummer A67bb0753e1676f81983e0ecf3a15b391
geliefert an public
um Thu, 20 Nov 2008 14:50:30 +0100