{\r
global $core;\r
$dao = new wsDAOBook($core->con);\r
- $data = array('book_id' => $this->args['book_id'], 'theme' => $this->args['theme']);\r
- $dao->sauve($core->user->utilisateur_id, $data);\r
+ $dao->setTheme($this->args['book_id'], $this->args['theme']);\r
}\r
\r
public function postThemeShot()\r
wsSecureSWF::checkProtectedSWF();\r
$dao = new wsDAOBook($core->con);\r
if (!$dao->isUpToDate($this->args['book_id'])) {\r
- $dao->compile($this->args['book_id'], 3);\r
+ $log = $dao->compile($this->args['book_id'], 3);\r
+ $log = str_replace('&', '&', $log);\r
+ $log = str_replace('&', '&', $log);\r
+\r
+ $this->xml->addChild('log', $log);\r
}\r
$book = $dao->selectById($this->args['book_id']);\r
\r
$c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
}\r
\r
+ public function setTheme($book_id, $theme)\r
+ {\r
+ $c = $this->con->openCursor('books');\r
+ $c->theme = $theme;\r
+ $c->changedate = TIME;\r
+ $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
+ }\r
+\r
public function setStatus($book_id, $status)\r
{\r
$c = $this->con->openCursor('books');\r
$c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
}\r
\r
- public function setExtras($book_id, $extras)\r
- {\r
- if ($extras != '') {\r
- // Valide le XML\r
- $x = simplexml_load_string('<extras>' . $extras . '</extras>');\r
- if (!$x) {\r
- return false;\r
- }\r
- $extras = $x->asXML();\r
- $extras = str_replace('<?xml version="1.0"?>', '', $extras);\r
- $extras = str_replace('<extras>', '', $extras);\r
- $extras = str_replace('</extras>', '', $extras);\r
- $extras = trim($extras);\r
- }\r
-\r
- $c = $this->con->openCursor('books');\r
- $c->extras = $extras;\r
- $c->changedate = TIME;\r
- $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
- return true;\r
- }\r
-\r
public function setLang($book_id, $base, $traductions)\r
{\r
// Cleanup user translations\r
*/\r
public function compile3($book_id, $complete)\r
{\r
- // cubePHP::neverStop();\r
+ cubePHP::neverStop();\r
$filesToCopy = array();\r
$finalDir = WS_BOOKS . '/final/' . $book_id . '/';\r
$workingDir = WS_BOOKS . '/working/' . $book_id . '/';\r
}\r
// Theme assets\r
$themeRoot = WS_THEMES . '/' . $theme->theme_id . '/';\r
+\r
if ($theme->parametres->backgroundImage != '') {\r
$flexLight->addBitmap($themeRoot . $theme->parametres->backgroundImage, 'background');\r
}\r
\r
foreach($filesToCopy as $local => $source) {\r
$localPath = $finalDir . $local;\r
- if (!file_exists($localPath) || filemtime($localPath) < filemtime($source) || filesize($localPath) != filesize($source)) {\r
- copy($source, $localPath);\r
- }\r
+ // if (!file_exists($localPath) || filemtime($localPath) < filemtime($source) || filesize($localPath) != filesize($source)) {\r
+ copy($source, $localPath);\r
+ // }\r
}\r
\r
$this->compilePDF($book, $pages);\r