mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Add forceFullTree param for getting a complete tree (SSF-110)
This commit is contained in:
parent
23e7aeeea4
commit
18e5dec680
@ -203,12 +203,11 @@ class TreeDropdownField extends FormField {
|
||||
$isSubTree = false;
|
||||
|
||||
$this->search = Convert::Raw2SQL($request->requestVar('search'));
|
||||
|
||||
$ID = (is_numeric($request->latestparam('ID'))) ? (int)$request->latestparam('ID') : (int)$request->requestVar('ID');
|
||||
if($ID) {
|
||||
$forceFullTree = $request->requestVar('forceFullTree')?$request->requestVar('forceFullTree'):false;
|
||||
if($ID && !$forceFullTree) {
|
||||
$obj = DataObject::get_by_id($this->sourceObject, $ID);
|
||||
$isSubTree = true;
|
||||
|
||||
if(!$obj) {
|
||||
throw new Exception (
|
||||
"TreeDropdownField->tree(): the object #$ID of type $this->sourceObject could not be found"
|
||||
@ -240,7 +239,6 @@ class TreeDropdownField extends FormField {
|
||||
$obj->markToExpose($this->objectForKey($value));
|
||||
}
|
||||
}
|
||||
|
||||
$eval = '"<li id=\"selector-' . $this->getName() . '-{$child->' . $this->keyField . '}\" data-id=\"$child->' . $this->keyField . '\" class=\"class-$child->class"' .
|
||||
' . $child->markingClasses() . "\"><a rel=\"$child->ID\">" . $child->' . $this->labelField . ' . "</a>"';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user