Permalink
Browse files

MINOR Add forceFullTree param for getting a complete tree (SSF-110)

  • Loading branch information...
1 parent 23e7aee commit 18e5dec680e04bf1e205e631f9f36c471d14e18c @normann normann committed with chillu Feb 13, 2012
Showing with 2 additions and 4 deletions.
  1. +2 −4 forms/TreeDropdownField.php
@@ -203,12 +203,11 @@ public function tree(SS_HTTPRequest $request) {
$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 @@ public function tree(SS_HTTPRequest $request) {
$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>"';

0 comments on commit 18e5dec

Please sign in to comment.