diff --git a/forms/TreeDropdownField.php b/forms/TreeDropdownField.php index 91c5ad88f..e4024c12f 100644 --- a/forms/TreeDropdownField.php +++ b/forms/TreeDropdownField.php @@ -54,6 +54,7 @@ class TreeDropdownField extends FormField { * @ignore */ protected $sourceObject, $keyField, $labelField, $filterCallback, $searchCallback, $baseID = 0; + protected $childrenMethod = 'AllChildrenIncludingDeleted'; //default child method in Hierarcy->getChildrenAsUL /** * Used by field search to leave only the relevant entries @@ -143,6 +144,16 @@ class TreeDropdownField extends FormField { return $this; } + /** + * @param $method The parameter to ChildrenMethod to use when calling Hierarchy->getChildrenAsUL in {@link Hierarchy}. + * The method specified determined the structure of the returned list. Use "ChildFolders" in place of the default + * to get a drop-down listing with only folders, i.e. not including the child elements in the currently selected folder. + * See {@link Hierarchy} for a complete list of possible methods. + */ + public function setChildrenMethod($method) { + $this->childrenMethod = $method; + } + /** * @return string */ @@ -244,11 +255,11 @@ class TreeDropdownField extends FormField { } $eval = '"