return;\r
}\r
\r
+ fb(time(), 'start making package');\r
$version = 'html';\r
if ($book->parametres->version == 1) {\r
$version = 'v1';\r
}\r
if (stristr($server, 'phonegap')) {\r
$version = 'phonegap';\r
+ $packager = new wsPackagerPhonegap($book_id, null, true, false);\r
+ $package = $packager->makePackage(false);\r
+ } else {\r
+ $package = wsPackager::package($book_id, $version, false);\r
}\r
\r
- fb(time(), 'start making package');\r
- $package = wsPackager::package($book_id, $version, false);\r
-\r
fb(time(), 'start transfert');\r
if ($server == 'references') {\r
$root = '/home/fluidbook/dev/references';\r
$res .= commonPage::bf();\r
\r
$res .= commonPage::bh();\r
- $res .= cubeLang::translationForm(array(PLAYER_SOURCES, WS_COMPILE_ASSETS . '/_html5/js'), $lang_id, null, 'liste', array(), '<a href="#" class="submit">' . $core->typo->Ajouter(__('Enregistrer')) . '</a>', $lang->traductions);\r
+ $res .= cubeLang::translationForm(array(PLAYER_SOURCES, WS_COMPILE_ASSETS . '/_html5'), $lang_id, null, 'liste', array(), '<a href="#" class="submit">' . $core->typo->Ajouter(__('Enregistrer')) . '</a>', $lang->traductions);\r
$res .= commonPage::bf();\r
$res .= '</form>';\r
return $res;\r
if (is_dir($source)) {\r
continue;\r
}\r
- copy($source, $localPath);\r
+ $this->copy($source, $localPath);\r
}\r
}\r
\r
$cp = new cubeCommandLine('cp');\r
$cp->setPath(CONVERTER_PATH);\r
$cp->setArg('r');\r
+ $cp->setArg('p');\r
$cp->setArg(null, $workingDir . 'media');\r
$cp->setArg(null, $finalDir . 'data');\r
$cp->execute();\r
return $res;\r
}\r
\r
+ public function copy($source, $dest) {\r
+ copy($source, $dest);\r
+ touch($dest, filemtime($dest));\r
+ }\r
+\r
public function compileAir($book_id) {\r
$compilerDir = WS_BOOKS . '/air/' . $book_id . '/compiler';\r
$finalDir = WS_BOOKS . '/air/' . $book_id . '/';\r
$replace = WS_BOOKS . '/working/' . $book->book_id . '/' . $book->parametres->pdfReplace;\r
if (file_exists($replace)) {\r
if (!file_exists($finalPDF) || filemtime($finalPDF) < filemtime($replace) || filesize($finalPDF) != filesize($replace)) {\r
- copy($replace, $finalPDF);\r
+ $this->copy($replace, $finalPDF);\r
}\r
return;\r
}\r
}\r
\r
if ($original) {\r
- copy(WS_DOCS . '/' . $firstDoc . '/crop.pdf', $finalPDF);\r
+ $this->copy(WS_DOCS . '/' . $firstDoc . '/crop.pdf', $finalPDF);\r
return;\r
}\r
\r
$alldocs = array_keys($pdfList);\r
$doc = array_pop($alldocs);\r
if ($nb_pages[$doc] == $ranges[0]['end']) {\r
- copy($doc, $finalPDF);\r
+ $this->copy($doc, $finalPDF);\r
return;\r
}\r
}\r
\r
$cached = WS_BOOKS . '/pdf/' . $hash . '.pdf';\r
if (file_exists($cached)) {\r
- copy($cached, $finalPDF);\r
+ $this->copy($cached, $finalPDF);\r
} else {\r
$pdftk = new cubeCommandLine('pdftk');\r
$pdftk->setPath(CONVERTER_PATH);\r
$pdftk->setManualArg($args);\r
$pdftk->execute();\r
- copy($finalPDF, $cached);\r
+ $this->copy($finalPDF, $cached);\r
}\r
}\r
\r
\r
$this->fields['mobilePlugins'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Plugin'), 'grade' => 5);\r
\r
+ $this->fields['mobileVideosPath'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Chemin vers les vidéos'), 'grade' => 5);\r
+\r
$this->forms['mobile'] = array('label' => __('Version mobile'),\r
- 'fieldsnames' => array('mobileLVersion', 'mobileVersion', '|', 'mobileTransitions', 'mobileTransitionDuration', '|', 'mobileIconVector', 'mobilePlugins'));\r
+ 'fieldsnames' => array('mobileLVersion', 'mobileVersion', '|', 'mobileTransitions', 'mobileTransitionDuration', '|', 'mobileIconVector', 'mobilePlugins', '|', 'mobileVideosPath'));\r
\r
$this->fields['phonegapId'] = array('type' => 'text', 'default' => 'com.fluidbook.phonegap.$id', 'editable' => true, 'label' => __("Identifiant de l'identifiant"), 'grade' => 5, 'hint' => __('De la forme') . ' com.fluidbook.phonegap.xxxxx');\r
$this->fields['phonegapVersion'] = array('type' => 'text', 'default' => '1.0.0', 'editable' => true, 'label' => __("Version de l'application"), 'grade' => 5, 'hint' => __('De la forme') . ' 1.2.3');\r
}
}
- protected static $resolutions = array(150, 36);
+ protected static $resolutions = array(150);
protected static $uaPrefixes = array('-moz-', '-webkit-', '-o-', '-ms-', '');
public $jsFiles = array(
'js/libs/fix/ios-orientation.js',
function __construct($book_id, $version = 'stable', $phonegap = false, $dir = null) {
global $core;
+ $this->videoPath = $videoPath;
+ $this->makeResources = $resources;
if ($version == 'stable') {
$this->assets = WS_COMPILE_ASSETS . '/_html5prod';
wsMaintenance::updateHTML5Sources(array(), false);
foreach ($this->jsFiles as $js) {
$scripts[] = '<script type="text/javascript" src="' . $js . '"></script>';
}
+ foreach ($this->pluginJs as $js) {
+ $scripts[] = '<script type="text/javascript" src="' . $js . '"></script>';
+ }
$scripts[] = '<script type="text/javascript" src="data/datas.js"></script>';
$script = implode("\n\t\t", $scripts);
}
public function copyLinkFile($source, $dest, $video = false) {
+ if ($video && $this->book->parametres->mobileVideosPath != '') {
+ return;
+ }
+
$origDir = WS_BOOKS . '/working/' . $this->book_id . '/';
$types = $this->getVideosFormats();
if ($video) {
}
}
+
if (!is_array($source)) {
$source = array($source);
}
class wsPackagerPhonegap extends wsPackager {
protected $resources = '';
+ protected $makeResources = true;
- public function __construct($book_id, $vdir = null, $whole = true) {
+ public function __construct($book_id, $vdir = null, $whole = true, $makeResources = true) {
+ $this->makeResources = $makeResources;
parent::__construct($book_id, $vdir, $whole);
$this->version = 'phonegap';
}
unlink($this->vdir . '/widget.html');
unlink($this->vdir . '/cache.appcache');
- $this->resources = $this->vdir . '/Resources';
- $this->makeResources();
+ if ($this->makeResources) {
+ $this->resources = $this->vdir . '/Resources';
+ $this->makeResources();
+ }
}
protected function makeResources() {