protected $size;
public function __construct($book_id, $vdir, $whole) {
+ global $core;
+
parent::__construct($book_id, $vdir, $whole);
$this->version = 'v1';
$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);
$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());
}
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);
}
}