From ea77d9704e01bb8616b9b0285c39273fc0be4e14 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 15 Mar 2012 22:35:00 +0000 Subject: [PATCH] If template has a tree & a selectbox with the same ID (addressbook.edit), tree can play nice with the selectbox and provide compatible data so it still works --- etemplate/inc/class.etemplate_widget_tree.inc.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/etemplate/inc/class.etemplate_widget_tree.inc.php b/etemplate/inc/class.etemplate_widget_tree.inc.php index 4234a5350d..51c6c800f9 100644 --- a/etemplate/inc/class.etemplate_widget_tree.inc.php +++ b/etemplate/inc/class.etemplate_widget_tree.inc.php @@ -203,7 +203,18 @@ class etemplate_widget_tree extends etemplate_widget $cat2path[$cat['id']] = $path = ($cat['parent'] ? $cat2path[$cat['parent']].'/' : '').(string)$cat['id']; // 1D array - $options[$cat['id']] = $cat + array('text' => $cat['name'], 'path' => $path); + $options[$cat['id']] = $cat + array( + 'text' => $s, + 'path' => $path, + + /* + These ones to play nice when a user puts a tree & a selectbox with the same + ID on the form (addressbook edit): + if tree overwrites selectbox options, selectbox will still work + */ + 'label' => $s, + 'title' => $cat['description'] + ); // Tree in array //$options[$cat['parent']][] = $cat;