diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-08-10 21:32:44 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-08-10 21:32:44 +0000 |
| commit | 4cea59b19d6918b8a9ccbca3f5e1033a1a395a53 (patch) | |
| tree | 66d1db727c968a5dd5329eb1e70dbfbaacf982c6 /roundcubemail/program/include | |
| parent | e46347fb2e90d601ec3560cca8a87a99187d600d (diff) | |
Added 'message_compose' hook
git-svn-id: https://svn.roundcube.net/trunk@2852 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
| -rw-r--r-- | roundcubemail/program/include/main.inc | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc index 9401e289c..ce27b75de 100644 --- a/roundcubemail/program/include/main.inc +++ b/roundcubemail/program/include/main.inc @@ -545,7 +545,7 @@ function JQ($str) * @return string Field value or NULL if not available */ function get_input_value($fname, $source, $allow_html=FALSE, $charset=NULL) - { +{ global $OUTPUT; $value = NULL; @@ -582,7 +582,26 @@ function get_input_value($fname, $source, $allow_html=FALSE, $charset=NULL) return rcube_charset_convert($value, $OUTPUT->get_charset(), $charset); else return $value; +} + +/** + * Convert array of request parameters (prefixed with _) + * to a regular array with non-prefixed keys. + * + * @param int Source to get value from (GPC) + * @return array Hash array with all request parameters + */ +function request2param($mode = RCUBE_INPUT_GPC) +{ + $out = array(); + $src = $mode == RCUBE_INPUT_GET ? $_GET : ($mode == RCUBE_INPUT_POST ? $_POST : $_REQUEST); + foreach ($src as $key => $value) { + $fname = $key[0] == '_' ? substr($key, 1) : $key; + $out[$fname] = get_input_value($key, $mode); } + + return $out; +} /** * Remove all non-ascii and non-word chars @@ -958,8 +977,11 @@ function console() { $args = func_get_args(); - if (class_exists('rcmail', false)) - rcmail::get_instance()->plugins->exec_hook('console', $args); + if (class_exists('rcmail', false)) { + $rcmail = rcmail::get_instance(); + if (is_object($rcmail->plugins)) + $rcmail->plugins->exec_hook('console', $args); + } $msg = array(); foreach ($args as $arg) |
