From be9aacaa5296dfca63fb3a01c2dc52538d1546aa Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Sat, 17 Nov 2012 12:31:31 -0500
Subject: [PATCH] Bring back lost localization for the about page
---
program/include/rcube_storage.php | 114 ++++++++------------------------------------------------
1 files changed, 17 insertions(+), 97 deletions(-)
diff --git a/program/include/rcube_storage.php b/program/include/rcube_storage.php
index 8123e9c..1556aae 100644
--- a/program/include/rcube_storage.php
+++ b/program/include/rcube_storage.php
@@ -19,19 +19,16 @@
| Author: Thomas Bruederli <roundcube@gmail.com> |
| Author: Aleksander Machniak <alec@alec.pl> |
+-----------------------------------------------------------------------+
-
- $Id$
-
*/
/**
* Abstract class for accessing mail messages storage server
*
- * @package Mail
- * @author Thomas Bruederli <roundcube@gmail.com>
- * @author Aleksander Machniak <alec@alec.pl>
- * @version 2.0
+ * @package Framework
+ * @subpackage Storage
+ * @author Thomas Bruederli <roundcube@gmail.com>
+ * @author Aleksander Machniak <alec@alec.pl>
*/
abstract class rcube_storage
{
@@ -198,7 +195,7 @@
*/
public function set_folder($folder)
{
- if ($this->folder == $folder) {
+ if ($this->folder === $folder) {
return;
}
@@ -434,7 +431,7 @@
* @param int $uid Message UID to fetch
* @param string $folder Folder to read from
*
- * @return object rcube_mail_header Message data
+ * @return object rcube_message_header Message data
*/
abstract function get_message($uid, $folder = null);
@@ -446,7 +443,7 @@
* @param string $folder Folder to read from
* @param bool $force True to skip cache
*
- * @return rcube_mail_header Message headers
+ * @return rcube_message_header Message headers
*/
abstract function get_message_headers($uid, $folder = null, $force = false);
@@ -477,7 +474,7 @@
public function get_body($uid, $part = 1)
{
$headers = $this->get_message_headers($uid);
- return rcube_charset_convert($this->get_message_part($uid, $part, null),
+ return rcube_charset::convert($this->get_message_part($uid, $part, null),
$headers->charset ? $headers->charset : $this->default_charset);
}
@@ -505,8 +502,11 @@
/**
* Sends the whole message source to stdout
+ *
+ * @param int $uid Message UID
+ * @param bool $formatted Enables line-ending formatting
*/
- abstract function print_raw_body($uid);
+ abstract function print_raw_body($uid, $formatted = true);
/**
@@ -545,10 +545,12 @@
* @param string $message The message source string or filename
* @param string $headers Headers string if $message contains only the body
* @param boolean $is_file True if $message is a filename
+ * @param array $flags Message flags
+ * @param mixed $date Message internal date
*
* @return int|bool Appended message UID or True on success, False on error
*/
- abstract function save_message($folder, &$message, $headers = '', $is_file = false);
+ abstract function save_message($folder, &$message, $headers = '', $is_file = false, $flags = array(), $date = null);
/**
@@ -970,6 +972,7 @@
*/
abstract function clear_cache($key = null, $prefix_mode = false);
+
/**
* Returns cached value
*
@@ -979,93 +982,10 @@
*/
abstract function get_cache($key);
+
/**
* Delete outdated cache entries
*/
abstract function expunge_cache();
} // end class rcube_storage
-
-
-/**
- * Class representing a message part
- *
- * @package Mail
- */
-class rcube_message_part
-{
- var $mime_id = '';
- var $ctype_primary = 'text';
- var $ctype_secondary = 'plain';
- var $mimetype = 'text/plain';
- var $disposition = '';
- var $filename = '';
- var $encoding = '8bit';
- var $charset = '';
- var $size = 0;
- var $headers = array();
- var $d_parameters = array();
- var $ctype_parameters = array();
-
- function __clone()
- {
- if (isset($this->parts)) {
- foreach ($this->parts as $idx => $part) {
- if (is_object($part)) {
- $this->parts[$idx] = clone $part;
- }
- }
- }
- }
-}
-
-
-/**
- * Class for sorting an array of rcube_mail_header objects in a predetermined order.
- *
- * @package Mail
- * @author Eric Stadtherr
- */
-class rcube_header_sorter
-{
- private $uids = array();
-
-
- /**
- * Set the predetermined sort order.
- *
- * @param array $index Numerically indexed array of IMAP UIDs
- */
- function set_index($index)
- {
- $index = array_flip($index);
-
- $this->uids = $index;
- }
-
- /**
- * Sort the array of header objects
- *
- * @param array $headers Array of rcube_mail_header objects indexed by UID
- */
- function sort_headers(&$headers)
- {
- uksort($headers, array($this, "compare_uids"));
- }
-
- /**
- * Sort method called by uksort()
- *
- * @param int $a Array key (UID)
- * @param int $b Array key (UID)
- */
- function compare_uids($a, $b)
- {
- // then find each sequence number in my ordered list
- $posa = isset($this->uids[$a]) ? intval($this->uids[$a]) : -1;
- $posb = isset($this->uids[$b]) ? intval($this->uids[$b]) : -1;
-
- // return the relative position as the comparison value
- return $posa - $posb;
- }
-}
--
Gitblit v1.9.1