2000-12-18 21:09:56 +01:00
|
|
|
#!/usr/bin/perl
|
|
|
|
# Takes a simple text file of properties and turns them
|
|
|
|
# into a themes files.
|
|
|
|
# Use it like so:
|
|
|
|
# template2theme.pl < infile > outfile
|
|
|
|
# by Stephan
|
|
|
|
# $Id$
|
2002-05-30 23:13:07 +02:00
|
|
|
$wrap='$GLOBALS['phpgw_info']['theme']['_KEY_']= '_VAL_'';
|
2001-05-08 10:48:12 +02:00
|
|
|
print '<?\n';
|
|
|
|
print << 'EOF';
|
2000-12-18 21:09:56 +01:00
|
|
|
# phpGroupWare Theme file
|
|
|
|
EOF
|
|
|
|
|
|
|
|
while( $_ = <STDIN> ) {
|
|
|
|
next unless ( $_ =~ /^\s*(\w+)\s*=(.+)/ );
|
|
|
|
$k=$1;
|
|
|
|
$v=$2;
|
|
|
|
my $foo = $wrap;
|
|
|
|
$foo =~ s/_KEY_/$k/;
|
|
|
|
$foo =~ s/_VAL_/$v/;
|
2001-05-08 10:48:12 +02:00
|
|
|
print '$foo;\n';
|
2000-12-18 21:09:56 +01:00
|
|
|
}
|
2001-05-08 10:48:12 +02:00
|
|
|
print '?>';
|