$ignore = split(',', $ignore);
}
+ if ($this->book->parametres->externalChaptersHTML != '') {
+ $d = $this->unzipFile($this->book->parametres->externalChaptersHTML, false, 'data/chapters/');
+ $meta = $this->getConfigZIP($d['dir']);
+ $this->config->externalChaptersSize = new stdClass();
+ $this->config->externalChaptersSize->width = $meta['width'];
+ $this->config->externalChaptersSize->height = $meta['height'];
+ $this->vdir->copyDirectory($d['dir'], $d['fdir']);
+ }
+
$daoDoc = new wsDAODocument($core->con);
$daoDoc->getLinksAndRulers($this->book_id, $links, $rulers);
return array('dir' => $dir, 'fdir' => $fdir);
}
+ public function getConfigZIP($d) {
+ $res = array('width' => 0, 'height' => 0);
+ if (file_exists($d . '/index.html')) {
+ $doc = new DOMDocument();
+ $doc->loadHTMLFile($d . '/index.html');
+ $xpath = new DOMXPath($doc);
+ $c = $xpath->query("//canvas");
+ foreach ($c as $canvas) {
+ /* @var $canvas DOMElement */
+ $res['width'] = intval((string)$canvas->getAttribute('width'));
+ $res['height'] = intval((string)$canvas->getAttribute('height'));
+ }
+
+ $r = array('html' => 'index.html', 'inject' => array(), 'injectcss' => array(), 'injectjs' => array());
+ } else {
+ $r = array('html' => false, 'inject' => array(file_get_contents($d . '/init.js')), 'injectcss' => array('multimedia.css'), 'injectjs' => array('multimedia.js'));
+ }
+ $res = array_merge($res, $r);
+ return $res;
+ }
+
}
}
public function getConfigZIP($d) {
- $res = array('width' => $this->video_width, 'height' => $this->video_height);
- if (file_exists($d . '/index.html')) {
- $doc = new DOMDocument();
- $doc->loadHTMLFile($d . '/index.html');
- $xpath = new DOMXPath($doc);
- $c = $xpath->query("//canvas");
- foreach ($c as $canvas) {
- /* @var $canvas DOMElement */
- $res['width'] = intval((string)$canvas->getAttribute('width'));
- $res['height'] = intval((string)$canvas->getAttribute('height'));
- }
-
- $r = array('html' => 'index.html', 'inject' => array(), 'injectcss' => array(), 'injectjs' => array());
- } else {
- $r = array('html' => false, 'inject' => array(file_get_contents($d . '/init.js')), 'injectcss' => array('multimedia.css'), 'injectjs' => array('multimedia.js'));
- }
- $res = array_merge($res, $r);
- return $res;
+ return $this->compiler->getConfigZIP($d);
}
public function getConfigHTML($d, $html) {