PHP 7.3 fix

This commit is contained in:
Roland Gruber 2019-02-01 20:18:55 +01:00
parent 1bd598b0c3
commit 716d119d34
1 changed files with 11 additions and 6 deletions

View File

@ -57,25 +57,30 @@ class AJAXTree extends HTMLTree {
$child_count = $this->readChildrenNumber($entry->getDN()); $child_count = $this->readChildrenNumber($entry->getDN());
$nb = 0; $nb = 0;
if ($first_child) if ($first_child) {
$nb += 1; $nb += 1;
if ($last_child) }
if ($last_child) {
$nb += 2; $nb += 2;
}
if ($level < 1) {
$nb += 1;
}
$imgs['expand'] = array('tree_expand.png','tree_expand.png','tree_expand_corner.png', $imgs['expand'] = array('tree_expand.png','tree_expand.png','tree_expand_corner.png',
($level > 0) ? 'tree_expand_corner.png' : 'tree_expand_corner_first.png'); 'tree_expand_corner.png', 'tree_expand_corner_first.png');
$imgs['collapse'] = array('tree_collapse.png','tree_collapse.png','tree_collapse_corner.png', $imgs['collapse'] = array('tree_collapse.png','tree_collapse.png','tree_collapse_corner.png',
($level > 0) ? 'tree_collapse_corner.png' : 'tree_collapse_corner_first.png'); 'tree_collapse_corner.png', 'tree_collapse_corner_first.png');
$imgs['tree'] = array('tree_split.png','tree_split.png','tree_corner.png','tree_corner.png'); $imgs['tree'] = array('tree_split.png','tree_split.png','tree_corner.png','tree_corner.png','tree_corner.png');
/** Information on array[$nb] /** Information on array[$nb]
* nb == 1 => the node is the first child * nb == 1 => the node is the first child
* nb == 2 => the node is the last child * nb == 2 => the node is the last child
* nb == 3 => the node is the unique child * nb == 3 => the node is the unique child
* nb == 0 => the node is a child */ * nb == 0 => the node is a child */
$new_code = array('1','1','0','0'); $new_code = array('1','1','0','0','0');
# Links # Links
$parms['openclose'] = htmlspecialchars(sprintf('server_id=%s&dn=%s&code=%s%s',$this->getServerID(),$entry->getDNEncode(),$code,$new_code[$nb])); $parms['openclose'] = htmlspecialchars(sprintf('server_id=%s&dn=%s&code=%s%s',$this->getServerID(),$entry->getDNEncode(),$code,$new_code[$nb]));