Page MenuHomePhorge

D641.1774835481.diff
No OneTemporary

Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None

D641.1774835481.diff

diff --git a/plugins/kolab_addressbook/kolab_addressbook.php b/plugins/kolab_addressbook/kolab_addressbook.php
--- a/plugins/kolab_addressbook/kolab_addressbook.php
+++ b/plugins/kolab_addressbook/kolab_addressbook.php
@@ -227,36 +227,38 @@
public function folder_tree_html($node, $data, &$jsdata)
{
$out = '';
- foreach ($node->children as $folder) {
- $id = $folder->id;
- $source = $data[$id];
- $is_collapsed = strpos($this->rc->config->get('collapsed_abooks',''), '&'.rawurlencode($id).'&') !== false;
-
- if ($folder->virtual) {
- $source = $this->abook_prop($folder->id, $folder);
- }
- else if (empty($source)) {
- $this->sources[$id] = new rcube_kolab_contacts($folder->name);
- $source = $this->abook_prop($id, $this->sources[$id]);
- }
+ if (!empty($node->children)) {
+ foreach ($node->children as $folder) {
+ $id = $folder->id;
+ $source = $data[$id];
+ $is_collapsed = strpos($this->rc->config->get('collapsed_abooks',''), '&'.rawurlencode($id).'&') !== false;
+
+ if ($folder->virtual) {
+ $source = $this->abook_prop($folder->id, $folder);
+ }
+ else if (empty($source)) {
+ $this->sources[$id] = new rcube_kolab_contacts($folder->name);
+ $source = $this->abook_prop($id, $this->sources[$id]);
+ }
- $content = $this->addressbook_list_item($id, $source, $jsdata);
+ $content = $this->addressbook_list_item($id, $source, $jsdata);
- if (!empty($folder->children)) {
- $child_html = $this->folder_tree_html($folder, $data, $jsdata);
+ if (!empty($folder->children)) {
+ $child_html = $this->folder_tree_html($folder, $data, $jsdata);
- // copy group items...
- if (preg_match('!<ul[^>]*>(.*)</ul>\n*$!Ums', $content, $m)) {
- $child_html = $m[1] . $child_html;
- $content = substr($content, 0, -strlen($m[0]) - 1);
- }
- // ... and re-create the subtree
- if (!empty($child_html)) {
- $content .= html::tag('ul', array('class' => 'groups', 'style' => ($is_collapsed ? "display:none;" : null)), $child_html);
+ // copy group items...
+ if (preg_match('!<ul[^>]*>(.*)</ul>\n*$!Ums', $content, $m)) {
+ $child_html = $m[1] . $child_html;
+ $content = substr($content, 0, -strlen($m[0]) - 1);
+ }
+ // ... and re-create the subtree
+ if (!empty($child_html)) {
+ $content .= html::tag('ul', array('class' => 'groups', 'style' => ($is_collapsed ? "display:none;" : null)), $child_html);
+ }
}
- }
- $out .= $content . '</li>';
+ $out .= $content . '</li>';
+ }
}
return $out;

File Metadata

Mime Type
text/plain
Expires
Mon, Mar 30, 1:51 AM (3 d, 10 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18786444
Default Alt Text
D641.1774835481.diff (3 KB)

Event Timeline