[Svn] r3303 - trunk/roundcubemail/program/steps/mail

trac at roundcube.net trac at roundcube.net
Tue Mar 2 15:48:27 CET 2010


Author: alec
Date: 2010-03-02 08:48:26 -0600 (Tue, 02 Mar 2010)
New Revision: 3303

Modified:
   trunk/roundcubemail/program/steps/mail/func.inc
Log:
- Hide 'add contact' icon if there's no writable address book


Modified: trunk/roundcubemail/program/steps/mail/func.inc
===================================================================
--- trunk/roundcubemail/program/steps/mail/func.inc	2010-03-02 14:35:53 UTC (rev 3302)
+++ trunk/roundcubemail/program/steps/mail/func.inc	2010-03-02 14:48:26 UTC (rev 3303)
@@ -1170,7 +1170,8 @@
  */
 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 @@
   $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 @@
         $out .= html::span(array('title' => $part['mailto'], 'class' => "rcmContactAddress"), Q($part['name']));
       }
 
-      if ($addicon) {
+      if ($addicon && $got_writable_abook) {
         $out .= ' ' . html::a(array(
             'href' => "#add",
             'onclick' => sprintf("return %s.command('add-contact','%s',this)", JS_OBJECT_NAME, urlencode($part['string'])),

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list