2 // PukiWiki - Yet another WikiWikiWeb clone
5 // 2005-2022 PukiWiki Development Team
7 // Output an index for 'TouchGraph WikiBrowser'
8 // https://sourceforge.net/projects/touchgraph/
9 // https://www.touchgraph.com/
12 // On Windows OS, change console active codepage by chcp command
18 // Usage: (Check also TGWikiBrowser's sample)
19 // java -Dfile.encoding=UTF-8 -jar TGWikiBrowser.jar \
20 // "http://<pukiwiki site>/?plugin=touchgraph" \
21 // "http://<pukiwiki site>/?" FrontPage 2 true
23 function plugin_touchgraph_action()
27 header('Content-Type: text/plain; charset=' . SOURCE_ENCODING);
28 if (isset($vars['reverse'])) {
29 plugin_touchgraph_ref();
31 plugin_touchgraph_rel();
37 function plugin_touchgraph_rel()
39 foreach (get_existpages() as $page) {
40 if (check_non_list($page)) continue;
42 $file = CACHE_DIR . encode($page) . '.rel';
43 if (file_exists($file)) {
46 foreach(explode("\t", trim($data[0])) as $name) {
47 if (check_non_list($name)) continue;
56 function plugin_touchgraph_ref()
58 foreach (get_existpages() as $page) {
59 if (check_non_list($page)) continue;
61 $file = CACHE_DIR . encode($page) . '.ref';
62 if (file_exists($file)) {
64 foreach (file($file) as $line) {
65 list($name) = explode("\t", $line);
66 if (check_non_list($name)) continue;