$book->facturable_id = $r->facturable_id;\r
$book->tache = $r->tache;\r
$book->projet = $r->projet;\r
- $book->version=$r->version;\r
+ $book->version = $r->version;\r
\r
return $book;\r
}\r
$book->parametres = new wsBookParametres();\r
$book->tache = 0;\r
$book->pages = array();\r
- $book->version=2;\r
+ $book->version = 2;\r
return $book;\r
}\r
\r
$c->theme = $r->theme;\r
$c->changedate = TIME;\r
$c->compiledate = 0;\r
- $c->version=2;\r
+ $c->version = 2;\r
$book_id = $c->book_id = $this->getNextId();\r
$c->insert();\r
\r
$c->lang = $lang;\r
$c->changedate = TIME;\r
$c->compiledate = TIME;\r
- $c->version=2;\r
+ $c->version = 2;\r
$book_id = $c->book_id = $this->getNextId();\r
$c->insert();\r
return $this->selectById($book_id);\r
$c->status = 2;\r
$c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
}\r
- \r
- public function setVersion($book_id,$version){\r
- $c=$this->con->openCursor('books');\r
- $c->version=$version;\r
- $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
- \r
+\r
+ public function setVersion($book_id, $version) {\r
+ $c = $this->con->openCursor('books');\r
+ $c->version = $version;\r
+ $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
}\r
\r
public function touch($book_id) {\r
if ($theme->parametres->logo != '') {\r
$flex->addBitmap($themeRoot . $theme->parametres->logo, 'logo');\r
}\r
-\r
if ($theme->parametres->afterSearch != '') {\r
$flex->addBitmap($themeRoot . $theme->parametres->afterSearch, 'aftersearch');\r
}\r
foreach (wsIcone::$files as $file) {\r
$flex->addBitmap($iconsRoot . 'nav-' . $file . '.png', 'nav_' . $file);\r
}\r
- // Fonts\r
- $flex->addFont(FONT_PATH . '/' . $lang->font, 'GeneralFont', $lang->charset);\r
- $flex->addFont(FONT_PATH . '/FluidbookCredits.ttf', 'CreditsFont', 'ASCII');\r
- $flexLight->addFont(FONT_PATH . '/FluidbookLoader.ttf', 'LoaderFont', 'Numerals');\r
- $flexLight->addVariable('checksum', $hash, false, true, 'String');\r
- $res .= $flex->compile() . "\n\n-------------------\n\n";\r
- $flexLight->addVariable('datasSize', filesize($compilerDir . '/FluidbookDatas.swf'));\r
- $res .= $flexLight->compile();\r
+\r
// Basket\r
if ($book->parametres->basket) {\r
$formats = array('jpg', 'png', 'jpeg');\r
- $referencesFile = $workingDir . '/' . $book->parametres->basketReferences;\r
- $references = array();\r
+ $referencesFile = $workingDir . 'commerce/' . $book->parametres->basketReferences;\r
+\r
if (file_exists($referencesFile)) {\r
- $fp = fopen($reference_file, "rb");\r
+ $xml = simplexml_load_file($referencesFile);\r
$i = 0;\r
- while ($line = fgetcsv($fp)) {\r
- $references[] = $line;\r
- if ($i > 0) {\r
- $refid = trim($line[0]);\r
- foreach ($formats as $f) {\r
- $refimage = $workingDir . '/' . $refid . '.' . $f;\r
- if (file_exists($refimage)) {\r
- $flex->addBitmap($refimage, "basket_image_" + ($i - 1));\r
- break;\r
- }\r
+ foreach ($xml->item as $item) {\r
+ $ref = (string) $item['reference'];\r
+ foreach ($formats as $f) {\r
+ $refimage = $workingDir . 'commerce/' . $ref . '.' . $f;\r
+ if (file_exists($refimage)) {\r
+ $flex->addBitmap($refimage, "basket_image_" + $ref);\r
+ break;\r
}\r
}\r
$i++;\r
}\r
}\r
- $flex->addVariable('basketReferences', $references, "JSONObject");\r
+ $flex->addVariable('basketReferences', $xml->asXML(),false,true, "XML");\r
}\r
+ // Fonts\r
+ $flex->addFont(FONT_PATH . '/' . $lang->font, 'GeneralFont', $lang->charset);\r
+ $flex->addFont(FONT_PATH . '/FluidbookCredits.ttf', 'CreditsFont', 'ASCII');\r
+ $flexLight->addFont(FONT_PATH . '/FluidbookLoader.ttf', 'LoaderFont', 'Numerals');\r
+ $flexLight->addVariable('checksum', $hash, false, true, 'String');\r
+ $res .= $flex->compile() . "\n\n-------------------\n\n";\r
+ $flexLight->addVariable('datasSize', filesize($compilerDir . '/FluidbookDatas.swf'));\r
+ $res .= $flexLight->compile();\r
+\r
\r
$filesToCopy['FluidbookDatas.swf'] = $compilerDir . '/FluidbookDatas.swf';\r
$filesToCopy['FluidbookDatasLight.swf'] = $compilerDir . '/FluidbookDatasLight.swf';\r
foreach ($filesToCopy as $local => $source) {\r
$localPath = $finalDir . $local;\r
// if (!file_exists($localPath) || filemtime($localPath) < filemtime($source) || filesize($localPath) != filesize($source)) {\r
+ if (is_dir($source)) {\r
+ continue;\r
+ }\r
copy($source, $localPath);\r
// }\r
}\r