%3 ::xowiki::includelet::composite-form ::xowiki::includelet::composite-form render ::xowiki::includelet::selection ::xowiki::includelet::selection render render_children ::xowiki::includelet::composite-form->::xowiki::includelet::selection ::xowiki::includelet::PageReorderSupport ::xowiki::includelet::PageReorderSupport page_reorder_check_allow page_reorder_init_vars page_reorder_item_id page_reorder_open_ul ::xotcl::Object ::xotcl::Object ::xowiki::includelet::PageReorderSupport->::xotcl::Object ::xowiki::includelet::selection->::xowiki::includelet::PageReorderSupport instmixin ::xowiki::Includelet ::xowiki::Includelet ::xowiki::includelet::selection->::xowiki::Includelet

Class ::xowiki::includelet::composite-form

::xowiki::includelet::composite-form[i] create ... \
           [ -parameter_declaration (default " {-edit_links:boolean false} {-pages ""} {-ordered_pages} ") ]

Create a form from the selection
Defined in /var/www/openacs.org/packages/xowiki/tcl/includelet-procs.tcl

Class Relations

  • class: ::xowiki::IncludeletClass[i]
  • superclass: ::xowiki::includelet::selection[i]
::xowiki::IncludeletClass create ::xowiki::includelet::composite-form \
     -superclass ::xowiki::includelet::selection

Methods (to be applied on instances)

  • parameter_declaration (setter)

  • render (scripted)

    :get_parameters
    set inner_html [next]
    #:log "innerhtml=$inner_html"
    regsub -nocase -all "<form " $inner_html "<div class='form' " inner_html
    regsub -nocase -all "<form>" $inner_html "<div class='form'>" inner_html
    regsub -nocase -all "</form *>" $inner_html "</div>" inner_html
    dom parse -simple <form>$inner_html</form> doc
    $doc documentElement root
    
    set fields [$root selectNodes "//div\[@class = 'wiki-menu'\]"]
    foreach field $fields {$field delete}
    
    set inner_html [$root asHTML]
    set id ID[${:__including_page} item_id]
    set base [${:__including_page} pretty_link]
    #set id ID$item_id
    #$root setAttribute id $id
    set as_att_value [::xowiki::Includelet html_encode $inner_html]
    set save_form [subst {
      <p>
      <a id='$id-control' href='#'>Create Form from Content</a>
      </p>
      <span id='$id' style='display: none'>
      Form Name:
      <form action="$base?m=create-new" method='POST' style='display: inline'>
      <input name='class' type='hidden' value="::xowiki::Form">
      <input name='content' type='hidden' value="$as_att_value">
      <input name='name' type='text'>
      </form>
      </span>
    }]
    
    template::add_event_listener  -id $id-control  -script [subst {document.getElementById("$id").style.display="inline";}]
    
    return $inner_html$save_form