]> _ Git - cubeextranet.git/commitdiff
#fluidbook-apps Better management of offline apps with shelves
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 7 Dec 2015 12:52:40 +0000 (12:52 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 7 Dec 2015 12:52:40 +0000 (12:52 +0000)
inc/ws/Controlleur/class.ws.services.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/class.ws.dao.collection.php
inc/ws/Util/class.ws.exporter.php
inc/ws/Util/html5/app/class.ws.html5.app.compiler.php

index e51a1b91987d499f079dc1e8b9427c702902728f..42d7d0f7b7aa36cecbdb71c4e18da7d161c01f3e 100644 (file)
@@ -797,6 +797,9 @@ class wsServices extends cubeFlashGateway {
                                                $book = $books[$p->id];
                                                $root = WS_COLLECTIONS . '/versions/' . $id . '/' . $version . '/' . $os . '/' . $p->id;
                                                $couv = $root . '/cover.jpg';
+                                               if (!file_exists($couv)) {
+                                                       $couv = $root . '/data/thumbnails/p1.jpg';
+                                               }
                                                $couvertures[$p->id] = base64_encode(file_get_contents($couv));
                                                $composition[$k]->publications[$l]->width = $book->parametres->width;
                                                $composition[$k]->publications[$l]->height = $book->parametres->height;
@@ -830,7 +833,9 @@ class wsServices extends cubeFlashGateway {
                                }
 
                                $d = array('id' => $id, 'res' => $resolution, 'ns' => $ns, 'langs' => $langs, 'langnames' => $langsnames, 'time' => $version, 'datas' => $composition, 'couvertures' => $couvertures, 'traductions' => $traductions, 'contents' => $contents);
-                               $d = array_merge($d, $this->_getManifest($publications, '/fluidbook/collections/versions/' . $id . '/' . $version . '/' . $os, $books, $resolution));
+                               if (!$collection->settings['offline']) {
+                                       $d = array_merge($d, $this->_getManifest($publications, '/fluidbook/collections/versions/' . $id . '/' . $version . '/' . $os, $books, $resolution));
+                               }
 
                                $dao = new wsDAOCollection($core->con);
                                $col = $dao->selectById($id);
index 806119e727048c12a71f21fc63e3550e229b3c4a..80a684c420f3ace3cab4487eb1ba75296c75698a 100644 (file)
@@ -297,8 +297,8 @@ class wsUrl {
                        $res .= '<tr><td class="min nowrap">' . __("Titre sur l'écran d'accueil") . '</td><td>' . form::field(array('contents[' . $l . '][titrehome]', 'contents_' . $l . '_titrehome'), 64, 64, $collection->contents[$l]['titrehome']) . '</td></tr>';
                        $res .= '<tr><td class="min nowrap">' . __('A propos') . '</td><td>' . form::textarea(array('contents[' . $l . '][apropos]', 'contents_' . $l . '_apropos'), 60, 10, $collection->contents[$l]['apropos']) . '</td></tr>';
                        //'splash' =>
-                       $res .= '<tr><td class="min nowrap">' . __('Ecran de lancement') . ' (2048x2048px)</td><td><input type="file" name="splash_' . $l . '" />' . form::hidden(array('theme[splash_' . $l . ']', 'splash_' . $l), $collection->theme['splash_' . $l]) . '</td></tr>';
-                       $res .= '<tr><td class="min nowrap">' . __('Panneau publicité') . ' (2048x2048px)</td><td><input type="file" name="ad_' . $l . '" />' . form::hidden(array('theme[ad_' . $l . ']', 'ad_' . $l), $collection->theme['ad_' . $l]) . '</td></tr>';
+                       $res .= '<tr><td class="min nowrap">' . __('Ecran de lancement') . ' (2048x2048px)</td><td><input type="file" name="splash_' . $l . '" />' . form::hidden(array('theme[splash_' . $l . ']', 'splash_' . $l), $collection->theme['splash_' . $l]) . self::viewCollectionFile($collection->theme['splash_' . $l], $collection->collection_id) . '</td></tr>';
+                       $res .= '<tr><td class="min nowrap">' . __('Panneau publicité') . '</td><td><input type="file" name="ad_' . $l . '" />' . form::hidden(array('theme[ad_' . $l . ']', 'ad_' . $l), $collection->theme['ad_' . $l]) . self::viewCollectionFile($collection->theme['ad_' . $l], $collection->collection_id) . '</td></tr>';
                        $res .= '<tr><td class="min nowrap">' . __('Lien publicité') . '</td><td>' . form::field(array('contents[' . $l . '][adlink]', 'adlink_' . $l), 64, 64, $collection->contents[$l]['adlink']) . '</td></tr>';
                        $res .= '</table>';
                }
@@ -327,11 +327,12 @@ class wsUrl {
                $res .= '<table class="max">';
                $images = array('back' => __('Image de fond'), 'etagere' => __("Image de l'étagère"), 'icon' => __("Icône de l'application") . ' (1024x1024px)');
                foreach ($images as $i => $label) {
-                       $res .= '<tr><td class="min nowrap">' . $label . '</td><td><input type="file" name="' . $i . '" />' . form::hidden(array('theme[' . $i . ']', 'theme_' . $i), $collection->theme[$i]) . '</td></tr>';
+                       $res .= '<tr><td class="min nowrap">' . $label . '</td><td><input type="file" name="' . $i . '" />' . form::hidden(array('theme[' . $i . ']', 'theme_' . $i), $collection->theme[$i]) . self::viewCollectionFile($collection->theme[$i], $collection->collection_id) . '</td></tr>';
                }
                $res .= '<tr><td class="min nowrap">' . __('Couleur principale') . '</td><td>#' . form::field(array('settings[couleurA]', 'couleurA'), 6, 6, $collection->settings['couleurA']) . '</td></tr>';
                $res .= '<tr><td class="min nowrap">' . __('Couleur secondaire') . '</td><td>#' . form::field(array('settings[couleurB]', 'couleurB'), 6, 6, $collection->settings['couleurB']) . '</td></tr>';
                $res .= '<tr><td class="min nowrap">' . __('Couleur des textes') . '</td><td>#' . form::field(array('settings[couleurC]', 'couleurC'), 6, 6, $collection->settings['couleurC']) . '</td></tr>';
+               $res .= '<tr><td class="min nowrap">' . __('Couleur des titres de publication') . '</td><td>#' . form::field(array('settings[couleurE]', 'couleurC'), 6, 6, $collection->settings['couleurE']) . '</td></tr>';
                $res .= '<tr><td class="min nowrap">' . __('Couleur de fond') . '</td><td>#' . form::field(array('settings[couleurD]', 'couleurD'), 6, 6, $collection->settings['couleurD']) . '</td></tr>';
 
                $res .= '</table>';
@@ -388,6 +389,13 @@ class wsUrl {
                return $res;
        }
 
+       public static function viewCollectionFile($file, $collection_id) {
+               $res = '<a href="/fluidbook/collections/working/' . $collection_id . '/' . $file . '" target="_blank">';
+               $res .= cubeMedia::tango('actions/document-save.png');
+               $res .= '</a>';
+               return $res;
+       }
+
        public static function getSelectVersions($versions) {
                fb($versions);
                $res = array('-----' => '');
index 900d714c394300bfc6f628e874c95d84b32c955a..30d00c4b45108a640e81c5f7b61ecef4947dc86f 100644 (file)
@@ -158,6 +158,4 @@ class wsDAOCollection extends commonDAO {
                return array('background' => '', 'etagere' => '');
        }
 
-}
-
-?>
+}
\ No newline at end of file
index f63ce95573d3dfb47deaa5b845f86377424549b7..74e98a5255fb59cda87461cbb1dcf2dea6e192bb 100644 (file)
@@ -59,8 +59,7 @@ class wsExporter {
                $phonegap->setAppName($appNames);
                $phonegap->setWWWDirectory($dir);
                if ($os == 'ios') {
-
-                       $phonegap->setDistantCompiler(self::VINCENT, 'vincent', 'iquique', '/Phonegap/Projects/' . $d, '/mnt/macbox/Phonegap/Projects/' . $d, 22022, SSH_KEY);
+                       $phonegap->setDistantCompiler(self::VINCENT, 'vincent', 'atacama', '/Phonegap/Projects/' . $d, '/mnt/macbox/Phonegap/Projects/' . $d, 22022, SSH_KEY);
                } else if ($os == 'android') {
                        $manifestType = isset($collection->settings['offline']) ? 'Offline' : 'Online';
                        $phonegap->setManifest(WS_COMPILE_ASSETS . '/_html5app/_android/AndroidManifest' . $manifestType . '.xml');
index cb3f8a2bf8e26fcf1094f88502826a560225ddc2..e39e9435a15dd1872499151f0db87f0e268e5292 100644 (file)
@@ -91,7 +91,7 @@ class wsHTML5AppCompiler {
        protected function copyRecursive($source, $dest) {
                if (is_dir($source)) {
                        $iterator = new RecursiveIteratorIterator(
-                                       new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST
+                               new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST
                        );
 
                        foreach ($iterator as $file) {
@@ -143,6 +143,7 @@ class wsHTML5AppCompiler {
                $config['couleurB'] = $this->collection->settings['couleurB'];
                $config['couleurC'] = $this->collection->settings['couleurC'];
                $config['couleurD'] = $this->collection->settings['couleurD'];
+               $config['couleurE'] = $this->collection->settings['couleurE'];
                $config['offline'] = false;
                if (isset($this->collection->settings['offline'])) {
                        $config['offline'] = $this->collection->settings['offline'];
@@ -182,6 +183,7 @@ class wsHTML5AppCompiler {
                $c[] = 'body{background-image:url("images/' . $this->collection->theme['back'] . '");}';
                $c[] = '#shelves{background-image:url("images/' . $this->collection->theme['etagere'] . '");}';
 
+
                // Menus
                $menuColor = new CubeIT_Graphics_Color($this->collection->settings['couleurA']);
                $textColor = new CubeIT_Graphics_Color($this->collection->settings['couleurC']);
@@ -208,8 +210,8 @@ class wsHTML5AppCompiler {
        background-image: linear-gradient(top bottom, $top 0%,$bottom 100%); /* W3C */
 }";
 
-               $caption.='#bar,.mview{color:' . $textColor->toCSS() . '}';
-               $caption.=".mview .caption a{
+               $caption .= '#bar,.mview{color:' . $textColor->toCSS() . '}';
+               $caption .= ".mview .caption a{
        border:1px solid $border;
        color:$text;
 }";
@@ -221,9 +223,17 @@ class wsHTML5AppCompiler {
                }
 
 
-               $caption.="#bar{border-bottom:1px solid " . $border . "}";
+               $caption .= "#bar{border-bottom:1px solid " . $border . "}";
                $c[] = $caption;
 
+               #Publications
+               $colorE = $this->collection->settings['couleurE'];
+               if (!$colorE) {
+                       $colorE = '#ffffff';
+               }
+               $publicationsColor = new CubeIT_Graphics_Color($colorE);
+               $c[] = '.publication, .publication a, .publication .label{color:' . $publicationsColor->toCSS() . ';}';
+
                # Chapters (menu lists)
                $top = $menuColor->setAlpha(0.5)->toCSS();
                $bottom = $menuMultiply->setAlpha(0.5)->toCSS();