Esempio n. 1
0
function printGraph($task, $level, &$bizrules)
{
    foreach ($task as $child => $grandChildren) {
        if ($level > 0) {
            echo '<em>';
            for ($i = 0; $i < $level - 1; $i++) {
                echo '&#9474; ';
            }
            echo '&#9492;&#9472;';
            echo '</em>';
        }
        // if(in_array($child,$bizrules))
        // $child .= ' (#)';
        if (empty($grandChildren)) {
            echo '<b';
            if (in_array($child, $bizrules)) {
                echo ' class="biz"';
            }
            echo ">&#9679; {$child}</b>\n";
        } else {
            echo "&#9675; {$child} \n";
            printGraph($grandChildren, $level + 1, $bizrules);
        }
    }
}
    //    echo "</pre>";
}
function printGraph($graphfile)
{
    //    echo '<div id="container">
    //    <div id="graph-container">';
    require "./graph_json.html";
    //    echo '</div></div>';
}
?>

<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <link rel='stylesheet' type='text/css' href='myCss.css' />
    </head>
    <body>
        <div id="container">
<!--            <div id="PublicationList">Scroll down to see the graph</div>-->
            <?php 
$xmlfile = "myPubs.xml";
$graphfile = "myCoauth.json";
checkGraph($xmlfile, $graphfile);
printPublications($xmlfile);
printGraph($graphfile);
?>
        </div>
    </body>
</html>