<?php\r
+\r
class wsLang extends cubeMetier {\r
+\r
public static $idtonew = array('overview' => 1,\r
'normal view' => 2,\r
'zoom in' => 3,\r
'no bookmarks added' => 62,\r
'functionality dont work when in fullscreen mode' => 63,\r
"you don't have any bookmark" => 64);\r
-\r
protected $lang_id;\r
protected $font;\r
protected $charset;\r
protected $traductions;\r
protected $nsis;\r
\r
- public static function getTraductionWithId($traductions)\r
- {\r
+ public static function getTraductionWithId($traductions) {\r
$res = array();\r
- foreach($traductions as $k => $v) {\r
+ foreach ($traductions as $k => $v) {\r
$res[array_search($k, self::$idtonew)] = $v;\r
}\r
return $res;\r
}\r
\r
- public static function checkTranslations($traductions)\r
- {\r
- foreach($traductions as $k => $v) {\r
- if (is_int($k) || intval($k)>0) {\r
+ public static function getTraductionsForV1($traductions) {\r
+ $res = array();\r
+ $new = 100;\r
+ foreach ($traductions as $k => $v) {\r
+ if (isset(self::$idtonew[$k])) {\r
+ $res[self::$idtonew[$k]] = $v;\r
+ } else {\r
+ $res[$new] = $v;\r
+ $new++;\r
+ }\r
+ }\r
+ ksort($res);\r
+ return $res;\r
+ }\r
+\r
+ public static function checkTranslations($traductions) {\r
+ foreach ($traductions as $k => $v) {\r
+ if (is_int($k) || intval($k) > 0) {\r
$traductions = wsLang::getTraductionWithId($traductions);\r
}\r
break;\r
}\r
return $traductions;\r
}\r
+\r
+ public function getV1XML() {\r
+ $xml = simplexml_load_string('<?xml version="1.0" encoding="UTF-8"?><movie />');\r
+\r
+ $traductions = self::getTraductionsForV1($this->traductions);\r
+ foreach ($traductions as $text) {\r
+ $xml->addChild('tradText', htmlspecialchars($text));\r
+ }\r
+ return $xml;\r
+ }\r
+\r
}\r
\r
?>
\ No newline at end of file
$this->copyLinks();
$this->copyConfig();
$this->copyTheme();
+ $this->copyLang();
}
protected function copyThumbnails() {
}
+ protected function copyLang() {
+ global $core;
+ $mapping = wsLang::$idtonew;
+
+ $daoLang = new wsDAOLang($core->con);
+ $lang = $daoLang->selectById($this->book->lang);
+
+ $xml = $lang->getV1XML();
+ file_put_contents($this->vdir . '/data/lang.xml', $xml->asXML());
+ }
+
protected function _copyWorkingFile($file) {
$src = $this->workingDir . '/' . $file;
if (file_exists($src) && is_file($src)) {