[Svn] r4869 - trunk/roundcubemail/program/steps/addressbook

trac at roundcube.net trac at roundcube.net
Tue Jun 21 09:56:43 CEST 2011


Author: alec
Date: 2011-06-21 02:56:40 -0500 (Tue, 21 Jun 2011)
New Revision: 4869

Modified:
   trunk/roundcubemail/program/steps/addressbook/func.inc
Log:
- Set css class name on directory list row according to readonly flag and 'class' data provided by plugins


Modified: trunk/roundcubemail/program/steps/addressbook/func.inc
===================================================================
--- trunk/roundcubemail/program/steps/addressbook/func.inc	2011-06-18 19:45:26 UTC (rev 4868)
+++ trunk/roundcubemail/program/steps/addressbook/func.inc	2011-06-21 07:56:40 UTC (rev 4869)
@@ -161,7 +161,7 @@
     $jsdata = array();
 
     $line_templ = html::tag('li', array(
-        'id' => 'rcmli%s', 'class' => 'addressbook %s'),
+        'id' => 'rcmli%s', 'class' => '%s'),
         html::a(array('href' => '%s',
             'rel' => '%s',
             'onclick' => "return ".JS_OBJECT_NAME.".command('list','%s',this)"), '%s'));
@@ -177,9 +177,19 @@
     foreach ($sources as $j => $source) {
         $id = strval($source['id'] ? $source['id'] : $j);
         $js_id = JQ($id);
+
+        // set class name(s)
+        $class_name = 'addressbook';
+        if ($current === $id)
+            $class_name .= ' selected';
+        if ($source['readonly'])
+            $class_name .= ' readonly';
+        if ($source['class'])
+            $class_name .= ' ' . $source['class'];
+
         $out .= sprintf($line_templ,
             html_identifier($id),
-            ($current === $id ? 'selected' : ''),
+            $class_name,
             Q(rcmail_url(null, array('_source' => $id))),
             $source['id'],
             $js_id, (!empty($source['name']) ? Q($source['name']) : Q($id)));

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



More information about the Svn mailing list