Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | espaco | 1 | <?php |
| 2 | $records = array(); |
||
| 3 | $records['nodes'] = array(); |
||
| 4 | |||
| 5 | $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : '0'; |
||
| 6 | $level = 1; |
||
| 7 | if ($id != '0') { |
||
| 8 | $id = explode(':', $id); |
||
| 9 | $level = $id[1] + 1; |
||
| 10 | } |
||
| 11 | |||
| 12 | for($i = 1; $i < 6; $i++) { |
||
| 13 | $id_ = time() + rand(1000, 20000) . ':' . ($level); |
||
| 14 | $records['nodes'][] = array('id' => $id_, 'parent' => $id, 'name' => 'Node - ' . $level . ' - ' . $i, 'level' => $level, 'type' => 'folder'); |
||
| 15 | } |
||
| 16 | |||
| 17 | echo json_encode($records); |
||
| 18 | ?> |
||
| 19 |