Guest User

Untitled

a guest
Feb 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.85 KB | None | 0 0
  1.     sub CSSParseia()
  2.     {
  3.         my($self) = @_;
  4.         use Fcntl qw(:flock :seek);
  5.        
  6.         my $theme = "";
  7.         my $corPrincipal = "";
  8.         my $texturaPrincipal = "";# bg-zig.png
  9.        
  10.         my $dirTemplate="../css/ImovelManager.css";
  11.         my $template = $self->pega_fullpath($dirTemplate);
  12.         open(TEMPLATE,  $template) or die "Nao foi possivel abrir o template $template para leitura: $!";
  13.         $responder->{ContentType} = "text/css";
  14.         my @tp = <TEMPLATE>;
  15.         foreach my $linha (@tp)
  16.         {
  17.             $linha =~s/\n//;
  18.             $linha =~s/     //;
  19.             $linha =~s/    //;
  20.             $linha =~s/\|theme\|/$theme/;
  21.             if(length($theme)>0)
  22.             {
  23.                 $linha =~s/theme1/$theme/;
  24.             }
  25.             if(length($texturaPrincipal)>0)
  26.             {
  27.                 $linha =~s/bg\-zig\.png/$texturaPrincipal/;
  28.             }
  29.             if(length($corPrincipal)>0)
  30.             {
  31.                 $linha =~s/\#3e80b7/$corPrincipal/;
  32.             }
  33.                
  34.             print "$linha";
  35.         }
  36.         close TEMPLATE;
  37.     }
Add Comment
Please, Sign In to add comment