Index: openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl,v diff -u -r1.27.8.22 -r1.27.8.23 --- openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 10 Sep 2014 20:19:26 -0000 1.27.8.22 +++ openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 11 Sep 2014 08:01:04 -0000 1.27.8.23 @@ -105,7 +105,7 @@ regsub -all {\#.*$} $line "" line set line [string trim $line] if { $line ne "" } { - set has_contract_p [regexp {^ad_page_contract\s} $line] + set has_contract_p [regexp {(^ad_page_contract\s)|( initialize )} $line match] break } } @@ -116,20 +116,25 @@ } doc_set_page_documentation_mode 1 + #ns_log notice "Sourcing $::acs::rootdir/$path in documentation mode" set errno [catch { source "$::acs::rootdir/$path" } error] doc_set_page_documentation_mode 0 - if { $errno == 1 } { - if { [regexp {^ad_page_contract documentation} $::errorInfo] } { + + # + # In documentation mode, we expect ad_page_contract (and counterparts) + # to break out of sourcing with an error to avoid side-effects of sourcing + # + if { $errno == 1} { + if {[regexp {^ad_page_contract documentation} $::errorInfo] } { array set doc_elements $error } - } else { - return -code $errno -errorcode $::errorCode -errorinfo $::errorInfo $error + if { [info exists doc_elements] } { + return [array get doc_elements] + } + return [list] } - if { [info exists doc_elements] } { - return [array get doc_elements] - } - return [list] + return -code $errno -errorcode $::errorCode -errorinfo $::errorInfo $error } ad_proc -public api_script_documentation { @@ -928,9 +933,7 @@ @return boolean value } { set result 0 - if {[string match "::*" $proc_name]} { ;# only check for absolute names - catch {set result [::xotcl::api inscope $scope ::xotcl::Object isobject $proc_name]} - } + catch {set result [::xotcl::api inscope $scope ::xotcl::Object isobject $proc_name]} return $result } Index: openacs-4/packages/acs-api-browser/www/content-page-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/www/content-page-view.tcl,v diff -u -r1.5.4.7 -r1.5.4.8 --- openacs-4/packages/acs-api-browser/www/content-page-view.tcl 10 Sep 2014 20:19:26 -0000 1.5.4.7 +++ openacs-4/packages/acs-api-browser/www/content-page-view.tcl 11 Sep 2014 08:01:05 -0000 1.5.4.8 @@ -12,7 +12,7 @@ } { version_id:naturalnum,optional source_p:integer,optional,trim - path + path:trim } -properties { title:onevalue context:onevalue @@ -29,7 +29,7 @@ } if { ![info exists version_id] && \ - [regexp {^packages/([^ /]+)/} $path "" package_key] } { + [regexp {^packages/([^ /]+)/} $path . package_key] } { db_0or1row version_id_from_package_key { select version_id from apm_enabled_package_versions Index: openacs-4/packages/acs-api-browser/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/www/index.adp,v diff -u -r1.18.2.2 -r1.18.2.3 --- openacs-4/packages/acs-api-browser/www/index.adp 11 Sep 2014 06:05:14 -0000 1.18.2.2 +++ openacs-4/packages/acs-api-browser/www/index.adp 11 Sep 2014 08:01:05 -0000 1.18.2.3 @@ -8,14 +8,13 @@

Installed Enabled Packages

+ 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.1 -r1.8.22.2 --- openacs-4/packages/acs-api-browser/www/procs-file-view.adp 11 Sep 2013 09:51:28 -0000 1.8.22.1 +++ openacs-4/packages/acs-api-browser/www/procs-file-view.adp 11 Sep 2014 08:01:05 -0000 1.8.22.2 @@ -24,3 +24,22 @@  

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

Content File Source

+ + +
@file_contents;literal@
+
\ No newline at end of file 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.5 -r1.3.10.6 --- openacs-4/packages/acs-api-browser/www/procs-file-view.tcl 10 Sep 2014 20:19:27 -0000 1.3.10.5 +++ openacs-4/packages/acs-api-browser/www/procs-file-view.tcl 11 Sep 2014 08:01:05 -0000 1.3.10.6 @@ -5,7 +5,8 @@ } { version_id:naturalnum,optional { public_p "" } - path + path:trim + source_p:integer,optional,trim } -properties { title:onevalue context:onevalue @@ -15,6 +16,12 @@ proc_doc_list:multirow } +set url_vars [export_vars -url {path version_id}] +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 {