Index: openacs-4/packages/acs-api-browser/www/proc-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/www/proc-view.tcl,v diff -u -N -r1.6.16.6 -r1.6.16.7 --- openacs-4/packages/acs-api-browser/www/proc-view.tcl 29 Jul 2014 10:56:35 -0000 1.6.16.6 +++ openacs-4/packages/acs-api-browser/www/proc-view.tcl 5 Sep 2014 10:22:40 -0000 1.6.16.7 @@ -41,13 +41,59 @@ # Try and be helpful about the procedure. if { ![nsv_exists api_proc_doc $proc] } { - if {[info procs ::$proc] ne ""} { - set error_msg "

This procedure is defined in the server but not documented via ad_proc or proc_doc and may be intended as a private interface.

The procedure is defined as:

-proc $proc {[info args $proc]} {
-[ad_quotehtml [info body $proc]]
-}

" - } elseif {[info commands ::$proc] ne ""} { - set error_msg "

The procedure $proc is an available command on the server and might be found in the TCL or AOLServer documentation or in documentation for a loadable module (like ns_cache for example).

" + if {[info procs ::$proc] eq "::$proc"} { + set error_msg [subst { +

This procedure is defined in the server but not + documented via ad_proc or proc_doc and may be intended as + a private interface.

The procedure is defined as: +

+	    proc $proc {[info args $proc]} {
+		[ad_quotehtml [info body $proc]]
+	    }
+	    

+ }] + } elseif {[info commands ::$proc] eq "::$proc"} { + + set result [util_memoize [list ::util::http::get -url $::apidoc::ns_api_html_index]] + set page [dict get $result page] + + set url [apidoc::search_on_webindex \ + -page $page \ + -root $::apidoc::ns_api_root \ + -host $::apidoc::ns_api_host \ + -proc $proc] + + if {$url ne ""} { + ns_log notice "got URL <$url>" + ad_returnredirect -allow_complete_url $url + ad_script_abort + } + + set result [util_memoize [list ::util::http::get -url $::apidoc::tcl_api_html_index]] + set page [dict get $result page] + + # Strip the end of the Tcl-URL to obtain the root + regexp {^(.*)/[^/]+} $::apidoc::tcl_api_html_index _ root + append root / + + set url [apidoc::search_on_webindex -page $page \ + -root $root -host $root -proc $proc] + + if {$url ne ""} { + ad_returnredirect -allow_complete_url $url + ad_script_abort + } + + set error_msg [subst { + +

The command $proc is an available command on + the server and might be found in the Tcl + or [ns_info name] + documentation or in documentation for a loadable module. +

+ }] + } else { set error_msg "

The procedure $proc is not defined in the server.

" }