Class ::xowiki::includelet::available-formfields (public)
::xowiki::IncludeletClass ::xowiki::includelet::available-formfields
Defined in /var/www/openacs.org/packages/xowiki/tcl/includelet-procs.tcl
List the available form field types of this installation.
- Testcases:
- No testcase defined.
Source code: namespace eval ::xowiki::includelet {} ::nsf::object::alloc ::xowiki::IncludeletClass ::xowiki::includelet::available-formfields {set :__default_metaclass ::xotcl::Class set :__default_superclass ::xotcl::Object set :aggregating false set :cacheable false set :localized true set :personalized true} ::xowiki::includelet::available-formfields instproc render {} { :get_parameters foreach cl [lsort [::xowiki::formfield::FormField info subclass -closure]] { set result "" set superClassName [:class_name [$cl info superclass]] set className [:class_name $cl] set abstract [expr {[$cl exists abstract] && [$cl set abstract] ? "abstract, " : ""}] append result "<b><a name='$className' title='$cl'>$className</a></b> " "(${abstract}superclass <a href='#$superClassName'>$superClassName</a>)\n" "<ul>\n" foreach p [lsort [$cl info parameter]] { if {[llength $p] == 2} { lassign $p name value append result "<li>-$name <em>[ns_quotehtml $value]</em></li>\n" } else { append result "<li>-$p</li>" } } append result "</ul>\n" set index [::xo::api object_index "" $cl] if {[nsv_exists api_library_doc $index]} { set doc_elements [nsv_get api_library_doc $index] append result <p>[lindex [dict get $doc_elements main] 0]</p> } else { append result <p> } set :html($className) $result } if {$flat} { # # Output as flat list # set result <ul> foreach className [lsort [array names :html]] { append result "<li>[set :html($className)]</li>\n" } append result "</ul>" } else { # # Output as tree # set result [:render_as_tree ::xowiki::formfield::FormField [::xowiki::formfield::FormField info subclass]] } return $result } ::xowiki::includelet::available-formfields instproc class_name cl { return [expr { [string match ::xowiki::formfield:* $cl] ? [namespace tail $cl] : [string trimleft $cl :] }] } ::xowiki::includelet::available-formfields instproc render_as_tree {cl subclasses} { set subclassHTML "" set sort_names {} foreach subcl $subclasses { lappend sort_names $subcl [:class_name $subcl] } foreach {subcl sort_name} [lsort -index 1 -stride 2 $sort_names] { append subclassHTML <li>[:render_as_tree $subcl [$subcl info subclass]]</li> } if {[llength $subclasses] > 0} { set subclassHTML <ul>$subclassHTML</ul> } append result [set :html([:class_name $cl])] $subclassHTML } ::xowiki::includelet::available-formfields instparametercmd parameter_declaration ::xowiki::includelet::available-formfields instparametercmd title ::nsf::relation::set ::xowiki::includelet::available-formfields superclass ::xowiki::Includelet ::nx::slotObj -container slot ::xowiki::includelet::available-formfields ::xowiki::includelet::available-formfields::slot eval {set :__parameter { {title "The following formfield types can be used in xowiki::Forms"} {parameter_declaration { {-flat:boolean false} }} }} ::nsf::object::alloc ::xotcl::Attribute ::xowiki::includelet::available-formfields::slot::title {set :accessor public set :configurable true set :convert false set :default {The following formfield types can be used in xowiki::Forms} set :defaultmethods {} set :disposition alias set :domain ::xowiki::includelet::available-formfields set :incremental 0 set :manager ::xowiki::includelet::available-formfields::slot::title set :methodname title set :multiplicity 1..1 set :name title set :per-object false set :position 0 set :required false set :substdefault 0b111 set :trace none : init} ::nsf::object::alloc ::xotcl::Attribute ::xowiki::includelet::available-formfields::slot::parameter_declaration {set :accessor public set :configurable true set :convert false set :default { {-flat:boolean false} } set :defaultmethods {} set :disposition alias set :domain ::xowiki::includelet::available-formfields set :incremental 0 set :manager ::xowiki::includelet::available-formfields::slot::parameter_declaration set :methodname parameter_declaration set :multiplicity 1..1 set :name parameter_declaration set :per-object false set :position 0 set :required false set :substdefault 0b111 set :trace none : init}XQL Not present: Generic, PostgreSQL, Oracle