You are here

private function GatherContentCurl::sortRecursive in GatherContent 7.2

Sort pages recursively.

1 call to GatherContentCurl::sortRecursive()
GatherContentCurl::getPages in includes/curl.inc
List pages for the selected project.

File

includes/curl.inc, line 796
Contains functions used to process and retrieve data from GatherContent.

Class

GatherContentCurl
@file Contains functions used to process and retrieve data from GatherContent.

Code

private function sortRecursive($pages, $current = 0) {
  $children = array();
  if (isset($pages[$current])) {
    $children = $pages[$current];
    foreach ($children as $id => $page) {
      $children[$id]->children = $this
        ->sortRecursive($pages, $id);
    }
  }
  return $children;
}