Skip to content
Permalink
Browse files

Add detection for more exotic hierarchy configurations

  • Loading branch information...
flack committed Jun 20, 2019
1 parent 55c49d6 commit 8b3df683a314fc1398cd3b723cee7450ca97af58
Showing with 14 additions and 4 deletions.
  1. +14 −4 lib/midgard/admin/asgard/navigation.php
@@ -198,10 +198,20 @@ private function _draw_collapsed_element($level, $type, $total)
{
$ref = midcom_helper_reflector::get($type);
if (!empty($this->_object_path[$level])) {
if ( $this->_object_path[$level]->__mgdschema_class_name__ == $type
&& !array_key_exists($this->_object_path[$level]->guid, $this->shown_objects)) {
$label = htmlspecialchars($ref->get_object_label($this->_object_path[$level]));
$this->_draw_element($this->_object_path[$level], $label, $level);
if ($this->_object_path[$level]->__mgdschema_class_name__ == $type) {
$object = $this->_object_path[$level];
} elseif ($level == 0) {
// this is the case where our object has parents, but we're in its type view directly
foreach ($this->_object_path as $candidate) {
if ($candidate->__mgdschema_class_name__ == $type) {
$object = $candidate;
break;
}
}
}
if (!empty($object)) {
$label = htmlspecialchars($ref->get_object_label($object));
$this->_draw_element($object, $label, $level);
}
}
$icon = midcom_helper_reflector::get_object_icon(new $type);

0 comments on commit 8b3df68

Please sign in to comment.
You can’t perform that action at this time.