| 28 |
case 'catalogs': |
case 'catalogs': |
| 29 |
default: |
default: |
| 30 |
$this->updatecatalog(); |
$this->updatecatalog(); |
|
#return $controller->forward('edit'); |
|
| 31 |
return $controller->redirect('index', 'catalogs'); |
return $controller->redirect('index', 'catalogs'); |
| 32 |
break; |
break; |
| 33 |
} |
} |
| 43 |
$comments = trim($_POST['comments']); |
$comments = trim($_POST['comments']); |
| 44 |
$headers = $_POST['headers']; |
$headers = $_POST['headers']; |
| 45 |
|
|
|
|
|
| 46 |
foreach ($_POST as $key => $value) { |
foreach ($_POST as $key => $value) { |
| 47 |
if (preg_match('/^([a-z]+)[_]?([0-9]+)?_([0-9]+)$/', $key, $matches)) { |
if (preg_match('/^([a-z]+)[_]?([0-9]+)?_([0-9]+)$/', $key, $matches)) { |
| 48 |
switch ($matches[1]) |
switch ($matches[1]) |
| 58 |
} |
} |
| 59 |
break; |
break; |
| 60 |
case 'fuzzy': |
case 'fuzzy': |
| 61 |
$is_fuzzy[$matches[3]] = $value; |
$is_fuzzy[$matches[3]] = $value == 'true' ? true : false; |
| 62 |
break; |
break; |
| 63 |
} |
} |
| 64 |
} |
} |
| 88 |
foreach ($msgstr as $index => $string) { |
foreach ($msgstr as $index => $string) { |
| 89 |
$catalog->strings[$index]->setmsgstr($string); |
$catalog->strings[$index]->setmsgstr($string); |
| 90 |
if (isset($is_fuzzy[$index])) { |
if (isset($is_fuzzy[$index])) { |
| 91 |
$catalog->strings[$index]->setfuzzy(true); |
$catalog->strings[$index]->setfuzzy($is_fuzzy[$index]); |
| 92 |
} |
} |
| 93 |
} |
} |
| 94 |
$catalog->save(); |
$catalog->save(); |
| 98 |
} |
} |
| 99 |
|
|
| 100 |
if ($add_to_dictionary) { |
if ($add_to_dictionary) { |
| 101 |
|
if (!is_dir("$textdomain/glossary/")) { |
| 102 |
|
mkdir("$textdomain/glossary/"); |
| 103 |
|
} |
| 104 |
$admin = new PHPGettextAdmin(); |
$admin = new PHPGettextAdmin(); |
| 105 |
if (!file_exists("$textdomain/$lang.po")) { |
if (!file_exists("$textdomain/glossary/$lang.po")) { |
| 106 |
set_time_limit(360); |
set_time_limit(360); |
| 107 |
$cmd = "msgcat -o $textdomain/$lang.po $textdomain/$lang/$domain.po"; |
$cmd = "msgcat --use-first -o $textdomain/glossary/$lang.po $textdomain/$lang/$domain.po"; |
| 108 |
$admin->execute($cmd); |
$admin->execute($cmd); |
| 109 |
} else { |
} else { |
| 110 |
copy("$textdomain/$lang.po", "$textdomain/$lang.pot"); |
copy("$textdomain/glossary/$lang.po", "$textdomain/glossary/$lang.pot"); |
| 111 |
$cmd = "msgcat -o $textdomain/$lang.po $textdomain/$lang.pot $textdomain/$lang/$domain.po"; |
$cmd = "msgcat --use-first -o $textdomain/glossary/$lang.po $textdomain/glossary/$lang.pot $textdomain/$lang/$domain.po"; |
| 112 |
$admin->execute($cmd); |
$admin->execute($cmd); |
| 113 |
unlink("$textdomain/$lang.pot"); |
unlink("$textdomain/glossary/$lang.pot"); |
| 114 |
} |
} |
| 115 |
} |
} |
| 116 |
$language = mamboLanguage::getInstance($lang); |
$language = mamboLanguage::getInstance($lang); |