From 8d65c5c4ced8493625607079946d4db479251617 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 30 Jan 2012 10:41:39 +0000 Subject: [PATCH] --- inc/ws/Util/packager/class.ws.packager.v1.php | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/inc/ws/Util/packager/class.ws.packager.v1.php b/inc/ws/Util/packager/class.ws.packager.v1.php index 1438a322c..0ca65aeb1 100644 --- a/inc/ws/Util/packager/class.ws.packager.v1.php +++ b/inc/ws/Util/packager/class.ws.packager.v1.php @@ -5,6 +5,8 @@ class wsPackagerV1 extends wsPackagerHTML { protected $size; public function __construct($book_id, $vdir, $whole) { + global $core; + parent::__construct($book_id, $vdir, $whole); $this->version = 'v1'; @@ -169,6 +171,13 @@ class wsPackagerV1 extends wsPackagerHTML { $allParams = array_merge($allParams, $signature); $allParams['firstPageNr'] = $this->__virtualToPhysical('1') - 1; + $xtra = simplexml_load_string('' . $this->book->parametres->extras . ''); + foreach ($xtra as $xt) { + $k = $xt->getName(); + $v = (string) $xt; + $allParams[$k] = $v; + } + foreach ($allParams as $k => $v) { if ((stristr($k, 'color') || stristr($k, 'couleur')) && strlen($v) == 8) { $v = substr($v, 2); @@ -195,6 +204,10 @@ class wsPackagerV1 extends wsPackagerHTML { $colors->addChild('color', '0x' . $allParams['couleurB']); $colors->addChild('color', '0x' . $allParams['couleurS']); + if ($this->book->parametres->v1SWF != '') { + $this->_copyWorkingFile($this->book->parametres->v1SWF, $this->vdir); + } + file_put_contents($this->vdir . '/data/data.xml', $xml->asXML()); } @@ -234,10 +247,15 @@ class wsPackagerV1 extends wsPackagerHTML { file_put_contents($this->vdir . '/data/lang.xml', $xml->asXML()); } - protected function _copyWorkingFile($file) { + protected function _copyWorkingFile($file, $dir = null) { + + if (is_null($dir)) { + $dir = $this->workingDir . '/data/'; + } + $src = $this->workingDir . '/' . $file; if (file_exists($src) && is_file($src)) { - copy($src, $this->vdir . '/data/' . $file); + copy($src, $dir . $file); } } -- 2.39.5