util_user_message (public)

 util_user_message [ -replace ] [ -html ] [ -message message ] \
    [ -severity severity ]

Defined in packages/acs-tcl/tcl/utilities-procs.tcl

Sets a message to be displayed on the next page request.

Switches:
-replace (optional, boolean)
Set this if you want to replace existing messages. Default behavior is to append to a list of messages.
-html (optional, boolean)
Set this flag if your message contains HTML. If specified, you're responsible for proper quoting of everything in your message. Otherwise, we quote it for you.
-message (optional)
The message to display.
-severity (optional, defaults to "success")
an indication of the message severity, that the page template may use to e.g. color-code the message for the user. Must be one of "success", "info", "warning" or "danger".
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_util_user_messages util_user_messages (test acs-tcl) util_user_message util_user_message test_util_user_messages->util_user_message ad_get_client_property ad_get_client_property (public) util_user_message->ad_get_client_property ad_set_client_property ad_set_client_property (public) util_user_message->ad_set_client_property Class ::xowf::test_item::Answer_manager Class ::xowf::test_item::Answer_manager (public) Class ::xowf::test_item::Answer_manager->util_user_message Class ::xowf::test_item::Question_manager Class ::xowf::test_item::Question_manager (public) Class ::xowf::test_item::Question_manager->util_user_message Class ::xowiki::formfield::numeric Class ::xowiki::formfield::numeric (public) Class ::xowiki::formfield::numeric->util_user_message Class ::xowiki::includelet::child-resources Class ::xowiki::includelet::child-resources (public) Class ::xowiki::includelet::child-resources->util_user_message ad_progress_bar_end ad_progress_bar_end (public) ad_progress_bar_end->util_user_message

Testcases:
util_user_messages
Source code:
    if {$severity ni {"success" "info" "warning" "danger"}} {
        error {Invalid severity. Must be one of "success""info""warning" or "danger"}
    }

    if {$replace_p} {
        set messages [list]
    } else {
        set messages [ad_get_client_property -default {} -cache_only t "acs-kernel" "general_messages"]
    }
    if { $message ne "" } {
        if { !$html_p } {
            set message [ns_quotehtml $message]
        }
        dict incr messages [list $message $severity]
    }
    ad_set_client_property -persistent f "acs-kernel" "general_messages" $messages
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/utilities-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: