return $res;\r
}\r
\r
- public static function updateHTML5Sources() {\r
+ public static function updateHTML5Sources($args = array(), $externals = true) {\r
$svn = new cubeCommandLine('svn');\r
$svn->setPath(CONVERTER_PATH);\r
$svn->setArg(null, 'up');\r
+ if (!$externals) {\r
+ $svn->setArg('ignore-externals');\r
+ }\r
$svn->setArg('r', file_get_contents(WS_COMPILE_ASSETS . '/_html5/PROD'));\r
- $svn->setArg(null, WS_COMPILE_ASSETS.'/_html5prod');\r
+ $svn->setArg(null, WS_COMPILE_ASSETS . '/_html5prod');\r
$svn->execute();\r
\r
fb($svn->commande);\r
}\r
if ($html5) {\r
fb(time(), 'Compile HTML5');\r
- $res.=$this->compileHTML5($book_id);\r
+ $res.=$this->compileHTML5($book_id,$book);\r
$this->touchCompile($book_id, 'html5');\r
}\r
if ($v1 || $v2) {\r
}\r
}\r
\r
- public function compileHTML5($book_id) {\r
- $htmlCompiler = new wsHTML5Compiler($book_id);\r
+ public function compileHTML5($book_id,$book) {\r
+ $htmlCompiler = new wsHTML5Compiler($book_id,$book->parametres->mobileLVersion);\r
$htmlCompiler->compile();\r
}\r
\r
__('Version HTML5') => 'html5',\r
__("Version HTML5 en images") => 'html5-images')\r
);\r
+ \r
+ $this->fields['mobileLVersion']= array('type' => 'combo', 'default' => 'stable', 'editable' => true, 'label' => __('Version logicielle'), 'grade' => 5,\r
+ 'datas' => array(__('Stable') => 'stable',\r
+ __('En cours de développement') => 'dev')\r
+ );\r
\r
$this->fields['mobileTransitions'] = array('type' => 'combo', 'default' => 'none', 'editable' => true, 'label' => __('Transitions entre les pages'), 'grade' => 5,\r
'datas' => array(__('Aucune transition') => 'none',\r
);\r
\r
$this->forms['mobile'] = array('label' => __('Version mobile'),\r
- 'fieldsnames' => array('mobileVersion', 'mobileTransitions'));\r
+ 'fieldsnames' => array('mobileLVersion','|','mobileVersion', 'mobileTransitions'));\r
\r
$this->fields['secureURL'] = array('type' => 'text', 'default' => 'http://', 'editable' => true, 'label' => __('URL de sécurisation'), 'grade' => 5, 'hint' => __('URL intérrogé pour vérifier si le visiteur à les droits pour consulter la publication'));\r
$this->fields['secureURLRedirect'] = array('type' => 'text', 'default' => 'http://', 'editable' => true, 'label' => __('Redirection'), 'grade' => 5, 'hint' => __("Si l'authentification échoue, redirection vers cette adresse"));\r
protected $backgroundsPrefix = 'p';
protected $svg = true;
protected $config = array();
+ protected $assets = '';
- function __construct($book_id) {
+ function __construct($book_id, $version = 'stable') {
global $core;
+ if ($version == 'stable') {
+ $this->assets = WS_COMPILE_ASSETS . '/_html5prod';
+ wsMaintenance::updateHTML5Sources(array(),false);
+ } else {
+ $this->assets = WS_COMPILE_ASSETS . '/_html5';
+ }
+
cubePHP::set_memory('4G');
if (trim($book_id) == '') {
}
// Copy style folder
- $from = WS_COMPILE_ASSETS . '/_html5/style';
+ $from = $this->assets . '/style';
$to = $this->vdir;
`cp -r $from $to`;
// Copy images folder
- $from = WS_COMPILE_ASSETS . '/_html5/images';
+ $from = $this->assets . '/images';
`cp -r $from $to`;
// Copy swf
- copy(WS_COMPILE_ASSETS . '/_html5/swf/video.swf', $this->vdir . '/swf/video.swf');
+ copy($this->assets . '/swf/video.swf', $this->vdir . '/swf/video.swf');
$this->writeImages();
$linksCSS = $this->writeLinks();
}
protected function writeIndex($numCSS) {
- $html = file_get_contents(WS_COMPILE_ASSETS . '/_html5/_index.html');
+ $html = file_get_contents($this->assets . '/_index.html');
$uhtml = $html;
$titre = $this->book->parametres->title;
file_put_contents($this->vdir . '/indext.html', $uhtml);
// Write widget html
- $whtml = file_get_contents(WS_COMPILE_ASSETS . '/_html5/widget.html');
+ $whtml = file_get_contents($this->assets . '/widget.html');
$script = '<script type="text/javascript" src="data/widget.js"></script>';
$style = '<link type="text/css" rel="stylesheet" href="style/widget.css">';
$langs = $daoLang->selectAll();
$traductions = (!count($this->book->traductions)) ? $lang->traductions : $this->book->traductions;
-
- $this->config->l10n=array();
- $this->config->l10n['default']=$traductions;
-
+
+ $this->config->l10n = array();
+ $this->config->l10n['default'] = $traductions;
+
foreach ($langs as $lang) {
- $this->config->l10n[$lang->lang_id]=$lang->traductions;
+ $this->config->l10n[$lang->lang_id] = $lang->traductions;
}
}
foreach ($finals as $jsfinal => $files) {
$mintime = 0;
- $minimized = WS_COMPILE_ASSETS . '/_html5/js/' . $jsfinal . '-min.js';
+ $minimized = $this->assets . '/js/' . $jsfinal . '-min.js';
if (file_exists($minimized)) {
$mintime = filemtime($minimized);
}
$reminimize = false;
foreach ($files as $file) {
- if (filemtime(WS_COMPILE_ASSETS . '/_html5/' . $file) > $mintime) {
+ if (filemtime($this->assets . '/' . $file) > $mintime) {
$reminimize = true;
break;
}
if ($reminimize) {
$js = '';
foreach ($files as $file) {
- $js.=file_get_contents(WS_COMPILE_ASSETS . '/_html5/' . $file);
+ $js.=file_get_contents($this->assets . '/' . $file);
$js.="\n\n";
}
$tmp = cubeFiles::tempnam();