From f5d2f08db7a6b9c96dbd61ee4707a53ee8075671 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Wed, 9 May 2012 11:11:16 +0200 Subject: - Add file type icons for plain text (#1488451) and vcard files - Align heights of search box and decorated drop-down menu (#1488354) --- skins/larry/images/filetypes.png | Bin 8300 -> 10309 bytes skins/larry/styles.css | 25 +++++++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/skins/larry/images/filetypes.png b/skins/larry/images/filetypes.png index 172260efc..ad5d65f93 100644 Binary files a/skins/larry/images/filetypes.png and b/skins/larry/images/filetypes.png differ diff --git a/skins/larry/styles.css b/skins/larry/styles.css index 4868ed916..e297416ad 100644 --- a/skins/larry/styles.css +++ b/skins/larry/styles.css @@ -1280,7 +1280,8 @@ ul.proplist li { #quicksearchbar input { width: 176px; margin: 0; - padding: 5px 26px 5px 38px; + padding: 5px 26px 2px 38px; + height: 18px; background: #f1f1f1; border-color: #a3a3a3; font-weight: bold; @@ -1295,7 +1296,7 @@ ul.proplist li { #quicksearchbar #searchreset { position: absolute; top: 4px; - right: 3px; + right: 1px; } @@ -1477,9 +1478,16 @@ a.menuselector:active { a.dropdownselector { position: absolute; + padding: 1px 0; z-index: 1; } +a.dropdownselector .handle { + margin: -1px 0; + padding-top: 5px; + min-height: 20px; +} + select.decorated { position: relative; z-index: 10; @@ -1886,6 +1894,19 @@ ul.toolbarmenu li span.conversation { background-position: 0 -364px; } +.attachmentslist li.txt, +.attachmentslist li.text { + background-position: 0 -416px; +} + +.attachmentslist li.vcard { + background-position: 0 -390px; +} + +.attachmentslist li.html { + background-position: 0 -442px; +} + .attachmentslist li a, #compose-attachments ul li { display: block; -- cgit v1.2.3 From 71ced07735641e95bea63f67a75d6f151ef802b1 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 9 May 2012 12:47:44 +0200 Subject: Use similar language as a fallback for plugin localization (#1488401) Don't load en_US localization more than once Conflicts: CHANGELOG program/include/rcube.php --- CHANGELOG | 1 + program/include/rcmail.php | 2 +- program/include/rcube_plugin.php | 38 +++++++++++++++++++++++++++++++++----- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index ae68cea65..27d16c0cd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Use similar language as a fallback for plugin localization (#1488401) - Fix issue where signature wasn't re-added on draft compose (#1488322) - Update to TinyMCE 3.5 (#1488459) - Fixed multi-threaded autocompletion when number of threads > number of sources diff --git a/program/include/rcmail.php b/program/include/rcmail.php index 65c48fabf..c0defa6d4 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -1167,7 +1167,7 @@ class rcmail $this->texts = array_merge($this->texts, $messages); // include user language files - if ($lang != 'en' && is_dir(INSTALL_PATH . 'program/localization/' . $lang)) { + if ($lang != 'en' && $lang != 'en_US' && is_dir(INSTALL_PATH . 'program/localization/' . $lang)) { include_once(INSTALL_PATH . 'program/localization/' . $lang . '/labels.inc'); include_once(INSTALL_PATH . 'program/localization/' . $lang . '/messages.inc'); diff --git a/program/include/rcube_plugin.php b/program/include/rcube_plugin.php index aeb05afa1..0b872cf95 100644 --- a/program/include/rcube_plugin.php +++ b/program/include/rcube_plugin.php @@ -152,20 +152,48 @@ abstract class rcube_plugin public function add_texts($dir, $add2client = false) { $domain = $this->ID; - - $lang = $_SESSION['language']; + $lang = $_SESSION['language']; + $langs = array_unique(array('en_US', $lang)); $locdir = slashify(realpath(slashify($this->home) . $dir)); - $texts = array(); + $texts = array(); + + // Language aliases used to find localization in similar lang, see below + $aliases = array( + 'de_CH' => 'de_DE', + 'es_AR' => 'es_ES', + 'fa_AF' => 'fa_IR', + 'nl_BE' => 'nl_NL', + 'pt_BR' => 'pt_PT', + 'zh_CN' => 'zh_TW', + ); // use buffering to handle empty lines/spaces after closing PHP tag ob_start(); - foreach (array('en_US', $lang) as $lng) { + foreach ($langs as $lng) { $fpath = $locdir . $lng . '.inc'; if (is_file($fpath) && is_readable($fpath)) { - include($fpath); + include $fpath; $texts = (array)$labels + (array)$messages + (array)$texts; } + else if ($lng != 'en_US') { + // Find localization in similar language (#1488401) + $alias = null; + if (!empty($aliases[$lng])) { + $alias = $aliases[$lng]; + } + else if ($key = array_search($lng, $aliases)) { + $alias = $key; + } + + if (!empty($alias)) { + $fpath = $locdir . $alias . '.inc'; + if (is_file($fpath) && is_readable($fpath)) { + include $fpath; + $texts = (array)$labels + (array)$messages + (array)$texts; + } + } + } } ob_end_clean(); -- cgit v1.2.3 From 951c9b3abbf55ea16a5757d42af2522408b07293 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 9 May 2012 13:45:37 +0200 Subject: Fix add_contact() (#1488465) --- program/js/app.js | 4 ++-- program/steps/mail/func.inc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/program/js/app.js b/program/js/app.js index 72a277797..cb2727523 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -766,7 +766,7 @@ function rcube_webmail() case 'always-load': if (this.env.uid && this.env.sender) { - this.add_contact(urlencode(this.env.sender)); + this.add_contact(this.env.sender); setTimeout(function(){ ref.command('load-images'); }, 300); break; } @@ -3527,7 +3527,7 @@ function rcube_webmail() this.add_contact = function(value) { if (value) - this.http_post('addcontact', '_address='+value); + this.http_post('addcontact', {_address: value}); return true; }; diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index aeb917bd7..854298d8b 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -1330,7 +1330,7 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null, if ($addicon && $_SESSION['writeable_abook']) { $address = html::span(null, $address . html::a(array( 'href' => "#add", - 'onclick' => sprintf("return %s.command('add-contact','%s',this)", JS_OBJECT_NAME, urlencode($string)), + 'onclick' => sprintf("return %s.command('add-contact','%s',this)", JS_OBJECT_NAME, $string), 'title' => rcube_label('addtoaddressbook'), 'class' => 'rcmaddcontact', ), -- cgit v1.2.3 From dac31dddd18b3b65ff6c13d69e2667eeabdf5fc8 Mon Sep 17 00:00:00 2001 From: Thomas B Date: Wed, 9 May 2012 15:59:48 +0300 Subject: s/SVN/GIT/ --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e35e6157..621e23818 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Roundcube Webmail ATTENTION --------- -This is just a snapshot of the current SVN repository and is **NOT A STABLE +This is just a snapshot from the GIT repository and is **NOT A STABLE version of Roundcube**. It's not recommended to replace an existing installation of Roundcube with this version. Also using a separate database for this installation is highly recommended. -- cgit v1.2.3 -- cgit v1.2.3 From 82e1bd22a16484abc7621397bb8348a2cf398c9f Mon Sep 17 00:00:00 2001 From: Antoine Catton Date: Wed, 9 May 2012 16:50:43 +0200 Subject: Replace directory .svn/ by .git/ in security rules --- .htaccess | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.htaccess b/.htaccess index 98258c9fe..d5ebe4c20 100644 --- a/.htaccess +++ b/.htaccess @@ -30,7 +30,7 @@ php_value mbstring.func_overload 0 RewriteEngine On RewriteRule ^favicon\.ico$ skins/default/images/favicon.ico # security rules -RewriteRule .svn/ - [F] +RewriteRule .git/ - [F] RewriteRule ^README|INSTALL|LICENSE|SQL|bin|CHANGELOG$ - [F] -- cgit v1.2.3 From 8253e7d245b03a2bfd5b51573e5d1024e45022ce Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 10 May 2012 19:14:39 +0200 Subject: Fix PHP warning on PHP 5.4 (#1488469) --- program/steps/addressbook/func.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc index a31370b16..bd3819436 100644 --- a/program/steps/addressbook/func.inc +++ b/program/steps/addressbook/func.inc @@ -593,7 +593,12 @@ function rcmail_contact_form($form, $record, $attrib = null) $composite = array(); $j = 0; $template = $RCMAIL->config->get($col . '_template', '{'.join('} {', array_keys($colprop['childs'])).'}'); foreach ($colprop['childs'] as $childcol => $cp) { - $childvalue = $val[$childcol] ? $val[$childcol] : $val[$j]; + if (!empty($val) && is_array($val)) { + $childvalue = $val[$childcol] ? $val[$childcol] : $val[$j]; + } + else { + $childvalue = ''; + } if ($edit_mode) { if ($colprop['subtypes'] || $colprop['limit'] != 1) $cp['array'] = true; -- cgit v1.2.3 From 6236838574ce57195cfa5947b3b9b389bbce1080 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sat, 12 May 2012 11:27:59 +0200 Subject: Fix handling of some HTML tags e.g. IMG (#1488471) - reworked fix for #1486812 --- CHANGELOG | 1 + program/lib/washtml.php | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 27d16c0cd..ab289e6fa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Fix handling of some HTML tags e.g. IMG (#1488471) - Use similar language as a fallback for plugin localization (#1488401) - Fix issue where signature wasn't re-added on draft compose (#1488322) - Update to TinyMCE 3.5 (#1488459) diff --git a/program/lib/washtml.php b/program/lib/washtml.php index 04a65c7a1..daff5b5f4 100644 --- a/program/lib/washtml.php +++ b/program/lib/washtml.php @@ -108,7 +108,7 @@ class washtml /* Block elements which could be empty but cannot be returned in short form () */ static $block_elements = array('div', 'p', 'pre', 'blockquote', 'a', 'font', 'center', - 'table', 'ul', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ol', 'dl', 'strong', 'i', 'b', 'u'); + 'table', 'ul', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ol', 'dl', 'strong', 'i', 'b', 'u', 'span'); /* State for linked objects in HTML */ public $extlinks = false; @@ -133,7 +133,8 @@ class washtml /* Constructor */ - public function __construct($p = array()) { + public function __construct($p = array()) + { $this->_html_elements = array_flip((array)$p['html_elements']) + array_flip(self::$html_elements) ; $this->_html_attribs = array_flip((array)$p['html_attribs']) + array_flip(self::$html_attribs); $this->_ignore_elements = array_flip((array)$p['ignore_elements']) + array_flip(self::$ignore_elements); @@ -149,7 +150,8 @@ class washtml } /* Check CSS style */ - private function wash_style($style) { + private function wash_style($style) + { $s = ''; foreach (explode(';', $style) as $declaration) { @@ -191,7 +193,8 @@ class washtml } /* Take a node and return allowed attributes and check values */ - private function wash_attribs($node) { + private function wash_attribs($node) + { $t = ''; $washed; @@ -231,7 +234,8 @@ class washtml /* The main loop that recurse on a node tree. * It output only allowed tags with allowed attributes * and allowed inline styles */ - private function dumpHtml($node) { + private function dumpHtml($node) + { if(!$node->hasChildNodes()) return ''; @@ -248,9 +252,7 @@ class washtml else if (isset($this->_html_elements[$tagName])) { $content = $this->dumpHtml($node); $dump .= '<' . $tagName . $this->wash_attribs($node) . - // create closing tag for block elements, but also for elements - // with content or with some attributes (eg. style, class) (#1486812) - ($content != '' || $node->hasAttributes() || isset($this->_block_elements[$tagName]) ? ">$content" : ' />'); + ($content != '' || isset($this->_block_elements[$tagName]) ? ">$content" : ' />'); } else if (isset($this->_ignore_elements[$tagName])) { $dump .= ''; @@ -310,5 +312,3 @@ class washtml } } - -?> -- cgit v1.2.3 From 02cf44e1838aca64e14921d30dc44d25a4d73b1c Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sat, 12 May 2012 15:36:51 +0200 Subject: Fix handling of "usemap" attribute (#1488472) --- CHANGELOG | 1 + program/lib/washtml.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index ab289e6fa..d9313c0f1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Fix handling of "usemap" attribute (#1488472) - Fix handling of some HTML tags e.g. IMG (#1488471) - Use similar language as a fallback for plugin localization (#1488401) - Fix issue where signature wasn't re-added on draft compose (#1488322) diff --git a/program/lib/washtml.php b/program/lib/washtml.php index daff5b5f4..4221abdef 100644 --- a/program/lib/washtml.php +++ b/program/lib/washtml.php @@ -101,7 +101,7 @@ class washtml 'cellpadding', 'valign', 'bgcolor', 'color', 'border', 'bordercolorlight', 'bordercolordark', 'face', 'marginwidth', 'marginheight', 'axis', 'border', 'abbr', 'char', 'charoff', 'clear', 'compact', 'coords', 'vspace', 'hspace', - 'cellborder', 'size', 'lang', 'dir', + 'cellborder', 'size', 'lang', 'dir', 'usemap', // attributes of form elements 'type', 'rows', 'cols', 'disabled', 'readonly', 'checked', 'multiple', 'value' ); -- cgit v1.2.3