Index: openacs-4/packages/xotcl-core/www/show-object.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/www/show-object.tcl,v diff -u -r1.27.2.8 -r1.27.2.9 --- openacs-4/packages/xotcl-core/www/show-object.tcl 4 Oct 2021 17:18:27 -0000 1.27.2.8 +++ openacs-4/packages/xotcl-core/www/show-object.tcl 7 Oct 2021 11:06:02 -0000 1.27.2.9 @@ -416,7 +416,7 @@ # # TODO: it would be nice to pass the selected options from the # dimensional slider to dotcode, since with svg, the dot code - # constructs URLS for navigation in the class tree. + # constructs URLs for navigation in the class tree. # set dot_code [::xo::dotcode -dpi 72 \ -with_children $with_children \ @@ -425,41 +425,11 @@ -current_object $object \ -documented_methods $documented_only \ $class_hierarchy] - set dot "" - catch {set dot [::util::which dot]} - # final resort for cases, where ::util::which is not available - if {$dot eq "" && [file executable /usr/bin/dot]} { - set dot /usr/bin/dot - } - if {$dot eq ""} { - #ns_return 404 plain/text "dot not found" - ns_log warning "program 'dot' is not available" - #ad_script_abort - } else { - set stem [ad_tmpnam] - set svgfile $stem.svg - set dotfile $stem.dot - - set f [open $dotfile w]; puts $f $dot_code; close $f - try { - exec $dot -Tsvg -o $svgfile $dotfile - } on error {errorMsg} { - ns_log warning "dot returned $errorMsg" - } - set f [open $svgfile]; set svg [read $f]; close $f - - # delete the first three lines generated from dot - regsub {^[^\n]+\n[^\n]+\n[^\n]+\n} $svg "" svg - set css { - svg g a:link {text-decoration: none;} - div.inner svg {width: 100%; margin: 0 auto;} - } - set svg "
$svg
" - - file delete -- $svgfile - file delete -- $dotfile - } + set svg [util::inline_svg_from_dot -css { + svg g a:link {text-decoration: none;} + div.inner svg {width: 100%; margin: 0 auto;} + } $dot_code] } if {$isclass} {