GCAIForm

(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")) gcai

Take Care!

You operate with full rights, usually that's dangerously too much.


gcai

Name Vorname
Vorname (select-elements (children (node-list-first (xsl-variable "selected"))) 'firstname)
Name
Kürzel
Oid

Benutzer-Optionen

(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))


Source code:

<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 &apos;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 &quot;persons&quot;)">
       <tr>
        <td>
         <dsssl:a href="
 (read-locator
  (msg &apos;location-format)
  (cons (string-append &quot;?id=&quot;
                       (attribute-string &apos;id (current-node)))
        (msg &apos;location)))">
          <dsssl:copy-of select="(children (node-list-first
(select-elements (children (current-node)) &apos;firstname)))"></dsssl:copy-of>
         </dsssl:a>
        </td>
        <td>
         <dsssl:copy-of select="(children (node-list-first
(select-elements (children (current-node)) &apos;name)))"></dsssl:copy-of>
        </td>
       </tr>
      </dsssl:for-each>
     </table>
    </td>
    <td>
     <dsssl:form action="&apos;()" 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 &quot;selected&quot;)))
  &apos;name) "></dsssl:input>
           </td>
          </tr>
          <tr>
           <td>Kürzel</td>
           <td>
            <dsssl:copy-of select="(xsl-variable &quot;formid&quot;)"></dsssl:copy-of>
           </td>
          </tr>
          <tr>
           <td>Oid</td>
           <td>
            <dsssl:copy-of select="
 (let ((id (string-&gt;oid
            (data (select-elements
              (children (node-list-first (xsl-variable &quot;selected&quot;)))
                   &apos;id)))))
  (if id (literal id)
         (make element
           gi: &apos;input
           attributes: &apos;((name &quot;oid&quot;)
                              (type &quot;text&quot;)))))
"></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-&gt;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-&gt;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 &quot;roles&quot;)">
          <dsssl:input dsssl:value="
 (attribute-string &apos;id (current-node)) " type="checkbox" name="as"/>
          <dsssl:copy-of select="
            (select-elements (children (current-node)) &apos;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 &quot;formid&quot;)"></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: Thu, 06 Feb 2003 14:31:36 +0100

Autor(en): jfw,

Dokument Nummer A67bb0753e1676f81983e0ecf3a15b391 geliefert an public um Thu, 20 Nov 2008 18:26:44 +0100