evaluate(['@page.children' => '/coalitions']); // initialiser l'objet $data = array(); $i = 0; $a = 0; foreach ($pages as $key => $coa) { $header = $coa->header(); $url = $coa->url(); /*dump(st'01/01/'+$header->info['date']))*/ if(isset($header->member)){ $coa_object = array( 'lane' => $i, 'title' => $coa->title(), 'coa_name' => $header->info['orga'], 'start' => strtotime('01/01/'.$header->info['date'])*1000, 'end' => strtotime(date("Y"))*1000, 'activist' => array() ); if (isset($header->member)) { foreach ($header->member as $member) { if (strtotime($member["free"]) != "") { $f = strtotime($member["free"]); }else{ $f = strtotime(date("Y")); } $member_array = array( 'id' => $member["membre"], 'start' => strtotime($member['prison'])*1000, 'end' => $f*1000, 'url' => $url, 'lane' => $i, 'pos' => $a ); array_push($coa_object['activist'], $member_array); $a ++; } } array_push($data, $coa_object); $i ++; /*$debugger->addMessage($coa->header());*/ } } return $data; } }