commit 723bef24e81f6a137273d0701c0af975c91adbc4
parent 8b3621cfdad7ad30954332e53ada333a58269284
Author: Jan Dankert <devnull@localhost>
Date: Sat, 22 Dec 2018 23:20:44 +0100
Fix: Keine Fehlermeldung, wenn URLs in der Navigation aufgeklappt werden.
Diffstat:
3 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/modules/cms-core/action/TreeAction.class.php b/modules/cms-core/action/TreeAction.class.php
@@ -60,10 +60,19 @@ class TreeAction extends Action
{
$tree = new Tree();
- if ( $this->hasRequestVar('id'))
- $tree->$type( $this->getRequestVar('id') );
- else
- $tree->$type();
+ try
+ {
+ $method = new \ReflectionMethod($tree,$type);
+ if ( $this->hasRequestVar('id'))
+ $method->invoke($tree, $this->getRequestVar('id') );
+ else
+ $method->invoke($tree); // <== Executing the Action
+ }
+ catch (\ReflectionException $re)
+ {
+ throw new \LogicException('Treemethod not found: '.$type);
+ }
+
$branch = array();
foreach($tree->treeElements as $element )
diff --git a/modules/cms-ui/themes/default/html/views/link/edit.php b/modules/cms-ui/themes/default/html/views/link/edit.php
@@ -9,9 +9,9 @@
</div>
<div class="input">
<div class="selector">
-<div class="inputholder">
-<input type="hidden" name="targetobjectid" value="{id}" />
-<input type="text" disabled="disabled" value="{name}" />
+<div class="inputholder or-droppable">
+<input type="hidden" class="or-selector-link-value" name="targetobjectid" value="<?php echo $targetobjectid ?>" />
+<input type="text" class="or-selector-link-name" disabled="disabled" value="<?php echo $targetobjectname ?>" />
</div>
<div class="tree selector" data-types="{types}" data-init-id="<?php echo $targetobjectid ?>" data-init-folderid="parentid">
diff --git a/modules/util/Tree.class.php b/modules/util/Tree.class.php
@@ -473,6 +473,13 @@ class Tree
}
+ public function url($id)
+ {
+ // URLs have no sub-nodes.
+ // do nothing.
+ }
+
+
/**
* Laedt Elemente zu einem Ordner
*/