Example #1
0
function processActions($xmlSVG, $currentNode)
{
    $xmlSVG = preg_replace("/'/", "_", $xmlSVG);
    $xmlSVG = preg_replace("/[\\d]*/", "", $xmlSVG);
    $xmlSVG = preg_replace("/[_]+/", "_", $xmlSVG);
    //Remove any duplicate edges
    $SVGArray = explode(";\n", $xmlSVG);
    $SVGArray = arrays::removeDuplicates($SVGArray);
    $xmlSVG = implode(";\n", $SVGArray);
    //Highlight the goalNode
    $xmlSVG .= "goalNode[color=\"black\",shape=circle,style=filled,fillcolor=\".7 .3 1.0\"] ;\n";
    if (is_array($currentNode)) {
        for ($index = 0; $index < sizeof($currentNode); $index++) {
            $xmlSVG .= $currentNode[$index] . "[color=\"black\",style=filled,fillcolor=\"yellow\"] ;\n";
        }
    } else {
        //Highlight the CurrentNode
        $xmlSVG .= $currentNode . "[color=\"black\",style=filled,fillcolor=\"yellow\"] ;\n";
    }
    //Highlight the CurrentNode
    return $xmlSVG;
}