]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 12 Nov 2012 15:03:32 +0000 (15:03 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 12 Nov 2012 15:03:32 +0000 (15:03 +0000)
.htaccess
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Util/html5/class.ws.html5.compiler.php
inc/ws/Util/packager/class.ws.packager.phonegap.php

index 6efd2ec643eb596c7ec916cd3c0b73abf7f53b3c..32dcb4bc4fa74b68ca115763a77f83d6e752a7f3 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -62,5 +62,7 @@ AddCharset UTF-8 log
 \r
        RewriteRule ^viewerht/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/js/(.+)$ fluidbook/compile/_html5/js/$4 [L]      \r
        RewriteRule ^viewerht/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/(.+)$ fluidbook/books/html5/$1/$4 [L]\r
+\r
+       RewriteRule ^viewerh([ai])/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/(.+)$ fluidbook/books/html5$1/$2/$5 [L]\r
        \r
 </IfModule>
\ No newline at end of file
index 653257fd564d324b1c437735362acbf80dcadd48..89924e9ef77a41fa43f24eb8cc3b13a13df122f4 100644 (file)
@@ -716,7 +716,7 @@ html{height:100%}' . "\n";
        public static function viewerha($args) {\r
                global $core;\r
 \r
-               commonDroits::min(5);\r
+               \r
                $args = cubePage::getArgs($args);\r
                if (!isset($args[1])) {\r
                        $args[1] = '';\r
index 5558af0e357935cefa348e750d9425a51dd53fe8..cf31c311b334d9987e31b7c1503ca4ca1c0df19a 100644 (file)
@@ -793,8 +793,13 @@ class wsDAOBook extends commonDAO {
        }\r
 \r
        public function compileTemp($book_id, $version, $dir) {\r
-               if ($version == 'ha') {\r
-                       $packager = new wsPackagerPhonegap($book_id, $dir, true, false, 'android');\r
+               if ($version == 'ha' || $version == 'hi') {\r
+                       if ($version == 'ha') {\r
+                               $os = 'android';\r
+                       } elseif ($version == 'hi') {\r
+                               $os = 'ios';\r
+                       }\r
+                       $packager = new wsPackagerPhonegap($book_id, $dir, false, true, $os);\r
                        $packager->makePackage(false);\r
                }\r
        }\r
index dfff4ae2da35ce3d4e8faecf3c01b1c27f465c0e..c81d682f9de389d3113b7c0ac3c97d57928fe657 100644 (file)
@@ -292,7 +292,7 @@ class wsHTML5Compiler {
                } elseif ($this->phonegap == 'ios') {
                        $res = array('mp4');
                } else if ($this->phonegap == 'android') {
-                       $res = array('ogv', 'webm');
+                       $res = array('webm');
                }
 
                if ($poster) {
@@ -302,6 +302,10 @@ class wsHTML5Compiler {
        }
 
        protected function writeCache() {
+               if ($this->phonegap) {
+                       return;
+               }
+
                $videosExtensions = $this->getVideosFormats(false);
                foreach ($videosExtensions as $e) {
                        $videos[$e] = array();
@@ -650,7 +654,6 @@ class wsHTML5Compiler {
        }
 
        protected function writeConfig() {
-
                $this->config->numerotation = explode(',', $this->book->numerotation);
                $this->config->id = $this->book->book_id;
                $this->config->cacheDate = TIME;
@@ -661,6 +664,7 @@ class wsHTML5Compiler {
                $this->config->chapters = $this->book->chapters;
                $this->config->coquilletteBack = $this->colorToCSS($this->theme->parametres->couleurA);
                $this->config->coquilletteFront = $this->colorToCSS($this->theme->parametres->arrowsColor);
+               $this->config->videoFormats = $this->getVideosFormats(false);
                foreach ($this->additionalConfig as $k => $v) {
                        $this->config->$k = $v;
                }
index d6afc211fe4db05e209f4a9253c1069468c45306..c99c431319d4ed358ebdb077a62fe36bda1df1b2 100644 (file)
@@ -4,9 +4,10 @@ class wsPackagerPhonegap extends wsPackager {
 
        protected $resources = '';
        protected $makeResources = true;
-       protected $os = 'ios';
+       protected $os = 'all';
+       protected $supportedOS = array('ios', 'android');
 
-       public function __construct($book_id, $vdir = null, $whole = true, $makeResources = true, $os = 'ios') {
+       public function __construct($book_id, $vdir = null, $whole = true, $makeResources = true, $os = 'all') {
                $this->makeResources = $makeResources;
                $this->os = $os;
                parent::__construct($book_id, $vdir, $whole);
@@ -16,23 +17,35 @@ class wsPackagerPhonegap extends wsPackager {
        protected function preparePackage() {
                parent::preparePackage();
 
-               $compiler = wsHTML5Compiler::factory($this->book_id, null, $this->os, $this->vdir);
-               $compiler->compile();
+               if ($this->os == 'all') {
+                       $oss = $this->supportedOS;
+               } else {
+                       $oss = array($this->os);
+               }
 
-               unlink($this->vdir . '/indext.html');
-               unlink($this->vdir . '/indexu.html');
-               unlink($this->vdir . '/widget.html');
-               unlink($this->vdir . '/cache.appcache');
+               foreach ($oss as $os) {
+                       $vdir = $this->vdir;
+                       if (count($oss) > 1) {
+                               $vdir.='/' . $os;
+                       }
 
+                       $compiler = wsHTML5Compiler::factory($this->book_id, null, $os, $vdir);
+                       $compiler->compile();
 
-               if ($this->makeResources) {
+                       unlink($vdir . '/indext.html');
+                       unlink($vdir . '/indexu.html');
+                       unlink($vdir . '/widget.html');
+                       unlink($vdir . '/cache.appcache');
 
-                       if ($this->os == 'ios') {
-                               $this->resources = $this->vdir . '/Resources';
-                               $this->makeIOSResources();
-                       } elseif ($this->os == 'android') {
-                               $this->resources = $this->vdir . '/Resources';
-                               $this->makeAndroidResources();
+
+                       if ($this->makeResources) {
+                               if ($this->os == 'ios') {
+                                       $this->resources = $vdir . '/Resources';
+                                       $this->makeIOSResources();
+                               } elseif ($this->os == 'android') {
+                                       $this->resources = $vdir . '/Resources';
+                                       $this->makeAndroidResources();
+                               }
                        }
                }
        }
@@ -45,19 +58,20 @@ class wsPackagerPhonegap extends wsPackager {
                        'drawable-xhdpi' => 96
                );
 
-               $splashs = array('drawable' => 'x',
-                       'drawable-hdpi' => 'x',
-                       'drawable-ldpi' => 'x',
-                       'drawable-mdpi' => 'x',
-                       'drawable-xhdpi' => 'x');
+
+               $splashs = array('drawable' => '1024x768',
+                       'drawable-hdpi' => '1024x768',
+                       'drawable-ldpi' => '320x480',
+                       'drawable-mdpi' => '640x960',
+                       'drawable-xhdpi' => '1280x1920');
 
                foreach ($icons as $dir => $size) {
                        $d = $this->resources . '/' . $dir;
                        if (!file_exists($d)) {
                                mkdir($d, 0777, true);
                        }
-                       $list($w, $h) = explode('x', $size);
-                       $this->_makeIcon($w, $h, 'splash', $d);
+
+                       $this->_makeIcon($size, 'icon', $d);
                }
 
                foreach ($splashs as $dir => $size) {
@@ -65,7 +79,16 @@ class wsPackagerPhonegap extends wsPackager {
                        if (!file_exists($d)) {
                                mkdir($d, 0777, true);
                        }
-                       $this->_makeSplash($size, 'splash', $d);
+                       list($w, $h) = explode('x', $size);
+
+                       if ($w > $h) {
+                               $memo = $h;
+                               $h = $w;
+                               $w = $memo;
+                       }
+
+                       $this->_makeSplash($w, $h, 'splashportrait', $d);
+                       $this->_makeSplash($h, $w, 'splashlandscape', $d);
                }
        }