diff --git a/plugins/kolab_addressbook/kolab_addressbook.php b/plugins/kolab_addressbook/kolab_addressbook.php index a8046b3e..6a2aaa6e 100644 --- a/plugins/kolab_addressbook/kolab_addressbook.php +++ b/plugins/kolab_addressbook/kolab_addressbook.php @@ -224,11 +224,14 @@ class kolab_addressbook extends rcube_plugin if (!empty($folder->children)) { $child_html = $this->folder_tree_html($folder, $data, $jsdata); - if (!empty($child_html) && preg_match('!\n*$!', $content)) { - $content = preg_replace('!\n*$!', $child_html . '', $content); + // copy group items... + if (preg_match('!]*>(.*)\n*$!Ums', $content, $m)) { + $child_html = $m[1] . $child_html; + $content = substr($content, 0, -strlen($m[0]) - 1); } - else if (!empty($child_html)) { - $content .= html::tag('ul', array('style' => ($is_collapsed ? "display:none;" : null)), $child_html); + // ... and re-create the subtree + if (!empty($child_html)) { + $content .= html::tag('ul', array('class' => 'groups', 'style' => ($is_collapsed ? "display:none;" : null)), $child_html); } }