From: vincent@cubedesigners.com Date: Fri, 12 Jul 2013 16:52:58 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=019d8ef170e8cdf0a12d16c06e5236b2874b2e42;p=cubeextranet.git --- diff --git a/inc/ws/Controlleur/class.ws.ajax.php b/inc/ws/Controlleur/class.ws.ajax.php index e45e840b9..bc5a7354f 100644 --- a/inc/ws/Controlleur/class.ws.ajax.php +++ b/inc/ws/Controlleur/class.ws.ajax.php @@ -804,8 +804,6 @@ class wsAjax extends cubeAjax { $dao->setLinksAndRulers($book_id, json_encode($nlinks), json_encode($nrulers), 'Restore links from ' . date('Y-m-d H:i:s', $time), $core->user->utilisateur_id); } - - public static function importLinksAsExcel($args) { global $core; $book_id = $args[1]; @@ -1083,12 +1081,18 @@ class wsAjax extends cubeAjax { file_put_contents(WS_COLLECTIONS . '/versions/' . $id . '/' . $time . '/composition.json', json_encode($compiler->collection->datas)); + + $c = $core->con->openCursor('book_collection_compile'); $c->collection_id = $id; $c->compile_date = $time; $c->online = 0; $c->insert(); + if (true) { + self::collectionVersionPublish(array('collectionVersionPublish', $id, $time), new cubeAjax()); + } + $x->addReload(); } @@ -1129,4 +1133,5 @@ class wsAjax extends cubeAjax { } } + ?> \ No newline at end of file diff --git a/inc/ws/Controlleur/class.ws.services.php b/inc/ws/Controlleur/class.ws.services.php index 4547dfed5..2658b5fe0 100644 --- a/inc/ws/Controlleur/class.ws.services.php +++ b/inc/ws/Controlleur/class.ws.services.php @@ -553,12 +553,21 @@ class wsServices extends cubeFlashGateway { public function collection() { global $core; $id = $this->callArgs[0]; + $local = (isset($this->callArgs[1])) ? $this->callArgs[1] : null; + $this->outputXML = false; header('Content-type: application/json'); $cache = WS_COLLECTIONS . '/ws/' . $id . '.json'; - $limit = TIME - 7200; - if (!file_exists($cache) || filemtime($cache) < $limit) { + $update = WS_COLLECTIONS . '/ws/' . $id . '.update'; + + if (!is_null($local) && file_exists($update) && file_get_contents($update) == $local) { + echo 'false'; + exit; + } + + $limit = TIME - 72000; + if (!file_exists($cache) || !file_exists($update) || filemtime($cache) < $limit) { $r = $core->con->select('SELECT * FROM book_collection_compile WHERE online=1 AND collection_id=\'' . $core->con->escape($id) . '\''); $r->fetch(); $version = $r->compile_date; @@ -581,6 +590,7 @@ class wsServices extends cubeFlashGateway { $json = json_encode($d); file_put_contents($cache, $json); echo $json; + file_put_contents($update, $version); } else { echo file_get_contents($cache); } diff --git a/inc/ws/Util/class.ws.exporter.php b/inc/ws/Util/class.ws.exporter.php index d8983693f..eef918287 100644 --- a/inc/ws/Util/class.ws.exporter.php +++ b/inc/ws/Util/class.ws.exporter.php @@ -76,7 +76,6 @@ class wsExporter { // Transfert `sudo /usr/local/bin/remountmac`; - $this->_rsync(WS_COLLECTIONS . '/resources/' . $collection->collection_id . '/' . $os, "/mnt/macbox" . $this->_iosProjectDir($collection->settings['namespace']) . '/' . CubeIT_Text::str2URL($collection->nom) . '/Resources', false); } } diff --git a/inc/ws/Util/html5/class.ws.html5.compiler.php b/inc/ws/Util/html5/class.ws.html5.compiler.php index f46ded7ec..5355fd083 100644 --- a/inc/ws/Util/html5/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/class.ws.html5.compiler.php @@ -359,10 +359,6 @@ class wsHTML5Compiler { return; } - $videosExtensions = $this->getVideosFormats(false); - foreach ($videosExtensions as $e) { - $videos[$e] = array(); - } $cacheFile = $this->vdir . '/cache.appcache'; @@ -385,62 +381,27 @@ class wsHTML5Compiler { $lines[] = 'index.html* index.html'; $lines[] = ''; $lines[] = 'CACHE:'; - $assets = array('images', 'style', 'swf', 'data/style', 'data/images', 'data/fluidbook.js', 'data/datas.js'); - - $pages = $this->book->parametres->pages + 1; - - for ($i = 0; $i <= $pages; $i++) { - $assets[] = 'data/background/150/' . $this->backgroundsPrefix . $i . '.jpg'; - $assets[] = 'data/contents/p' . $i . '.svg'; - } - $assets[] = 'data/thumbnails'; - $assets[] = 'data/links'; - foreach ($assets as $a) { - $ap = $dest . '/' . $a; - - if (!file_exists($ap)) { + $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dest), RecursiveIteratorIterator::SELF_FIRST); + + $exclude=array('index.html','indexu.html','widget.html','indext.html'); + + foreach ($iterator as $path) { + if (!$path->isFile()) { continue; } - if (is_file($ap)) { - $lines[] = str_replace($dest . '/', '', $ap); - } else if (is_dir($ap)) { - $iterator = new RecursiveDirectoryIterator($ap); - foreach ($iterator as $path) { - if (!$path->isFile()) { - continue; - } - $p = str_replace($dest . '/', '', $path); - $lines[] = $p; - } + + $p = str_replace($dest . '/', '', $path); + if (in_array($p, $exclude)) { + continue; } + $lines[] = $p; } $lines[] = ''; $lines = array_merge($lines, $network); file_put_contents($cacheFile, implode("\n", $lines)); - - foreach ($videos as $format => $v) { - if (!count($v)) { - continue; - } - $cacheFile = $dest . '/data/links/video.' . $format . '.appcache'; - $htmlFile = $dest . '/data/links/video.' . $format . '.html'; - - $html = ''; - file_put_contents($htmlFile, $html); - - $lines = array(); - $lines[] = 'CACHE MANIFEST'; - $lines[] = '# ' . date('Y-m-d H:i:s'); - $lines[] = ''; - $lines[] = 'CACHE:'; - foreach ($v as $video) { - $lines[] = $video; - } - file_put_contents($cacheFile, implode("\n", $lines)); - } } protected function writeIndex($numCSS) {