diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-06-21 07:56:40 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-06-21 07:56:40 +0000 |
| commit | e66313a863f2092e6321d136682aa294c7cdab6a (patch) | |
| tree | 83a03b2f30a051bb59e0847845df521b9e5405fa | |
| parent | 7f4085a026bb1c2be4e7355e0d2dcb69ba3a0802 (diff) | |
- Set css class name on directory list row according to readonly flag and 'class' data provided by plugins
git-svn-id: https://svn.roundcube.net/trunk@4869 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | roundcubemail/program/steps/addressbook/func.inc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/roundcubemail/program/steps/addressbook/func.inc b/roundcubemail/program/steps/addressbook/func.inc index 1bb373f75..0f2d75705 100644 --- a/roundcubemail/program/steps/addressbook/func.inc +++ b/roundcubemail/program/steps/addressbook/func.inc @@ -161,7 +161,7 @@ function rcmail_directory_list($attrib) $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 @@ function rcmail_directory_list($attrib) 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))); |
