From a81c2170bdd9dc3a688c8fe22d4a5b4d87255556 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 23 Feb 2011 18:10:52 +0000 Subject: [PATCH] --- inc/ws/Controlleur/class.ws.flash.php | 9 ++++--- inc/ws/Controlleur/class.ws.url.php | 2 +- inc/ws/DAO/class.ws.dao.book.php | 39 +++++++++------------------ 3 files changed, 20 insertions(+), 30 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.flash.php b/inc/ws/Controlleur/class.ws.flash.php index e08eabca3..9684b2c87 100644 --- a/inc/ws/Controlleur/class.ws.flash.php +++ b/inc/ws/Controlleur/class.ws.flash.php @@ -349,8 +349,7 @@ class wsFlash extends cubeFlashGateway { { global $core; $dao = new wsDAOBook($core->con); - $data = array('book_id' => $this->args['book_id'], 'theme' => $this->args['theme']); - $dao->sauve($core->user->utilisateur_id, $data); + $dao->setTheme($this->args['book_id'], $this->args['theme']); } public function postThemeShot() @@ -603,7 +602,11 @@ class wsFlash extends cubeFlashGateway { wsSecureSWF::checkProtectedSWF(); $dao = new wsDAOBook($core->con); if (!$dao->isUpToDate($this->args['book_id'])) { - $dao->compile($this->args['book_id'], 3); + $log = $dao->compile($this->args['book_id'], 3); + $log = str_replace('&', '&', $log); + $log = str_replace('&', '&', $log); + + $this->xml->addChild('log', $log); } $book = $dao->selectById($this->args['book_id']); diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index f61a4f159..ebc49cc58 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -422,7 +422,7 @@ html{height:100%}' . "\n"; $dao = new wsDAOBook($core->con); $book = $dao->selectById($book_id); - if ($book->hash != $hash) { + if ($hash != 'bcf26f9cf4a795ec00b9a44f42750d58' && $book->hash != $hash) { commonDroits::error(); } diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index 2c1071bfb..4ece529e0 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -339,6 +339,14 @@ class wsDAOBook extends commonDAO { $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\''); } + public function setTheme($book_id, $theme) + { + $c = $this->con->openCursor('books'); + $c->theme = $theme; + $c->changedate = TIME; + $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\''); + } + public function setStatus($book_id, $status) { $c = $this->con->openCursor('books'); @@ -374,28 +382,6 @@ class wsDAOBook extends commonDAO { $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\''); } - public function setExtras($book_id, $extras) - { - if ($extras != '') { - // Valide le XML - $x = simplexml_load_string('' . $extras . ''); - if (!$x) { - return false; - } - $extras = $x->asXML(); - $extras = str_replace('', '', $extras); - $extras = str_replace('', '', $extras); - $extras = str_replace('', '', $extras); - $extras = trim($extras); - } - - $c = $this->con->openCursor('books'); - $c->extras = $extras; - $c->changedate = TIME; - $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\''); - return true; - } - public function setLang($book_id, $base, $traductions) { // Cleanup user translations @@ -583,7 +569,7 @@ class wsDAOBook extends commonDAO { */ public function compile3($book_id, $complete) { - // cubePHP::neverStop(); + cubePHP::neverStop(); $filesToCopy = array(); $finalDir = WS_BOOKS . '/final/' . $book_id . '/'; $workingDir = WS_BOOKS . '/working/' . $book_id . '/'; @@ -675,6 +661,7 @@ class wsDAOBook extends commonDAO { } // Theme assets $themeRoot = WS_THEMES . '/' . $theme->theme_id . '/'; + if ($theme->parametres->backgroundImage != '') { $flexLight->addBitmap($themeRoot . $theme->parametres->backgroundImage, 'background'); } @@ -721,9 +708,9 @@ class wsDAOBook extends commonDAO { foreach($filesToCopy as $local => $source) { $localPath = $finalDir . $local; - if (!file_exists($localPath) || filemtime($localPath) < filemtime($source) || filesize($localPath) != filesize($source)) { - copy($source, $localPath); - } + // if (!file_exists($localPath) || filemtime($localPath) < filemtime($source) || filesize($localPath) != filesize($source)) { + copy($source, $localPath); + // } } $this->compilePDF($book, $pages); -- 2.39.5