summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2005-10-16 19:12:24 +0000
committerthomascube <thomas@roundcube.net>2005-10-16 19:12:24 +0000
commit9fee0ed9af6bb1daa3af2ff7290f5589040b4821 (patch)
treecc2593236458fdf56896831ac4bdee79bc6fc68c /program/include
parent69f71ba62d8e7d77c4877b47131836ea3f52f6ee (diff)
Fixed folder display; added Portuguese and Catalan
Diffstat (limited to 'program/include')
-rw-r--r--program/include/main.inc27
-rw-r--r--program/include/rcube_imap.inc8
-rw-r--r--program/include/rcube_shared.inc19
3 files changed, 50 insertions, 4 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index 1c413bb80..5eabf755d 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -423,6 +423,33 @@ function rcube_remote_response($js_code)
}
+// read directory program/localization/ and return a list of available languages
+function rcube_list_languages()
+ {
+ global $CONFIG, $INSTALL_PATH;
+ static $sa_languages = array();
+
+ if (!sizeof($sa_languages))
+ {
+ @include_once($INSTLL_PATH.'program/localization/index.inc');
+
+ if ($dh = @opendir($INSTLL_PATH.'program/localization'))
+ {
+ while (($name = readdir($dh)) !== false)
+ {
+ if ($name{0}=='.' || !is_dir($INSTLL_PATH.'program/localization/'.$name))
+ continue;
+
+ if ($label = $rcube_languages[$name])
+ $sa_languages[$name] = $label ? $label : $name;
+ }
+ closedir($dh);
+ }
+ }
+
+ return $sa_languages;
+ }
+
// ************** template parsing and gui functions **************
diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc
index 24cd94a52..4c707e3bb 100644
--- a/program/include/rcube_imap.inc
+++ b/program/include/rcube_imap.inc
@@ -268,7 +268,7 @@ class rcube_imap
else
$count = iil_C_CountMessages($this->conn, $mailbox);
-//print "/**** get messagecount for $mailbox ($mode): $count ****/\n";
+// print "/**** get messagecount for $mailbox ($mode): $count ****/\n";
if (is_array($a_mailbox_cache[$mailbox]))
$a_mailbox_cache[$mailbox] = array();
@@ -312,8 +312,8 @@ class rcube_imap
$a_header_index = iil_C_FetchHeaders($this->conn, $mailbox, "1:$max");
$a_msg_headers = array();
foreach ($a_header_index as $i => $headers)
- if (!$headers->deleted)
- $a_msg_headers[$headers->uid] = $headers;
+ if (!$headers->deleted)
+ $a_msg_headers[$headers->uid] = $headers;
// print "/**** fetch headers ****/\n";
}
@@ -445,7 +445,7 @@ class rcube_imap
$cache_key = $this->mailbox.'.msg';
if ($this->caching_enabled && $result && ($a_cached_headers = $this->get_cache($cache_key)))
{
- // close and re-open connection
+ // close and re-open connection
$this->reconnect();
foreach ($uids as $uid)
diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc
index 21c3ae8b4..693a2c860 100644
--- a/program/include/rcube_shared.inc
+++ b/program/include/rcube_shared.inc
@@ -1109,6 +1109,9 @@ function rcube_label($attrib)
if ($text=='')
$text = $a_text_item['single'];
+ // perform utf-8 decoding
+ //if (function_exists('utf8_decode'))
+ // $text = utf8_decode($text);
// replace vars in text
if (is_array($attrib['vars']))
@@ -1414,4 +1417,20 @@ function make_absolute_url($path, $base_url)
+function abbrevate_string($str, $maxlength, $place_holder='...')
+ {
+ $length = strlen($str);
+ $first_part_length = floor($maxlength/2) - strlen($place_holder);
+
+ if ($length > $maxlength)
+ {
+ $second_starting_location = $length - $maxlength + $first_part_length + 1;
+ $str = substr($str, 0, $first_part_length) . $place_holder . substr($str, $second_starting_location, $length);
+ }
+
+ return $str;
+ }
+
+
+
?> \ No newline at end of file