> >On Wednesday 21 November 2001 01:48 pm, darren chamberlain wrote:
> >
> > darren> It seems to me that the simplest plugin looks something like:
> >
.. snip code ...
> >Randal L. Schwartz <[EMAIL PROTECTED]> said something to this effect on
> > This all seems like far too much work. Why not simply
> > add ENV => \%ENV to your variables? Then ENV.foo is $ENV{foo}
> > and ENV.foo = bar is $ENV{foo} = "bar".
> >
> > Or am I missing something?
>
> You're right, it is too much work. But I think the poster of the
> original message (sorry, lost it) said that he didn't want to
> rewrite his called to $t->process, and wanted a plugin approach.
>
> I might have made that up, though...
>
> (darren)
First of all thanks for the insight into how such a plugin could be
implemented. I actually used a mixture of both your responses which made the
module all of 20 lines.
And yes, I didn't want to have to modify the numerous .cgi files to add \%ENV
to my template vars and remember to put it into all future .cgi files.
Basically I only needed $ENV{REMOTE_USER} in my header.tpl which uses it
within some Javascript there but this header is [% INCLUDE %]'d into every
other main template file. I figured a plugin would take a few minutes to
write and all I'd have to do in header.tpl is [% USE ENV %] and place [%
ENV.REMOTE_USER %] where I needed it.
Shay