summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps/mail/func.inc
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-03-02 14:48:26 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-03-02 14:48:26 +0000
commit9f0a8708f64468d0a978beeb3dab7e46e7cedabd (patch)
tree7a06f5b62aa727b79932aec6ec25d14cf0b92af9 /roundcubemail/program/steps/mail/func.inc
parente05a4682c32805c3cff9d99d950c02dc9e77811e (diff)
- Hide 'add contact' icon if there's no writable address book
git-svn-id: https://svn.roundcube.net/trunk@3303 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/func.inc')
-rw-r--r--roundcubemail/program/steps/mail/func.inc9
1 files changed, 7 insertions, 2 deletions
diff --git a/roundcubemail/program/steps/mail/func.inc b/roundcubemail/program/steps/mail/func.inc
index a8ef65139..be3bbbf06 100644
--- a/roundcubemail/program/steps/mail/func.inc
+++ b/roundcubemail/program/steps/mail/func.inc
@@ -1170,7 +1170,8 @@ function rcmail_alter_html_link($matches)
*/
function rcmail_address_string($input, $max=null, $linked=false, $addicon=null)
{
- global $IMAP, $PRINT_MODE, $CONFIG, $OUTPUT, $EMAIL_ADDRESS_PATTERN;
+ global $IMAP, $RCMAIL, $PRINT_MODE, $CONFIG, $OUTPUT, $EMAIL_ADDRESS_PATTERN;
+ static $got_writable_abook = null;
$a_parts = $IMAP->decode_address_list($input);
@@ -1181,6 +1182,10 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null)
$j = 0;
$out = '';
+ if ($got_writable_abook === null && $books = $RCMAIL->get_address_sources(true)) {
+ $got_writable_abook = true;
+ }
+
foreach ($a_parts as $part) {
$j++;
if ($PRINT_MODE) {
@@ -1200,7 +1205,7 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null)
$out .= html::span(array('title' => $part['mailto'], 'class' => "rcmContactAddress"), Q($part['name']));
}
- if ($addicon) {
+ if ($addicon && $got_writable_abook) {
$out .= '&nbsp;' . html::a(array(
'href' => "#add",
'onclick' => sprintf("return %s.command('add-contact','%s',this)", JS_OBJECT_NAME, urlencode($part['string'])),