[Templates] EXPOSE_BLOCKS in Apache::Template environment

darren chamberlain dlc@users.sourceforge.net
Tue, 3 Sep 2002 08:56:08 -0400


--ibTvN161/egqYuK8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

* Dave Cash <dave@gnofn.org> [2002-09-02 19:26]:
> There doesn't appear to be any way to enable the EXPOSE_BLOCKS
> configuration option from Apache::Template.  I would expect
> something like TT2ExposeBlocks, but I don't see it.  Is there some
> way in a pure Apache::Template context to get the EXPOSE_BLOCKS
> configuration option set to a true value?

The attached patch (against Apache::Template 0.06) should make it possible.  

(darren)

-- 
To ensure privacy and data integrity this message has been
encrypted using dual rounds of ROT-13 encryption.

--ibTvN161/egqYuK8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="Apache-Template.dlc.EXPOSE_BLOCKS.diff"

diff -cdNpr Apache-Template-0.06.orig/Makefile.PL Apache-Template-0.06/Makefile.PL
*** Apache-Template-0.06.orig/Makefile.PL	Wed Sep 12 04:41:11 2001
--- Apache-Template-0.06/Makefile.PL	Tue Sep  3 08:52:05 2002
*************** my @directives = (
*** 61,66 ****
--- 61,71 ----
  	args_how     => 'TAKE1',
  	req_override => 'RSRC_CONF',
      },
+     {	name         => 'TT2ExposeBlocks',
+ 	errmsg       => 'make blocks visible as pseudo-files',
+ 	args_how     => 'FLAG',
+ 	req_override => 'RSRC_CONF',
+     },
  
      #-- service template options --
      {	name         => 'TT2PreProcess',
diff -cdNpr Apache-Template-0.06.orig/lib/Apache/Template.pm Apache-Template-0.06/lib/Apache/Template.pm
*** Apache-Template-0.06.orig/lib/Apache/Template.pm	Tue Jan 22 09:34:41 2002
--- Apache-Template-0.06/lib/Apache/Template.pm	Tue Sep  3 08:54:20 2002
*************** sub TT2ServiceModule($$$) {
*** 364,369 ****
--- 364,377 ----
      $cfg->{ SERVICE_MODULE } = $module;
  }
  
+ #------------------------------------------------------------------------
+ # TT2ExposeBlocks   On          # make blocks visible as pseudo-files
+ #------------------------------------------------------------------------
+ 
+ sub TT2ExposeBlocks($$$) {
+     my ($cfg, $parms, $expose) = @_;
+     $cfg->{ EXPOSE_BLOCKS } = $expose;
+ }
  
  
  #========================================================================

--ibTvN161/egqYuK8--