Class ::xowiki::Mode (public)
::nx::Class ::xowiki::Mode
Defined in packages/xowiki/tcl/xowiki-mode-procs.tcl
Mode handler to set for the current session some application specific mode (like e.g. admin-mode, developer-mode, student-mode, training-mode, ...) Interface: - method get: obtain the current value (maybe default) - method set: force the mode to the provided value - method toggle: toggle current value
- Testcases:
- No testcase defined.
Source code: :method mode_name {} { return "mode-[::xo::cc package_id]-[self]" } :public method get {} { # # Get the current mode, which might be set by the user or which # might be obtained from the default method. # set default [:default] set mode_name [:mode_name] if {![ns_conn isconnected]} { return $default } if {[ad_get_client_property -cache_only t xowiki $mode_name] eq ""} { ad_set_client_property -persistent f xowiki $mode_name $default } return [ad_get_client_property -cache_only t xowiki $mode_name] } :public method toggle {} { # # Switch state of the toggle # set oldState [:get] :set [expr {!$oldState}] } :public method set {value:boolean} { # # Set the mode to the specified value # set mode_name [:mode_name] ad_set_client_property -persistent f xowiki $mode_name $value }XQL Not present: Generic, PostgreSQL, Oracle