Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Piatok, 19. apríl 2024

Súbor: [Platon] / iotta / Iotta / Filter / Template.pm (stiahnutie)

Revízia 1.1.1.1, Sun Feb 16 15:48:12 2003 UTC (21 years, 2 months ago) by yenar


Zmeny od 1.1: +0 -0 [lines]

initial import of iotta into platon cvs

package Iotta::Filter::Template;
use base Iotta::Elem;
use strict;
#our @ISA = ("Iotta::Elem");

# XXX make template get method configurable

sub filter {
    my $self = shift;
    my $in = shift;
    my $out = "";
    open TPL, $self->templf;
    $out .= $_ while (<TPL>);
    close TPL;
    $out =~ s/\$\$TEMPLATE-REPLACE\$\$/$in/g;
    return $out;
}

sub run {
    my $s = shift;
    my $meta = shift;
    my $data = shift;
    my $ndata = $s->filter ($data);
    print STDERR "  template...\n";
    $s->next->run($meta, $ndata) if ($s->next);
}

sub setup {
    my $self = shift;
    my $o = shift;
    $self->templf ($$o{template});
}

sub initialize {
    my $self = shift;
    $self->SUPER::initialize (@_);
    $self->{templf}="";
}
1;

Platon Group <platon@platon.sk> http://platon.sk/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok