89c89 < mkdir( $dir, 0775 ) or return "DirectedGraph Error: *folder $dir could not be created*"; --- > mkpath($dir, 0, 0755) or return "DirectedGraph Error: *folder $dir could not be created*"; 102c102 < $image="${dir}/graph${hash_code}.png"; --- > my $image="${dir}/graph${hash_code}.png"; 106a107 > 117a119,136 > # run the "dot" command to create a map file with a clientside map for the directed graph > my $cmapx="${dir}/graph${hash_code}.map"; > > # don't do anything if it already exists > if (open TMP, "$cmapx") { > close TMP; > } > # create the map > else { > $command=system("/usr/bin/dot -Tcmapx -o $cmapx /tmp/foo.dot$$"); > if($command) { > # errors existed so remove created files > unlink "$cmapx"; > unlink "/tmp/foo.dot$$"; > return "DirectedGraph Error: syntax error"; > } > } > 121,123c140,148 < # attach "foo.png" at the source of the tag in $Web.$Topic < $loc=&TWiki::Func::getUrlHost() . &TWiki::Func::getPubUrlPath() . "/$web/$topic"; < return ""; --- > # read and format map > my $mapfile = TWiki::Store::readFile( $cmapx ); > $mapfile =~ s/()/$1$hash_code$3$hash_code$5/go; > > # place map and "foo.png" at the source of the tag in $Web.$Topic > my $loc = &TWiki::Func::getPubUrlPath() . "/$web/$topic"; > > return "$mapfile"; >