###
### just for backward compatibility for oacs 5.1   -gustaf neumann
###

if {[apm_version_names_compare [ad_acs_version] 5.2] <= -1} {


ad_proc -public ::template::adp_include {
  {-uplevel 1}
  src
  varlist
} {
  return a the output of a tcl/adp pair as a string.  adp_level is
  set to the calling procedure so that pass by reference works.
  and example of using this is in the search indexer for various content
  types:
  <pre>
    bookshelf::book::get -book_id $book_id -array bookdata
    set body [template::adp_include /packages/bookshelf/lib/one-book \ 
                  [list &book "bookdata" base $base style feed]]
  </pre>

  The [list &book "bookdata" ...] tells adp_include to pass the book array by reference to the adp in
clude, where it is
  refered to via @book.field@.

  @param uplevel how far up the stack should the adp_level be set to
                 (default is the calling procedures level)
  @param src should be the path to the tcl/adp pair relative to the server root, as
             with the src attribute to the include tag.
  @param varlist a list of {key value key value ... } varlist can also be &var foo
             for things passed by reference (arrays and multirows)

  @return the string generated by the tcl/adp pair.

  @author Jeff Davis davis@xarg.net
  @creation-date 2004-06-02

  @see template::adp_parse
} {
  # set the stack frame at which the template is being parsed so that
  # other procedures can reference variables cleanly
  lappend ::template::parse_level [expr {[info level] - $uplevel}]

  set __adp_out [template::adp_parse [template::util::url_to_file $src] $varlist]

  # pop off parse level
  template::util::lpop ::template::parse_level

  return $__adp_out
}
}
# Local variables:
#    mode: tcl
#    tcl-indent-level: 2
#    indent-tabs-mode: nil
# End:
