Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| dev:grapher-php [2020/10/12 19:37] – editor42 | dev:grapher-php [2020/11/01 15:59] (current) – bab | ||
|---|---|---|---|
| Line 256: | Line 256: | ||
| fwrite($fh, " | fwrite($fh, " | ||
| + | fwrite($fh, " | ||
| fwrite($fh, " | fwrite($fh, " | ||
| node [shape = \" | node [shape = \" | ||
| Line 418: | Line 419: | ||
| $pages =& $data[' | $pages =& $data[' | ||
| $media =& $data[' | $media =& $data[' | ||
| - | $root_name = $data[' | + | $root_name = array_values($pages)[0][" |
| $output = '{ | $output = '{ | ||
| " | " | ||
| Line 432: | Line 434: | ||
| $output .= '" | $output .= '" | ||
| $output .= '" | $output .= '" | ||
| - | $output .= '" | + | $output .= '" |
| - | $output .= '" | + | |
| + | { | ||
| + | $path = explode (":", | ||
| + | $file = count($path ); | ||
| + | $folder=""; | ||
| + | for($n=0 ; $n < $file-1 ; $n++) | ||
| + | { | ||
| + | $folder = $folder . $path[$n] . "/"; | ||
| + | } | ||
| + | $output .= ',"img" : "'. DOKU_INC. " | ||
| + | } | ||
| // $output .= '" | // $output .= '" | ||
| // $output .= '" | // $output .= '" | ||
| $output .= " | $output .= " | ||
| - | if ($i < count($pages)) $output .= ','; | + | if ($i <= count($pages)-1) $output .= ','; |
| | | ||
| } | } | ||
| Line 452: | Line 464: | ||
| $output .= '{ | $output .= '{ | ||
| - | "from": "' | + | "source": "' |
| - | "to": "' | + | "target": "' |
| - | " | + | " |
| }'; | }'; | ||
| $cnt++; | $cnt++; | ||
| Line 460: | Line 472: | ||
| } | } | ||
| + | |||
| | | ||
| $output .= " ] }"; | $output .= " ] }"; | ||
| Line 470: | Line 483: | ||
| $grapher = new Grapher(); | $grapher = new Grapher(); | ||
| $grapher-> | $grapher-> | ||
| + | |||
| + | |||
| </ | </ | ||