]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 30 Jan 2012 10:41:39 +0000 (10:41 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 30 Jan 2012 10:41:39 +0000 (10:41 +0000)
inc/ws/Util/packager/class.ws.packager.v1.php

index 1438a322cd6eb7ba8272e58627bd9a4fbd184522..0ca65aeb1bc4bda9d1c732ea44e78d41091f8161 100644 (file)
@@ -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('<?xml version="1.0" encoding="UTF-8" ?><extras>' . $this->book->parametres->extras . '</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);
                }
        }