From fd52ed1ffe846b9a89c8a36ed6f933dc4375ca63 Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 16 Feb 2024 11:06:39 -0700 Subject: [PATCH] Fix missing admin default icons, tree icons had to be in dhtmlxtree --- admin/inc/class.admin_ui.inc.php | 14 +++++++++++--- api/js/etemplate/Et2Tree/Et2Tree.ts | 2 -- mail/inc/class.mail_tree.inc.php | 4 ++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/admin/inc/class.admin_ui.inc.php b/admin/inc/class.admin_ui.inc.php index 9f4552c037..8f364602f7 100644 --- a/admin/inc/class.admin_ui.inc.php +++ b/admin/inc/class.admin_ui.inc.php @@ -566,7 +566,7 @@ class admin_ui } if (!empty($data['icon'])) { - $icon = Etemplate\Widget\Tree::imagePath($data['icon']); + $icon = $data['icon']; if (!empty($data['child']) || !empty($data[Tree::CHILDREN])) { $data[Tree::IMAGE_FOLDER_OPEN] = $data[Tree::IMAGE_FOLDER_CLOSED] = $icon; @@ -576,6 +576,10 @@ class admin_ui $data[Tree::IMAGE_LEAF] = $icon; } } + else + { + // $data[Tree::IMAGE_LEAF] = Api\Image::find('api', 'bullet'); + } unset($data['icon']); $parent =& $tree[Tree::CHILDREN]; $parts = explode('/', $data[Tree::ID]); @@ -587,8 +591,12 @@ class admin_ui $path .= ($path == '/' ? '' : '/').$part; if (!isset($parent[$path])) { - $icon = Etemplate\Widget\Tree::imagePath($part == 'apps' ? Api\Image::find('api', 'home') : - (($i=Api\Image::find($part, 'navbar')) ? $i : Api\Image::find('api', 'nonav'))); + $icon = $part == 'apps' ? Api\Image::find('api', 'home') : + (($i = Api\Image::find($part, 'navbar')) ? $i : Api\Image::find('api', 'nonav')); + if(!str_ends_with($icon, '.svg')) + { + $icon = Api\Image::find('api', 'navbar'); + } $parent[$path] = array( Tree::ID => $path, Tree::LABEL => $part == 'apps' ? lang('Applications') : lang($part), diff --git a/api/js/etemplate/Et2Tree/Et2Tree.ts b/api/js/etemplate/Et2Tree/Et2Tree.ts index 84b81ae6d9..d9fee364ed 100644 --- a/api/js/etemplate/Et2Tree/Et2Tree.ts +++ b/api/js/etemplate/Et2Tree/Et2Tree.ts @@ -606,8 +606,6 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement) { //sl-icon images need to be svgs if there is a png try to find the corresponding svg img = img.endsWith(".png") ? img.replace(".png", ".svg") : img; - img = "api/templates/default/images/dhtmlxtree/" + img - } // Check to see if node is marked as open with no children. If autoloadable, load the children diff --git a/mail/inc/class.mail_tree.inc.php b/mail/inc/class.mail_tree.inc.php index 52c04094dd..900ecae33f 100644 --- a/mail/inc/class.mail_tree.inc.php +++ b/mail/inc/class.mail_tree.inc.php @@ -87,7 +87,7 @@ class mail_tree { if (strpos($image, '.') === false) { - $image = basename($img=Api\Image::find('mail', 'dhtmlxtree/'.$image)); + $image = Api\Image::find('mail', 'dhtmlxtree/' . $image); } } } @@ -431,7 +431,7 @@ class mail_tree //User defined folders icons $data[Tree::IMAGE_LEAF] = $data[Tree::IMAGE_FOLDER_OPEN] = - $data [Tree::IMAGE_FOLDER_CLOSED] = basename(Api\Image::find('mail', 'dhtmlxtree/'."MailFolder".$key)); + $data [Tree::IMAGE_FOLDER_CLOSED] = Api\Image::find('mail', 'dhtmlxtree/' . "MailFolder" . $key); } elseif(!empty($data['folderarray']['attributes']) && stripos(array2string($data['folderarray']['attributes']),'\noselect') !== false) {