aboutsummaryrefslogtreecommitdiffstats
path: root/tools/convert_template_to_2.1.pl
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2013-08-20 17:10:56 +0000
committerplegall <plg@piwigo.org>2013-08-20 17:10:56 +0000
commit6f2fc71ffadb049855b2ff2c9fc0a1952b736484 (patch)
treedd40e49beddde1c22be2a939b8aa7f71e9d8317a /tools/convert_template_to_2.1.pl
parent6b73cb58b78a9b23d71f9843ee3fa176058a521e (diff)
remove obsolete/useless scripts
git-svn-id: http://piwigo.org/svn/trunk@24201 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--tools/convert_template_to_2.1.pl48
1 files changed, 0 insertions, 48 deletions
diff --git a/tools/convert_template_to_2.1.pl b/tools/convert_template_to_2.1.pl
deleted file mode 100644
index a838e8f8b..000000000
--- a/tools/convert_template_to_2.1.pl
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/perl
-
-# perl tools/convert_template_to_2.1.pl /path/to/tpl/files/directory
-
-use strict;
-use warnings;
-
-use File::Find;
-
-my $base_dir = $ARGV[0];
-
-# load the replacements
-my @file_codes = qw/upgrade install admin common/;
-my %replace_by = ();
-foreach my $file_code (@file_codes) {
- open(my $ifh_rep, '<language/templates/'.$file_code.'.lang.php');
- while (<$ifh_rep>) {
- if (m/^\$lang\['(.*)'\] \s* = \s* (['"])(.*)\2;/x) {
- if ($1 ne $3 and length($1) > 0) {
- $replace_by{$1} = $3;
- }
- }
- }
-}
-# use Data::Dumper; print Dumper(\%replace_by); exit();
-
-find(\&replace_keys, $base_dir);
-
-sub replace_keys {
- if ($File::Find::name !~ m/tpl$/) {
- return 0;
- }
-
- my $file_content = '';
- open(my $fhi, '<', $File::Find::name);
- while (<$fhi>) {
- foreach my $from (keys %replace_by) {
- my $to = $replace_by{$from};
- s/{'$from'\|\@translate/{'$to'|\@translate/g;
- }
- $file_content.= $_;
- }
- close($fhi);
-
- open(my $fho, '>', $File::Find::name);
- print {$fho} $file_content;
- close($fho);
-}