]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 6 Jul 2012 17:31:54 +0000 (17:31 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 6 Jul 2012 17:31:54 +0000 (17:31 +0000)
inc/ws/Controlleur/class.ws.maintenance.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Util/html5/class.ws.html5.compiler.php

index 994c58deb2de026f1768aa5fde4c62f88bccfab8..14e3f5f5549895b0a9e2531710869e91ac8ad7bd 100644 (file)
@@ -735,12 +735,15 @@ class wsMaintenance {
                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
index c545ef2716bd8eab548ffbf4e62e91a262eaf740..f6a378db560c737f5eabeb38ddb30ede721595ae 100644 (file)
@@ -829,7 +829,7 @@ class wsDAOBook extends commonDAO {
                }\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
@@ -1263,8 +1263,8 @@ class wsDAOBook extends commonDAO {
                }\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
index f5ca4f370abbc12998410fe30886d9a27aa849db..34a1c66c13799addd968662df5d26d243a74605b 100644 (file)
@@ -222,6 +222,11 @@ class wsBookParametres extends wsParametres {
                                __('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
@@ -230,7 +235,7 @@ class wsBookParametres extends wsParametres {
                );\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
index 0bbc6008c4abaa914c2efb6150cc4fb833880023..7b4b2cbd49d3c4f23fa2152071600323bc0a0174 100644 (file)
@@ -79,10 +79,18 @@ class wsHTML5Compiler {
        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) == '') {
@@ -167,16 +175,16 @@ class wsHTML5Compiler {
                }
 
                // 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();
@@ -271,7 +279,7 @@ class wsHTML5Compiler {
        }
 
        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;
@@ -342,7 +350,7 @@ class wsHTML5Compiler {
                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">';
@@ -360,12 +368,12 @@ class wsHTML5Compiler {
                $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;
                }
        }
 
@@ -408,13 +416,13 @@ class wsHTML5Compiler {
 
                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;
                                }
@@ -423,7 +431,7 @@ class wsHTML5Compiler {
                        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();