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

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