From: vincent@cubedesigners.com Date: Mon, 7 Dec 2015 12:52:40 +0000 (+0000) Subject: #fluidbook-apps Better management of offline apps with shelves X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=badd8efe975a825d1ab6f9b2f53f1fba7af1d623;p=cubeextranet.git #fluidbook-apps Better management of offline apps with shelves --- diff --git a/inc/ws/Controlleur/class.ws.services.php b/inc/ws/Controlleur/class.ws.services.php index e51a1b919..42d7d0f7b 100644 --- a/inc/ws/Controlleur/class.ws.services.php +++ b/inc/ws/Controlleur/class.ws.services.php @@ -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); diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 806119e72..80a684c42 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -297,8 +297,8 @@ class wsUrl { $res .= '' . __("Titre sur l'écran d'accueil") . '' . form::field(array('contents[' . $l . '][titrehome]', 'contents_' . $l . '_titrehome'), 64, 64, $collection->contents[$l]['titrehome']) . ''; $res .= '' . __('A propos') . '' . form::textarea(array('contents[' . $l . '][apropos]', 'contents_' . $l . '_apropos'), 60, 10, $collection->contents[$l]['apropos']) . ''; //'splash' => - $res .= '' . __('Ecran de lancement') . ' (2048x2048px)' . form::hidden(array('theme[splash_' . $l . ']', 'splash_' . $l), $collection->theme['splash_' . $l]) . ''; - $res .= '' . __('Panneau publicité') . ' (2048x2048px)' . form::hidden(array('theme[ad_' . $l . ']', 'ad_' . $l), $collection->theme['ad_' . $l]) . ''; + $res .= '' . __('Ecran de lancement') . ' (2048x2048px)' . form::hidden(array('theme[splash_' . $l . ']', 'splash_' . $l), $collection->theme['splash_' . $l]) . self::viewCollectionFile($collection->theme['splash_' . $l], $collection->collection_id) . ''; + $res .= '' . __('Panneau publicité') . '' . form::hidden(array('theme[ad_' . $l . ']', 'ad_' . $l), $collection->theme['ad_' . $l]) . self::viewCollectionFile($collection->theme['ad_' . $l], $collection->collection_id) . ''; $res .= '' . __('Lien publicité') . '' . form::field(array('contents[' . $l . '][adlink]', 'adlink_' . $l), 64, 64, $collection->contents[$l]['adlink']) . ''; $res .= ''; } @@ -327,11 +327,12 @@ class wsUrl { $res .= ''; $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 .= ''; + $res .= ''; } $res .= ''; $res .= ''; $res .= ''; + $res .= ''; $res .= ''; $res .= '
' . $label . '' . form::hidden(array('theme[' . $i . ']', 'theme_' . $i), $collection->theme[$i]) . '
' . $label . '' . form::hidden(array('theme[' . $i . ']', 'theme_' . $i), $collection->theme[$i]) . self::viewCollectionFile($collection->theme[$i], $collection->collection_id) . '
' . __('Couleur principale') . '#' . form::field(array('settings[couleurA]', 'couleurA'), 6, 6, $collection->settings['couleurA']) . '
' . __('Couleur secondaire') . '#' . form::field(array('settings[couleurB]', 'couleurB'), 6, 6, $collection->settings['couleurB']) . '
' . __('Couleur des textes') . '#' . form::field(array('settings[couleurC]', 'couleurC'), 6, 6, $collection->settings['couleurC']) . '
' . __('Couleur des titres de publication') . '#' . form::field(array('settings[couleurE]', 'couleurC'), 6, 6, $collection->settings['couleurE']) . '
' . __('Couleur de fond') . '#' . form::field(array('settings[couleurD]', 'couleurD'), 6, 6, $collection->settings['couleurD']) . '
'; @@ -388,6 +389,13 @@ class wsUrl { return $res; } + public static function viewCollectionFile($file, $collection_id) { + $res = ''; + $res .= cubeMedia::tango('actions/document-save.png'); + $res .= ''; + return $res; + } + public static function getSelectVersions($versions) { fb($versions); $res = array('-----' => ''); diff --git a/inc/ws/DAO/class.ws.dao.collection.php b/inc/ws/DAO/class.ws.dao.collection.php index 900d714c3..30d00c4b4 100644 --- a/inc/ws/DAO/class.ws.dao.collection.php +++ b/inc/ws/DAO/class.ws.dao.collection.php @@ -158,6 +158,4 @@ class wsDAOCollection extends commonDAO { return array('background' => '', 'etagere' => ''); } -} - -?> +} \ No newline at end of file diff --git a/inc/ws/Util/class.ws.exporter.php b/inc/ws/Util/class.ws.exporter.php index f63ce9557..74e98a525 100644 --- a/inc/ws/Util/class.ws.exporter.php +++ b/inc/ws/Util/class.ws.exporter.php @@ -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'); diff --git a/inc/ws/Util/html5/app/class.ws.html5.app.compiler.php b/inc/ws/Util/html5/app/class.ws.html5.app.compiler.php index cb3f8a2bf..e39e9435a 100644 --- a/inc/ws/Util/html5/app/class.ws.html5.app.compiler.php +++ b/inc/ws/Util/html5/app/class.ws.html5.app.compiler.php @@ -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();