From: Peter T. <pet...@us...> - 2001-07-21 08:58:01
|
Update of /cvsroot/twiki/twiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv28865 Modified Files: TWiki.pm Log Message: Codev.TWikiTemplatingSystem Index: TWiki.pm =================================================================== RCS file: /cvsroot/twiki/twiki/lib/TWiki.pm,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -r1.55 -r1.56 *** TWiki.pm 2001/07/20 07:15:26 1.55 --- TWiki.pm 2001/07/21 08:57:58 1.56 *************** *** 78,86 **** ); - # Experimental persistent vars - modPerl issue? - use vars qw ( - %headerfooter - ); - # TWiki::Store config: use vars qw( --- 78,81 ---- *************** *** 99,103 **** # =========================== # TWiki version: ! $wikiversion = "20 Jul 2001"; # =========================== --- 94,98 ---- # =========================== # TWiki version: ! $wikiversion = "21 Jul 2001"; # =========================== *************** *** 149,154 **** $cgiQuery = $theQuery; - %headerfooter = (); - # Make %ENV safer for CGI if( $safeEnvPath ) { --- 144,147 ---- *************** *** 1189,1192 **** --- 1182,1195 ---- # ========================= + sub handleTmplP + { + my( $theParam ) = @_; + + $theParam = extractNameValuePair( $theParam ); + my $value = &TWiki::Store::handleTmplP( $theParam ); + return $value; + } + + # ========================= sub handleSpacedTopic { *************** *** 1205,1208 **** --- 1208,1213 ---- # $_[2] is web + $_[0] =~ s/%TMPL\:P{(.*?)}%/&handleTmplP($1)/geo; + $_[0] =~ s/%SEP%/&handleTmplP('"sep"')/geo; $_[0] =~ s/%HTTP_HOST%/&handleEnvVariable('HTTP_HOST')/geo; $_[0] =~ s/%REMOTE_ADDR%/&handleEnvVariable('REMOTE_ADDR')/geo; *************** *** 1249,1317 **** $_[0] =~ s/%SEARCH{(.*?)}%/&handleSearchWeb($1)/geo; $_[0] =~ s/%METASEARCH{(.*?)}%/&handleMetaSearch($1)/geo; - } - - sub readHeaderFooter - { - my( $theSkin ) = @_; - - if( ! %headerfooter ) { - my $tmpl = &TWiki::Store::readTemplate( "headerfooter", $theSkin ); - # Might want to have generalised variable rather than just sep - my( $header, $footerstart, $footerend, $sep ) = split /%SPLIT%/, $tmpl; - - $headerfooter{"header"} = $header; - $headerfooter{"footerstart"} = $footerstart; - $headerfooter{"footerend"} = $footerend; - $headerfooter{"sep"} = $sep; - } - } - - # ========================= - # Experimental routine for header/footer - sub handleHeader - { - my( $args, $theSkin ) = @_; - - readHeaderFooter( $theSkin ); - - my $action = extractNameValuePair( $args, "action" ); - my $description = extractNameValuePair( $args, "description" ); - - my $tmpl = $headerfooter{"header"}; #&TWiki::Store::readTemplate( "top" ); - $tmpl =~ s/%ACTION%/$action/go; - $tmpl =~ s/%DESCRIPTION%/$description/go; - - return $tmpl; - } - - # ========================= - # Experimental routine for header/footer - sub handleFooter - { - my( $start, $end, $theSkin ) = @_; - - readHeaderFooter( $theSkin ); - - my $ret = ""; - - if( ! $end ) { - $ret .= $headerfooter{"footerstart"}; - } - - if( ! $start ) { - $ret .= $headerfooter{"footerend"}; - } - - return $ret; - } - - # ========================= - # Experimental routine for header/footer - sub handleSep - { - my( $theSkin ) = @_; - - readHeaderFooter( $theSkin ); - return $headerfooter{"sep"}; } --- 1254,1257 ---- |