Commit 2fcbbcf2 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(baseSelector) Add missing tree parts in render

This makes sure all tree parts in the base selector has a visible
 parent, even if not clickable.

issue #5921
Showing with 14 additions and 0 deletions
+14 -0
......@@ -212,6 +212,7 @@ class baseSelector
$this->tree .= "<div class='treeList' style='display:none;max-height:".$this->height."px' id='bs_".$this->pid."' onmouseover=\"window.clearTimeout(rtimer);\" onmouseout=\"rtimer= Element.hide.delay(0.25, 'bs_".$this->pid."')\"><a class='treeList$selected' $link>/&nbsp;["._("Root")."]</a><ul class='treeList'>\n";
$first = TRUE;
$last_indent = 2;
$last_base = '';
foreach ($this->pathMapping as $base => $dummy) {
// Skip root for tree
......@@ -226,6 +227,18 @@ class baseSelector
if (!$first && ($indent == $last_indent)) {
$this->tree .= "</li>\n";
} elseif ($indent > $last_indent) {
$parent_base = implode(',', array_slice($elements, 1)).$config->current['BASE'];
if (!$first && ($parent_base != $last_base)) {
/* Our parent is missing, add it but without link */
$this->tree .= "</li>\n";
$this->tree .= '<li><a title="'.$parent_base.'">'.
'<img class="center" '.
'src="'.htmlentities($config->department_info[$parent_base]['img'], ENT_COMPAT, 'UTF-8').'" '.
'alt=""/>&nbsp;'.
$this->escape($config->department_info[$parent_base]['name']).
(($config->department_info[$parent_base]['description'] == '') ? '' : '&nbsp;<span class="informal">['.$this->escape($config->department_info[$parent_base]['description']).']</span>').
'</a>';
}
$this->tree .= "<ul>\n";
} elseif ($indent < $last_indent) {
for ($i = 0; $i < ($last_indent - $indent); $i++) {
......@@ -244,6 +257,7 @@ class baseSelector
'</a>';
$last_indent = $indent;
$last_base = $base;
$first = FALSE;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment