Index: openacs-4/packages/acs-api-browser/www/procs-file-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/www/procs-file-view.adp,v diff -u -r1.8.22.2 -r1.8.22.3 --- openacs-4/packages/acs-api-browser/www/procs-file-view.adp 11 Sep 2014 08:01:05 -0000 1.8.22.2 +++ openacs-4/packages/acs-api-browser/www/procs-file-view.adp 14 Sep 2014 08:23:42 -0000 1.8.22.3 @@ -1,45 +1,45 @@ -@title;noquote@ -@context;noquote@ + @title;noquote@ + @context;noquote@ -@dimensional_slider;noquote@ -@library_documentation;noquote@ + @dimensional_slider;noquote@ + @library_documentation;noquote@ -
+
-

Procedures in this file

+

Procedures in this file

- + -

Detailed information

+

Detailed information

- - - -
@proc_doc_list.doc;noquote@

- + + + +
@proc_doc_list.doc;noquote@
+  

+ - - [ show source ] - - - [ hide source ] - + + [ show source ] + + + [ hide source ] + - - | [ make this - the default ] - + + | [ make this + the default ] + - -

Content File Source

+ +

Content File Source

- -
@file_contents;literal@
-
\ No newline at end of file + +
@file_contents;literal@
+ Index: openacs-4/packages/acs-api-browser/www/procs-file-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/www/procs-file-view.tcl,v diff -u -r1.3.10.6 -r1.3.10.7 --- openacs-4/packages/acs-api-browser/www/procs-file-view.tcl 11 Sep 2014 08:01:05 -0000 1.3.10.6 +++ openacs-4/packages/acs-api-browser/www/procs-file-view.tcl 14 Sep 2014 08:23:42 -0000 1.3.10.7 @@ -17,11 +17,11 @@ } set url_vars [export_vars -url {path version_id}] +set return_url [ns_urlencode [ad_conn url]?][ns_urlencode $url_vars] set default_source_p [ad_get_client_property -default 0 acs-api-browser api_doc_source_p] if { ![info exists source_p] } { set source_p $default_source_p } - if { ![info exists version_id] && [regexp {^packages/([^ /]+)/} $path "" package_key] } { db_0or1row version_id_from_package_key { @@ -31,6 +31,22 @@ } } +if {![file readable $::acs::rootdir/$path] || [file isdirectory $::acs::rootdir/$path]} { + if {[info exists version_id]} { + set kind procs + set href [ad_conn package_url]/package-view?[export_vars {version_id {kind procs}}] + set link [subst {

Go back to Package Documentation.}] + } else { + set link [subst {

Go back to API Browser.}] + } + ad_return_warning "No such library file" [subst { + The file '$path' was not found. Maybe the url contains a typo. + $link + }] + return +} + + if {[info exists version_id]} { set public_p [::apidoc::set_public $version_id $public_p] } else { @@ -89,3 +105,8 @@ multirow append proc_doc_list [api_proc_documentation $proc] } } + +if { $source_p } { + set file_contents [template::util::read_file $::acs::rootdir/$path] + set file_contents [apidoc::tclcode_to_html $file_contents] +}