| | |
| | | * @return string Field value or NULL if not available |
| | | */ |
| | | function get_input_value($fname, $source, $allow_html=FALSE, $charset=NULL) |
| | | { |
| | | { |
| | | global $OUTPUT; |
| | | $value = 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 |
| | |
| | | while ($table_data && ($sql_arr = $db->fetch_assoc($table_data))) |
| | | { |
| | | $zebra_class = $c % 2 ? 'even' : 'odd'; |
| | | $table->add_row(array('id' => 'rcmrow' . $sql_arr[$id_col], 'class' => "contact $zebra_class")); |
| | | $table->add_row(array('id' => 'rcmrow' . $sql_arr[$id_col], 'class' => $zebra_class)); |
| | | |
| | | // format each col |
| | | foreach ($a_show_cols as $col) |
| | |
| | | foreach ($table_data as $row_data) |
| | | { |
| | | $zebra_class = $c % 2 ? 'even' : 'odd'; |
| | | $table->add_row(array('id' => 'rcmrow' . $row_data[$id_col], 'class' => "contact $zebra_class")); |
| | | $table->add_row(array('id' => 'rcmrow' . $row_data[$id_col], 'class' => $zebra_class)); |
| | | |
| | | // format each col |
| | | foreach ($a_show_cols as $col) |
| | |
| | | { |
| | | $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) |
| | |
| | | */ |
| | | function rcube_html_editor($mode='') |
| | | { |
| | | global $OUTPUT, $CONFIG; |
| | | global $RCMAIL, $CONFIG; |
| | | |
| | | $lang = $tinylang = strtolower(substr($_SESSION['language'], 0, 2)); |
| | | if (!file_exists(INSTALL_PATH . 'program/js/tiny_mce/langs/'.$tinylang.'.js')) |
| | | $tinylang = 'en'; |
| | | $hook = $RCMAIL->plugins->exec_hook('hmtl_editor', array('mode' => $mode)); |
| | | |
| | | $OUTPUT->include_script('tiny_mce/tiny_mce.js'); |
| | | $OUTPUT->include_script('editor.js'); |
| | | $OUTPUT->add_script('rcmail_editor_init("$__skin_path", "'.JQ($tinylang).'", '.intval($CONFIG['enable_spellcheck']).', "'.$mode.'");'); |
| | | if ($hook['abort']) |
| | | return; |
| | | |
| | | $lang = strtolower(substr($_SESSION['language'], 0, 2)); |
| | | if (!file_exists(INSTALL_PATH . 'program/js/tiny_mce/langs/'.$lang.'.js')) |
| | | $lang = 'en'; |
| | | |
| | | $RCMAIL->output->include_script('tiny_mce/tiny_mce.js'); |
| | | $RCMAIL->output->include_script('editor.js'); |
| | | $RCMAIL->output->add_script('rcmail_editor_init("$__skin_path", |
| | | "'.JQ($lang).'", '.intval($CONFIG['enable_spellcheck']).', "'.$mode.'");'); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |