diff options
author | thomascube <thomas@roundcube.net> | 2005-11-06 19:26:45 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2005-11-06 19:26:45 +0000 |
commit | 10a699759d4f106f29c077a6d65d3b8d212825e5 (patch) | |
tree | d7a50bb94731e131a8a03c546ad3dbcaf0c4f1e1 /program/include/main.inc | |
parent | e0ddd4e6c03d533cc3f8427624e026cc20c88fa6 (diff) |
Added localized messages to client and check form input
Diffstat (limited to 'program/include/main.inc')
-rw-r--r-- | program/include/main.inc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/program/include/main.inc b/program/include/main.inc index 9248caa99..5895807a9 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -248,6 +248,9 @@ function load_gui() $OUTPUT->set_charset($CONFIG['charset']); else rcmail_set_locale($sess_user_lang); + + // add some basic label to client + rcube_add_label('loading'); } @@ -401,6 +404,16 @@ function rcmail_create_user($user, $host) } +// overwrite action variable +function rcmail_overwrite_action($action) + { + global $OUTPUT, $JS_OBJECT_NAME; + $GLOBALS['_action'] = $action; + + $OUTPUT->add_script(sprintf("\n%s.set_env('action', '%s');", $JS_OBJECT_NAME, $action)); + } + + function show_message($message, $type='notice') { global $OUTPUT, $JS_OBJECT_NAME, $REMOTE_REQUEST; @@ -490,6 +503,20 @@ function rcube_list_languages() } +// add a localized label to the client environment +function rcube_add_label() + { + global $OUTPUT, $JS_OBJECT_NAME; + + $arg_list = func_get_args(); + foreach ($arg_list as $i => $name) + $OUTPUT->add_script(sprintf("%s.add_label('%s', '%s');", + $JS_OBJECT_NAME, + $name, + rep_specialchars_output(rcube_label($name), 'js'))); + } + + // ************** template parsing and gui functions ************** |