|
@@ 23-35 (lines=13) @@
|
| 20 |
|
<% end_control %> |
| 21 |
|
</code> |
| 22 |
|
*/ |
| 23 |
|
public function PagedChildren($klazz, $pageLength = 10, $prime = false, $relationship_key = 'ParentID') |
| 24 |
|
{ |
| 25 |
|
$parentID = $this->owner->ID; |
| 26 |
|
$req = Controller::curr()->getRequest(); |
| 27 |
|
$list = DataList::create($klazz)->where('"ParentID" = '.$parentID); |
| 28 |
|
$this->lastPagedResults = new PaginatedList($list, $req); |
| 29 |
|
$this->lastPagedResults->setPageLength($pageLength); |
| 30 |
|
$this->lastPagedResults->setLimitItems($pageLength); |
| 31 |
|
$result = $this->lastPagedResults; |
| 32 |
|
if ($prime == true) { |
| 33 |
|
$result = ''; // render nothing to the template, we are only updating variables |
| 34 |
|
} |
| 35 |
|
|
| 36 |
|
return $result; |
| 37 |
|
} |
| 38 |
|
|
|
@@ 39-51 (lines=13) @@
|
| 36 |
|
return $result; |
| 37 |
|
} |
| 38 |
|
|
| 39 |
|
public function AllPagedChildren($pageLength = 10, $sort = 'Sort', $prime = false, $relationship_key = 'ParentID') |
| 40 |
|
{ |
| 41 |
|
$parentID = $this->owner->ID; |
| 42 |
|
$req = Controller::curr()->getRequest(); |
| 43 |
|
$list = SiteTree::get()->where('"ParentID" = '.$parentID); |
| 44 |
|
$this->lastPagedResults = new PaginatedList($list, $req); |
| 45 |
|
$this->lastPagedResults->setPageLength($pageLength); |
| 46 |
|
$this->lastPagedResults->setLimitItems($pageLength); |
| 47 |
|
$result = $this->lastPagedResults; |
| 48 |
|
if ($prime == true) { |
| 49 |
|
$result = ''; // render nothing to the template, we are only updating variables |
| 50 |
|
} |
| 51 |
|
|
| 52 |
|
return $result; |
| 53 |
|
} |
| 54 |
|
|