Thomas Bruederli
2012-08-15 13969cf5406c14ba5dd5f830d7a8e2e2134e244b
commit | author | age
93e3ae 1 <?php
4e17e6 2
T 3 /*
4  +-----------------------------------------------------------------------+
5  | program/include/main.inc                                              |
6  |                                                                       |
e019f2 7  | This file is part of the Roundcube Webmail client                     |
0c2596 8  | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
7fe381 9  |                                                                       |
T 10  | Licensed under the GNU General Public License version 3 or            |
11  | any later version with exceptions for skins & plugins.                |
12  | See the README file for a full license statement.                     |
4e17e6 13  |                                                                       |
T 14  | PURPOSE:                                                              |
0c2596 15  |   Provide deprecated functions aliases for backward compatibility     |
4e17e6 16  |                                                                       |
T 17  +-----------------------------------------------------------------------+
18  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
19  +-----------------------------------------------------------------------+
20 */
21
6d969b 22 /**
0c2596 23  * Roundcube Webmail deprecated functions
6d969b 24  *
T 25  * @package Core
26  * @author Thomas Bruederli <roundcube@gmail.com>
27  */
28
0c2596 29 // constants for input reading
1aceb9 30 define('RCUBE_INPUT_GET',  rcube_utils::INPUT_GET);
A 31 define('RCUBE_INPUT_POST', rcube_utils::INPUT_POST);
32 define('RCUBE_INPUT_GPC',  rcube_utils::INPUT_GPC);
ea7c46 33
1aceb9 34 define('JS_OBJECT_NAME',   rcmail::JS_OBJECT_NAME);
ea7c46 35
4e17e6 36 function get_table_name($table)
0c2596 37 {
A 38     return rcmail::get_instance()->db->table_name($table);
39 }
653242 40
1cded8 41 function get_sequence_name($sequence)
0c2596 42 {
A 43     return rcmail::get_instance()->db->sequence_name($sequence);
44 }
1cded8 45
cc97ea 46 function rcube_label($p, $domain=null)
1854c4 47 {
0c2596 48     return rcmail::get_instance()->gettext($p, $domain);
1854c4 49 }
4e17e6 50
8703b0 51 function rcube_label_exists($name, $domain=null, &$ref_domain = null)
07b95d 52 {
0c2596 53     return rcmail::get_instance()->text_exists($name, $domain, $ref_domain);
07b95d 54 }
T 55
10a699 56 function rcmail_overwrite_action($action)
0c2596 57 {
A 58     rcmail::get_instance()->overwrite_action($action);
59 }
10a699 60
41bece 61 function rcmail_url($action, $p=array(), $task=null)
f11541 62 {
1aceb9 63     return rcmail::get_instance()->url((array)$p + array('_action' => $action, 'task' => $task));
f11541 64 }
9fee0e 65
70d4b9 66 function rcmail_temp_gc()
3ddca3 67 {
0c2596 68   $rcmail = rcmail::get_instance()->temp_gc();
3ddca3 69 }
1cded8 70
3f9edb 71 function rcube_charset_convert($str, $from, $to=NULL)
3ddca3 72 {
c321a9 73     return rcube_charset::convert($str, $from, $to);
T 74 }
b8d8cb 75
c321a9 76 function rc_detect_encoding($string, $failover='')
T 77 {
78     return rcube_charset::detect($string, $failover);
79 }
65d710 80
c321a9 81 function rc_utf8_clean($input)
T 82 {
83     return rcube_charset::clean($input);
3ddca3 84 }
3f9edb 85
c321a9 86 function json_serialize($input)
3ddca3 87 {
0c2596 88     return rcube_output::json_serialize($input);
a5897a 89 }
dbe44c 90
1cded8 91 function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE)
0c2596 92 {
1aceb9 93     return rcube_utils::rep_specialchars_output($str, $enctype, $mode, $newlines);
0c2596 94 }
1cded8 95
2bca6e 96 function Q($str, $mode='strict', $newlines=TRUE)
0c2596 97 {
1aceb9 98     return rcmail::Q($str, $mode, $newlines);
0c2596 99 }
2bca6e 100
18e2a3 101 function JQ($str)
0c2596 102 {
1aceb9 103     return rcmail::JQ($str);
0c2596 104 }
ea7c46 105
T 106 function get_input_value($fname, $source, $allow_html=FALSE, $charset=NULL)
759696 107 {
1aceb9 108     return rcube_utils::get_input_value($fname, $source, $allow_html, $charset);
72b140 109 }
A 110
111 function parse_input_value($value, $allow_html=FALSE, $charset=NULL)
112 {
1aceb9 113     return rcube_utils::parse_input_value($value, $allow_html, $charset);
759696 114 }
T 115
ef4998 116 function request2param($mode = RCUBE_INPUT_GPC, $ignore = 'task|action')
759696 117 {
1aceb9 118     return rcube_utils::request2param($mode, $ignore);
759696 119 }
ea7c46 120
fb6d86 121 function html_identifier($str, $encode=false)
ce988a 122 {
1aceb9 123     return rcube_utils::html_identifier($str, $encode);
ce988a 124 }
T 125
d1d2c4 126 function rcube_table_output($attrib, $table_data, $a_show_cols, $id_col)
57863c 127 {
1aceb9 128     return rcmail::get_instance()->table_output($attrib, $table_data, $a_show_cols, $id_col);
57863c 129 }
4e17e6 130
T 131 function rcmail_get_edit_field($col, $value, $attrib, $type='text')
0501b6 132 {
1aceb9 133   return rcube_utils::get_edit_field($col, $value, $attrib, $type);
0501b6 134 }
f11541 135
2b017e 136 function rcmail_mod_css_styles($source, $container_id, $allow_remote=false)
0c2596 137 {
1aceb9 138     return rcube_utils::mod_css_styles($source, $container_id, $allow_remote);
0c2596 139 }
cb3dfd 140
c5ee03 141 function rcmail_xss_entity_decode($content)
1c499a 142 {
1aceb9 143     return rcube_utils::xss_entity_decode($content);
1c499a 144 }
T 145
4e17e6 146 function create_attrib_string($attrib, $allowed_attribs=array('id', 'class', 'style'))
312784 147 {
0c2596 148     return html::attrib_string($attrib, $allowed_attribs);
312784 149 }
T 150
0c2596 151 function parse_attrib_string($str)
A 152 {
153     return html::parse_attrib_string($str);
154 }
312784 155
77153b 156 function format_date($date, $format=NULL, $convert=true)
de3dde 157 {
1aceb9 158     return rcmail::get_instance()->format_date($date, $format, $convert);
de3dde 159 }
A 160
93be5b 161 function rcmail_mailbox_list($attrib)
62e542 162 {
1aceb9 163     return rcmail::get_instance()->folder_list($attrib);
62e542 164 }
93be5b 165
0c2596 166 function rcmail_mailbox_select($attrib = array())
cb3538 167 {
1aceb9 168     return rcmail::get_instance()->folder_selector($attrib);
cb3538 169 }
93be5b 170
831c83 171 function rcmail_render_folder_tree_html(&$arrFolders, &$mbox_name, &$jslist, $attrib, $nestLevel = 0)
A 172 {
1aceb9 173     return rcmail::get_instance()->render_folder_tree_html($arrFolders, $mbox_name, $jslist, $attrib, $nestLevel);
831c83 174 }
A 175
176 function rcmail_render_folder_tree_select(&$arrFolders, &$mbox_name, $maxlength, &$select, $realnames = false, $nestLevel = 0, $opts = array())
177 {
1aceb9 178     return rcmail::get_instance()->render_folder_tree_select($arrFolders, $mbox_name, $maxlength, $select, $realnames, $nestLevel, $opts);    
831c83 179 }
A 180
181 function rcmail_build_folder_tree(&$arrFolders, $folder, $delm = '/', $path = '')
182 {
1aceb9 183     return rcmail::get_instance()->build_folder_tree($arrFolders, $folder, $delm, $path);
831c83 184 }
A 185
186 function rcmail_folder_classname($folder_id)
187 {
1aceb9 188     return rcmail::get_instance()->folder_classname($folder_id);
831c83 189 }
A 190
fed22f 191 function rcmail_localize_foldername($name)
T 192 {
1aceb9 193     return rcmail::get_instance()->localize_foldername($name);
fed22f 194 }
T 195
363514 196 function rcmail_localize_folderpath($path)
A 197 {
1aceb9 198     return rcmail::get_instance()->localize_folderpath($path);
363514 199 }
A 200
af3c04 201 function rcmail_quota_display($attrib)
A 202 {
1aceb9 203     return rcmail::get_instance()->quota_display($attrib);
af3c04 204 }
A 205
0c2596 206 function rcmail_quota_content($attrib = null)
af3c04 207 {
1aceb9 208     return rcmail::get_instance()->quota_content($attrib);
af3c04 209 }
A 210
90f81a 211 function rcmail_display_server_error($fallback=null, $fallback_args=null)
A 212 {
1aceb9 213     rcmail::get_instance()->display_server_error($fallback, $fallback_args);
90f81a 214 }
A 215
f94e44 216 function rcmail_filetype2classname($mimetype, $filename)
T 217 {
1aceb9 218     return rcube_utils::file2class($mimetype, $filename);
f94e44 219 }
T 220
b8ae50 221 function rcube_html_editor($mode='')
A 222 {
1aceb9 223     rcmail::get_instance()->html_editor($mode);
b8ae50 224 }
aa055c 225
747289 226 function rcmail_replace_emoticons($html)
A 227 {
1aceb9 228     return rcmail::get_instance()->replace_emoticons($html);
747289 229 }
A 230
95192c 231 function rcmail_deliver_message(&$message, $from, $mailto, &$smtp_error, &$body_file=null, $smtp_opts=null)
d91778 232 {
0c2596 233     return rcmail::get_instance()->deliver_message($message, $from, $mailto, $smtp_error, $body_file, $smtp_opts);
d91778 234 }
T 235
236 function rcmail_gen_message_id()
237 {
0c2596 238     return rcmail::get_instance()->gen_message_id();
d91778 239 }
T 240
241 function rcmail_user_date()
242 {
0c2596 243     return rcmail::get_instance()->user_date();
d91778 244 }
T 245
e0960f 246 function rcmail_mem_check($need)
A 247 {
1aceb9 248     return rcube_utils::mem_check($need);
e0960f 249 }
A 250
5818e4 251 function rcube_https_check($port=null, $use_https=true)
A 252 {
1aceb9 253     return rcube_utils::https_check($port, $use_https);
5818e4 254 }
A 255
929a50 256 function rcube_sess_unset($var_name=null)
A 257 {
0c2596 258     rcmail::get_instance()->session->remove($var_name);
929a50 259 }
A 260
a76cbd 261 function rcube_parse_host($name, $host='')
bb8721 262 {
1aceb9 263     return rcube_utils::parse_host($name, $host);
bb8721 264 }
A 265
1baeb6 266 function check_email($email, $dns_check=true)
e4acbb 267 {
1aceb9 268     return rcube_utils::check_email($email, $dns_check);
e4acbb 269 }
A 270
23b495 271 function console()
A 272 {
0c2596 273     call_user_func_array(array('rcmail', 'console'), func_get_args());
23b495 274 }
A 275
276 function write_log($name, $line)
277 {
0c2596 278     return rcmail::write_log($name, $line);
23b495 279 }
A 280
281 function rcmail_log_login()
282 {
0c2596 283     return rcmail::get_instance()->log_login();
23b495 284 }
A 285
286 function rcmail_remote_ip()
287 {
1aceb9 288     return rcube_utils::remote_ip();
23b495 289 }
A 290
291 function rcube_check_referer()
292 {
0c2596 293     return rcmail::check_referer();
23b495 294 }
A 295
296 function rcube_timer()
297 {
0c2596 298     return rcmail::timer();
23b495 299 }
A 300
301 function rcube_print_time($timer, $label='Timer', $dest='console')
302 {
0c2596 303     rcmail::print_timer($timer, $label, $dest);
23b495 304 }
A 305
24c91e 306 function raise_error($arg=array(), $log=false, $terminate=false)
A 307 {
0c2596 308     rcmail::raise_error($arg, $log, $terminate);
874ff4 309 }
24c91e 310
23b495 311 function rcube_log_bug($arg_arr)
24c91e 312 {
0c2596 313     rcmail::log_bug($arg_arr);
24c91e 314 }
747289 315
4171c5 316 function rcube_upload_progress()
A 317 {
1aceb9 318     rcmail::get_instance()->upload_progress();
4171c5 319 }
A 320
fe0cb6 321 function rcube_upload_init()
4171c5 322 {
1aceb9 323     return rcmail::get_instance()->upload_init();
4171c5 324 }
0213f8 325
A 326 function rcube_autocomplete_init()
327 {
1aceb9 328     rcmail::get_instance()->autocomplete_init();
0213f8 329 }
7e263e 330
A 331 function rcube_fontdefs($font = null)
332 {
1aceb9 333     return rcmail::font_defs($font);
0c2596 334 }
7e263e 335
0c2596 336 function send_nocacheing_headers()
A 337 {
338     return rcmail::get_instance()->output->nocacheing_headers();
339 }
7e263e 340
0c2596 341 function show_bytes($bytes)
A 342 {
1aceb9 343     return rcmail::get_instance()->show_bytes($bytes);
0c2596 344 }
A 345
346 function rc_wordwrap($string, $width=75, $break="\n", $cut=false)
347 {
348     return rcube_mime::wordwrap($string, $width, $break, $cut);
349 }
350
351 function rc_request_header($name)
352 {
1aceb9 353     return rcube_utils::request_header($name);
A 354 }
355
356 function rcube_explode_quoted_string($delimiter, $string)
357 {
358     return rcube_utils::explode_quoted_string($delimiter, $string);
0c2596 359 }
A 360
361 function rc_mime_content_type($path, $name, $failover = 'application/octet-stream', $is_stream=false)
362 {
363     return rcube_mime::file_content_type($path, $name, $failover, $is_stream);
364 }
365
366 function rc_image_content_type($data)
367 {
368     return rcube_mime::image_content_type($data);
7e263e 369 }
1aceb9 370
A 371 function rcube_strtotime($date)
372 {
373     return rcube_utils::strtotime($date);
374 }
375
376 function rcube_idn_to_ascii($str)
377 {
378     return rcube_utils::idn_to_ascii($str);
379 }
380
381 function rcube_idn_to_utf8($str)
382 {
383     return rcube_utils::idn_to_utf8($str);
384 }
988a80 385
T 386 function send_future_expire_header($offset = 2600000)
387 {
388     return rcmail::get_instance()->output->future_expire_header($offset);
389 }