]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 4 Apr 2011 14:17:44 +0000 (14:17 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 4 Apr 2011 14:17:44 +0000 (14:17 +0000)
fluidbook/tools/fwstk.jar
inc/ws/Controlleur/class.ws.conversion.session.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/DAO/class.ws.dao.document.php
inc/ws/Metier/class.ws.document.php

index 8e038c66c548f609e2c58ea248e1e89166e777b3..84245969a09709a7db067e6dd465810004019d79 100644 (file)
Binary files a/fluidbook/tools/fwstk.jar and b/fluidbook/tools/fwstk.jar differ
index 6719eb66a10e1355db1a229b506554de91dd0c84..8662d1b51e5449db906ca6ef81e152ae83f818eb 100644 (file)
@@ -89,7 +89,8 @@ class wsConversionSession {
                        $this->serialize();\r
                        if (!$this->reload) {\r
                                $this->currentDoc->globalOperations();\r
-                               $dao->putLinksFromCSV($this->currentDoc->document_id);\r
+                               $log=$dao->putLinksFromCSV($this->currentDoc->document_id);\r
+                               $this->currentDoc->addToLog($log);\r
                        } else if ($this->documentsPages[$doc->document_id] == 'all') {\r
                                $this->currentDoc->globalOperations();\r
                        }\r
index 3f436505f8c4a89f9fe332dd475f0fb33459c945..ca43df93a4ed0da14ee6a224f4644e128d3fe64d 100644 (file)
@@ -460,7 +460,7 @@ html{height:100%}' . "\n";
 \r
                $res .= '</head>';\r
                $res .= '<body style="background-color:#' . $theme->parametres->loadingBackColor . '" onload="this.focus();">';\r
-               $res .= cubeMedia::flash2('index.swf', '100%', '100%', $fv, 'fluidbook','', 10, '#' . $theme->parametres->loadingBackColor,  $alt, 'true', 'noscale', 'gpu', array('allowScriptAccess' => 'always'));\r
+               $res .= cubeMedia::flash2('index.swf', '100%', '100%', $fv, 'fluidbook', '', 10, '#' . $theme->parametres->loadingBackColor, $alt, 'true', 'noscale', 'gpu', array('allowScriptAccess' => 'always'));\r
                $js = array($webcompile . 'fluidbook.js');\r
                $jsvar = array();\r
 \r
@@ -578,11 +578,21 @@ html{height:100%}' . "\n";
                // cubePHP::neverStop();\r
                $dao = new wsDAOBook($core->con);\r
                header('Content-type: text/plain');\r
-               ob_clean();\r
                echo $dao->compile($args[1], 3, isset($args[2]));\r
                exit;\r
        }\r
 \r
+       public static function testLinksCSV($args)\r
+       {\r
+               global $core;\r
+               commonDroits::min(5);\r
+\r
+               $dao=new wsDAODocument($core->con);\r
+               header('Content-type: text/plain');\r
+               ob_clean();\r
+               echo $dao->putLinksFromCSV($args[1]);\r
+       }\r
+\r
        protected static function checkDocumentVersionOfBook($book_id)\r
        {\r
                global $core;\r
index 3fb6b3da24da96fa31e16d9e9f285c9e0d82b800..ef22f10fdf032e9aa253eff5605f9b17634a84be 100644 (file)
@@ -635,23 +635,34 @@ class wsDAOBook extends commonDAO {
                $flex->addVariable('numerotation', $book->numerotation, false, true, 'String');\r
                $flexLight->addVariable('theme', $theme->parametres->toStandardObject(), false, true, 'JSONObject');\r
                $flexLight->addVariable('pages', $book->parametres->pages);\r
-               $flexLight->addVariable('fwidth', round($size[0],4), false, true, 'Number');\r
-               $flexLight->addVariable('fheight', round($size[1],4), false, true, 'Number');\r
+               $flexLight->addVariable('fwidth', round($size[0], 4), false, true, 'Number');\r
+               $flexLight->addVariable('fheight', round($size[1], 4), false, true, 'Number');\r
                $flexLight->addVariable('pagesInDatas', $complete, false, true, 'Boolean');\r
                $flex->addVariable('index', $index, false, true, 'JSONObject');\r
                $flex->addVariable('textes', $textes, false, true, 'JSONObject');\r
+\r
+               fb($pages);\r
+\r
                foreach($pages as $i => $infos) {\r
-                       $swffile = WS_DOCS . '/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.swf';\r
+                       $base = WS_DOCS . '/' . $infos['document_id'] . '/p' . $infos['document_page'];\r
+                       $swffile = $base . '.swf';\r
                        if (file_exists($swffile)) {\r
                                $fsize = filesize($swffile);\r
                        } else {\r
                                $fsize = 0;\r
                        }\r
+\r
+                       if ($complete) {\r
+                               $flex->addSWF($swffile, 'page' . $i);\r
+                       } else {\r
+                               $filesToCopy['data/p' . $i. '.swf'] = $swffile;\r
+                       }\r
+\r
                        if ($i == 1) {\r
-                               $flexLight->addBitmap(WS_DOCS . '/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.jpg', 'thumb1');\r
+                               $flexLight->addBitmap($base . '.jpg', 'thumb1');\r
                                $flexLight->addVariable('size_p_' . $i, $fsize, false, true, 'Number');\r
                        } else {\r
-                               $flex->addBitmap(WS_DOCS . '/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.jpg', 'thumb' . $i);\r
+                               $flex->addBitmap($base . '.jpg', 'thumb' . $i);\r
                                $flexLight->addVariable('size_p_' . $i, $fsize, false, true, 'Number');\r
                        }\r
                }\r
@@ -663,18 +674,6 @@ class wsDAOBook extends commonDAO {
                        $flex->addSound(WS_SOUNDS . '/' . $book->parametres->soundTheme . '/page-flip-2.mp3', 'soundPage1');\r
                        $flex->addSound(WS_SOUNDS . '/' . $book->parametres->soundTheme . '/cover-flip.mp3', 'soundCover0');\r
                }\r
-\r
-               if ($complete) {\r
-                       foreach($pages as $i => $infos) {\r
-                               $swffile = WS_DOCS . '/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.swf';\r
-                               $flex->addSWF($swffile, 'page' . $i);\r
-                       }\r
-               } else {\r
-                       foreach($pages as $i => $infos) {\r
-                               $swffile = WS_DOCS . '/' . $infos['document_id'] . '/p' . $infos['document_page'] . '.swf';\r
-                               $filesToCopy['data/p' . $infos['document_page'] . '.swf'] = $swffile;\r
-                       }\r
-               }\r
                // Theme assets\r
                $themeRoot = WS_THEMES . '/' . $theme->theme_id . '/';\r
 \r
index 9b2bf4c4f1ed798ba80061d19f3e254cd482cd95..60c95ec4f85ba8c6669e491e4180921c4af7d9b7 100644 (file)
@@ -20,6 +20,7 @@ class wsDAODocument extends commonDAO {
 \r
        public function putLinksFromCSV($document_id)\r
        {\r
+               $log = array('Copie des liens du PDF vers la base de donnĂ©es');\r
                $document = $this->selectById($document_id);\r
 \r
                $booleans = array('video_loop', 'video_auto_start', 'video_controls', 'video_sound_on');\r
@@ -32,9 +33,14 @@ class wsDAODocument extends commonDAO {
                for($page = 1;$page <= $document->generalInfos['pages'];$page++) {\r
                        $csv = WS_DOCS . '/' . $document->document_id . '/p' . $page . '.csv';\r
                        if (!file_exists($csv)) {\r
+                               $log[] = 'Links file of page ' . $page . ' not found';\r
                                continue;\r
                        }\r
-                       $c->update = filemtime($csv);\r
+\r
+                       $log[] = 'Links file of page ' . $page . ' found';\r
+\r
+                       $c->update = TIME;\r
+                       $c->document_page = $page;\r
                        $fp = fopen($csv, 'rb');\r
                        $links = array();\r
                        while (true) {\r
@@ -55,7 +61,7 @@ class wsDAODocument extends commonDAO {
                                                if (in_array($k, $booleans)) {\r
                                                        $link[$col] = ($line[$k] == '1');\r
                                                } else {\r
-                                                       $link[$col] = $line[$k];\r
+                                                       $link[$col] = utf8_encode($line[$k]);\r
                                                }\r
                                        } else {\r
                                                $link[$col] = $default;\r
@@ -65,9 +71,19 @@ class wsDAODocument extends commonDAO {
                                $link['page'] = $page;\r
                                $links[] = $link;\r
                        }\r
-                       $c->links = json_encode($links);\r
-                       $c->insert();\r
+                       $json = json_encode($links);\r
+                       $c->links = $json;\r
+                       try {\r
+                               $c->insert();\r
+                       }\r
+                       catch(Exception $e) {\r
+                               fb($e);\r
+                       }\r
+\r
+                       $log[] = 'Added ' . count($links) . ' links';\r
                }\r
+\r
+               return implode("\n", $log);\r
        }\r
 \r
        public function setLinksAndRulers($book_id, $links, $rulers)\r
@@ -125,29 +141,6 @@ class wsDAODocument extends commonDAO {
                $xml = simplexml_load_file('http://ws.fluidbook.com/books/' . $book_id . '/data/links.xml');\r
                $links = $xml->xpath('//oneLink');\r
 \r
-               /*res.type = type;\r
-                       res.page = page;\r
-                       if (page == 0 && rect.x<pageWidth) {\r
-                               res.page = 1;\r
-                               res.left -= pageWidth;\r
-                       }else if(rect.x>=pageWidth && page!=totalPages){\r
-                               res.left = rect.x-pageWidth;\r
-                               res.page++;\r
-                       }else {\r
-                               res.left = rect.x;\r
-                       }\r
-                       res.top = rect.y;\r
-                       res.width = rect.width;\r
-                       res.height = rect.height;\r
-                       res.to = to;\r
-                       res.target = target;\r
-                       res.video_loop = video_loop;\r
-                       res.video_auto_start = video_auto_start;\r
-                       res.video_controls = video_controls;\r
-                       res.video_sound_on = video_sound_on;\r
-                       res.infobulle = infobulle;\r
-                       res.numerotation = numerotation;*/\r
-\r
                $res = array();\r
                $lpages = array();\r
                foreach($links as $l) {\r
@@ -238,7 +231,7 @@ class wsDAODocument extends commonDAO {
                $rulers = array();\r
 \r
                $sql = 'SELECT *,CONCAT(document_id,\',\',document_page) AS doc_page FROM document_links WHERE (document_id,document_page) IN(' . implode(',', $couples) . ') ORDER BY `update` DESC, FIELD(doc_page,' . implode(',', $couples_order) . ') LIMIT ' . count($pages);\r
-               fb($sql);\r
+\r
                $r = $this->con->select($sql);\r
                $i = 1;\r
                while ($r->fetch()) {\r
index 1b1082a8ab44d8e409c7f2be2524a76d721d7b28..b9cfc2df86ad5bddd440a5b03e42d90d40a8dac5 100644 (file)
@@ -132,7 +132,7 @@ class wsDocument extends cubeMetier {
                                        $ttf2eot->setPath(CONVERTER_PATH);\r
                                        $ttf2eot->setManualArg('< ' . $this->out . '/fonts/web/' . $fname . '.ttf');\r
                                        $ttf2eot->execute();\r
-                                       $this->addToLog($ttf2eot);\r
+                                       $this->addToLog($ttf2eot,false);\r
                                } else {\r
                                        $fontforge = new cubeCommandLine('convert.pe');\r
                                        $fontforge->setPath(CONVERTER_PATH);\r