openrat-cms

OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs | README

commit ba48428434ff86e6477fb91bd5f189ec1f261c3d
parent eb48d7e5386c307eb0fedfbb66e0707ca18b5b24
Author: Jan Dankert <develop@jandankert.de>
Date:   Sun, 15 Nov 2020 22:27:21 +0100

Fix: Navigaton nodes which are not able to open should NOT have an icon to open the node.

Diffstat:
Mmodules/cms/ui/themes/default/html/views/tree/branch.php | 4+++-
Mmodules/cms/ui/themes/default/html/views/tree/branch.tpl.src.xml | 4+++-
Mmodules/util/Tree.class.php | 11++++++++---
3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/modules/cms/ui/themes/default/html/views/tree/branch.php b/modules/cms/ui/themes/default/html/views/tree/branch.php @@ -2,7 +2,9 @@ <?php foreach((array)$branch as $list_key=>$list_value) { extract($list_value); ?> <li class="<?php echo O::escapeHtml('or-navtree-node or-navtree-node--is-closed or-or-draggable or-or-draggable--type-'.@$type.'') ?>"><?php echo O::escapeHtml('') ?> <div class="<?php echo O::escapeHtml('or-navtree-tree or-navtree-node-control') ?>"><?php echo O::escapeHtml('') ?> - <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--node-closed or-navtree-tree-icon') ?>"><?php echo O::escapeHtml('') ?></i> + <?php $if5=($type); if($if5) { ?> + <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--node-closed or-navtree-tree-icon') ?>"><?php echo O::escapeHtml('') ?></i> + <?php } ?> </div> <div class="<?php echo O::escapeHtml('or-act-clickable') ?>"><?php echo O::escapeHtml('') ?> <a title="<?php echo O::escapeHtml(''.@$description.'') ?>" target="<?php echo O::escapeHtml('_self') ?>" data-type="<?php echo O::escapeHtml('open') ?>" data-action="<?php echo O::escapeHtml(''.@$action.'') ?>" data-method="<?php echo O::escapeHtml('') ?>" data-id="<?php echo O::escapeHtml(''.@$id.'') ?>" data-extra-type="<?php echo O::escapeHtml(''.@$type.'') ?>" data-extra="<?php echo O::escapeHtml('{\'type\':\''.@$type.'\'}') ?>" href="<?php echo O::escapeHtml('#/'.@$action.'/'.@$id.'') ?>" class="<?php echo O::escapeHtml('or-link or-entry') ?>"><?php echo O::escapeHtml('') ?> diff --git a/modules/cms/ui/themes/default/html/views/tree/branch.tpl.src.xml b/modules/cms/ui/themes/default/html/views/tree/branch.tpl.src.xml @@ -3,7 +3,9 @@ <list list="${branch}" extract="true"> <part tag="li" class="navtree-node,navtree-node--is-closed,or-draggable,or-draggable--type-${type}"> <part class="navtree-tree,navtree-node-control"> - <image class="navtree-tree-icon" symbol="node-closed"/> + <if true="${type}"> + <image class="navtree-tree-icon" symbol="node-closed"/> + </if> </part> <part class="act-clickable"> <link type="open" action="${action}" id="${id}" class="entry" title="${description}" var1="type" diff --git a/modules/util/Tree.class.php b/modules/util/Tree.class.php @@ -248,7 +248,7 @@ class Tree $treeElement->internalId = $user->userid; $treeElement->text = $user->name; $treeElement->action = 'user'; - $treeElement->type = 'user'; + //$treeElement->type = 'user'; $treeElement->icon = 'user'; $desc = $user->fullname; @@ -335,7 +335,10 @@ class Tree $treeElement->internalId = $id . '_' . $elementid; $treeElement->text = $element->label; $treeElement->action = 'pageelement'; - $treeElement->type = 'pageelement'; + + if ( in_array($element->typeid,[Element::ELEMENT_TYPE_LINK,Element::ELEMENT_TYPE_INSERT])) + $treeElement->type = 'pageelement'; + $treeElement->icon = 'el_' . $element->getTypeName(); $treeElement->extraId = array('elementid' => $elementid); @@ -527,7 +530,9 @@ class Tree $treeElement->action = $o->getType(); $treeElement->icon = $o->getType(); - $treeElement->type = $o->getType(); + + if ( in_array($o->getType(),['folder','link','page','alias'])) // openable? + $treeElement->type = $o->getType(); $this->addTreeElement($treeElement); }