From: Davide Franco Date: Thu, 17 Mar 2011 18:39:37 +0000 (+0100) Subject: bacula-web: Removed utils folder and his content from git X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2e3dadb946d3b5c7afcb0e620b7eff617171e381;p=bacula%2Fbacula bacula-web: Removed utils folder and his content from git - Removed the folder utils and his content (already in external_packages/smarty-gettext folder --- diff --git a/gui/bacula-web/utils/tsmarty2c.php b/gui/bacula-web/utils/tsmarty2c.php deleted file mode 100755 index 32cb89fe0c..0000000000 --- a/gui/bacula-web/utils/tsmarty2c.php +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/php -qn - <..> > smarty.c - * - * If a parameter is a directory, the template files within will be parsed. - * - * @package smarty_gettext - * @version 0.9 - * @link http://www.boom.org.il/smarty/gettext/ - * @author Sagi Bashari - * @copyright 2004 Sagi Bashari - */ - -// smarty open tag -$ldq = preg_quote('{'); - -// smarty close tag -$rdq = preg_quote('}'); - -// smarty command -$cmd = preg_quote('t'); - -// extensions of smarty files, used when going through a directory -$extensions = array('tpl'); - -// "fix" string - strip slashes, escape and convert new lines to \n -function fs($str) -{ - $str = stripslashes($str); - $str = str_replace('"', '\"', $str); - $str = str_replace("\n", '\n', $str); - return $str; -} - -// rips gettext strings from $file and prints them in C format -function do_file($file) -{ - $content = @file_get_contents($file); - - if (empty($content)) { - return; - } - - global $ldq, $rdq, $cmd; - - preg_match_all("/{$ldq}\s*({$cmd})\s*([^{$rdq}]*){$rdq}([^{$ldq}]*){$ldq}\/\\1{$rdq}/", $content, $matches); - - for ($i=0; $i < count($matches[0]); $i++) { - if (preg_match('/plural\s*=\s*["\']?\s*(.[^\"\']*)\s*["\']?/', $matches[2][$i], $match)) { - print 'ngettext("'.fs($matches[3][$i]).'","'.fs($match[1]).'",x);'."\n"; - } else { - print 'gettext("'.fs($matches[3][$i]).'");'."\n"; - } - } -} - -// go through a directory -function do_dir($dir) -{ - $d = dir($dir); - - while (false !== ($entry = $d->read())) { - if ($entry == '.' || $entry == '..') { - continue; - } - - $entry = $dir.'/'.$entry; - - if (is_dir($entry)) { // if a directory, go through it - do_dir($entry); - } else { // if file, parse only if extension is matched - $pi = pathinfo($entry); - - if (in_array($pi['extension'], $GLOBALS['extensions'])) { - do_file($entry); - } - } - } - - $d->close(); -} - -for ($ac=1; $ac < $_SERVER['argc']; $ac++) { - if (is_dir($_SERVER['argv'][$ac])) { // go through directory - do_dir($_SERVER['argv'][$ac]); - } else { // do file - do_file($_SERVER['argv'][$ac]); - } -} - -?>