| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Garbage collector for cache entries. |
| | | * Remove all expired message cache records |
| | | * @return void |
| | | */ |
| | | function rcmail_cache_gc() |
| | | { |
| | | $rcmail = rcmail::get_instance(); |
| | | $db = $rcmail->get_dbh(); |
| | | |
| | | // get target timestamp |
| | | $ts = get_offset_time($rcmail->config->get('message_cache_lifetime', '30d'), -1); |
| | | |
| | | $db->query("DELETE FROM ".get_table_name('cache_messages') |
| | | ." WHERE changed < " . $db->fromunixtime($ts)); |
| | | |
| | | $db->query("DELETE FROM ".get_table_name('cache_index') |
| | | ." WHERE changed < " . $db->fromunixtime($ts)); |
| | | |
| | | $db->query("DELETE FROM ".get_table_name('cache_thread') |
| | | ." WHERE changed < " . $db->fromunixtime($ts)); |
| | | |
| | | $db->query("DELETE FROM ".get_table_name('cache') |
| | | ." WHERE created < " . $db->fromunixtime($ts)); |
| | | } |
| | | |
| | | |
| | | // Deprecated |
| | | function rcube_charset_convert($str, $from, $to=NULL) |
| | | { |
| | |
| | | } |
| | | |
| | | // allow plugins to alter the folder tree or to localize folder names |
| | | $hook = $RCMAIL->plugins->exec_hook('render_mailboxlist', array('list' => $a_mailboxes, 'delimiter' => $delimiter)); |
| | | $hook = $RCMAIL->plugins->exec_hook('render_mailboxlist', array( |
| | | 'list' => $a_mailboxes, |
| | | 'delimiter' => $delimiter, |
| | | 'type' => $type, |
| | | 'attribs' => $attrib, |
| | | )); |
| | | |
| | | $a_mailboxes = $hook['list']; |
| | | $attrib = $hook['attribs']; |
| | | |
| | | if ($type == 'select') { |
| | | $select = new html_select($attrib); |
| | |
| | | if ($attrib['noselection']) |
| | | $select->add(rcube_label($attrib['noselection']), ''); |
| | | |
| | | rcmail_render_folder_tree_select($hook['list'], $mbox_name, $attrib['maxlength'], $select, $attrib['realnames']); |
| | | $out = $select->show(); |
| | | rcmail_render_folder_tree_select($a_mailboxes, $mbox_name, $attrib['maxlength'], $select, $attrib['realnames']); |
| | | $out = $select->show($attrib['default']); |
| | | } |
| | | else { |
| | | $js_mailboxlist = array(); |
| | | $out = html::tag('ul', $attrib, rcmail_render_folder_tree_html($hook['list'], $mbox_name, $js_mailboxlist, $attrib), html::$common_attrib); |
| | | $out = html::tag('ul', $attrib, rcmail_render_folder_tree_html($a_mailboxes, $mbox_name, $js_mailboxlist, $attrib), html::$common_attrib); |
| | | |
| | | $RCMAIL->output->add_gui_object('mailboxlist', $attrib['id']); |
| | | $RCMAIL->output->set_env('mailboxes', $js_mailboxlist); |
| | |
| | | if (!$attrib['id']) |
| | | $attrib['id'] = 'rcmquotadisplay'; |
| | | |
| | | if(isset($attrib['display'])) |
| | | $_SESSION['quota_display'] = $attrib['display']; |
| | | $_SESSION['quota_display'] = !empty($attrib['display']) ? $attrib['display'] : 'text'; |
| | | |
| | | $OUTPUT->add_gui_object('quotadisplay', $attrib['id']); |
| | | |