template::util::spellcheck::spellcheck_properties (public)
template::util::spellcheck::spellcheck_properties \ -element_ref element_ref
Defined in packages/acs-templating/tcl/spellcheck-procs.tcl
Returns a list of spellcheck properties in array setable format.
- Switches:
- -element_ref
(required)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- spellcheck__spellcheck_properties
Source code: upvar $element_ref element if { [set spellcheck_value [ns_queryget $element(id).spellcheck]] eq "" } { # The user hasn't been able to state whether (s)he wants spellchecking to be performed or not. # That's either because spell-checking is disabled for this element, or we're not dealing with a submit. # Whichever it is, let's see if, and then how, we should render the spellcheck "sub widget". # Do the "cheap" checks first and then (if needed) read the parameter and do additional checks. if { $element(mode) eq "display" || [info exists element(nospell)] || [nsv_get spellchecker path] eq "" } { set spellcheck_p 0 } else { array set widget_info [string trim [parameter::get_from_package_key -package_key acs-templating -parameter SpellcheckFormWidgets -default ""]] set spellcheck_p [expr {[array size widget_info] && ($element(widget) eq "richtext" || $element(widget) eq "textarea" || $element(widget) eq "text") && [info exists widget_info($element(widget))] && [set widget_info($element(widget))] }] } if { $spellcheck_p } { # This is not a submit; we are rendering the form element for the first time and # since the spellcheck "sub widget" is to be displayed we'll also want to know # which option should be selected by default. array set spellcheck {render_p 1 perform_p 1} if { $widget_info(${element(widget)}) } { set spellcheck(selected_option) [nsv_get spellchecker default_lang] } else { set spellcheck(selected_option) ":nospell:" } } else { array set spellcheck {render_p 0 perform_p 0} # set this to something so the script won't choke. set spellcheck(selected_option) ":nospell:" } } else { # The user has explicitly stated if (s)he wants spellchecking to be performed # on the text or not. Hence we are in submit mode with spell-checking enabled. # Let's check which it is and keep record of the states of our select menu in # case the error page is shown (because of an error in a neighboring element). set spellcheck(selected_option) $spellcheck_value if {":nospell:" eq $spellcheck(selected_option)} { set spellcheck(perform_p) 0 set spellcheck(render_p) 0 } else { set spellcheck(perform_p) 1 set spellcheck(render_p) 1 } } return [array get spellcheck]XQL Not present: Generic, PostgreSQL, Oracle