source: trunk/prototype/links.php @ 5514

Revision 5514, 718 bytes checked in by acoutinho, 12 years ago (diff)

Ticket #2434 - Implementacao anexos, acls e delegacao de participantes

Line 
1<?php
2
3require_once 'api/controller.php';
4
5$concept = isset($_GET['concept']) ? $_GET['concept'] : false;
6
7$links = Controller::links( $concept );
8
9if( $concept )
10    $links = array( $concept => $links );
11
12$return = array();
13
14foreach( $links as $target => $link )
15{
16    $concepts = array();
17    $nestedLinks = array();
18
19    foreach( $link as $linkName => $linkTarget )
20    {
21         if( Controller::isConcept( $concept, $linkName ) )
22            $concepts[ $linkName ] = true;
23
24          $nestedLinks[ $linkName ] = Controller::links( $concept, $linkName );
25    }
26
27    $return[ $target ] = array( 'concepts' => $concepts, 'links' => $link, 'nestedLinks' => $nestedLinks );
28}
29
30echo json_encode( $concept ? $return[ $concept ] : $return );
Note: See TracBrowser for help on using the repository browser.