]> _ Git - cubeextranet.git/commitdiff
Make a Fluidbook version compatible when opened in a local browser window
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 5 Mar 2015 17:23:03 +0000 (17:23 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 5 Mar 2015 17:23:03 +0000 (17:23 +0000)
fluidbook/compile/_protect/folders.ini
fluidbook/compile/_protect/settings.xml
fluidbook/compile/index.html
inc/ws/Controlleur/class.ws.ajax.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/Util/class.ws.secure.swf.php
inc/ws/Util/packager/_common.php
inc/ws/Util/packager/class.ws.packager.html.php
inc/ws/Util/packager/class.ws.packager.php
inc/ws/Util/packager/class.ws.packager.win.html.php [new file with mode: 0644]

index 417d91ea7257bc7fdeccb46f6491fe09c3c72b8a..1955d6da5bbdd97aac32bc221758808419ba5c8f 100644 (file)
@@ -1,8 +1,8 @@
 [Settings]\r
-LastUsedSwfDir = C:\Users\Vincent\r
+LastUsedSwfDir = H:\Works\fluidbook3d\r
 LastUsedOutputDir = C:\Users\Vincent\r
 LastUsedDeobfuscationDir = C:\Users\Vincent\r
 LastUsedLoaderDir = C:\Users\Vincent\r
 LastUsedProjectDir = H:\Works\cubeExtranet\fluidbook\compile\_protect\r
 LastUsedLibraryDir = C:\Users\Vincent\r
-RecentProjects = H:\Works\cubeExtranet\fluidbook\compile\_protect\fluidbook.sspj
\ No newline at end of file
+RecentProjects = H:\Works\cubeExtranet\fluidbook\compile\_protect\offline.sspj;H:\Works\cubeExtranet\fluidbook\compile\_protect\fluidbook.sspj
\ No newline at end of file
index ded9a1a6f8d89fc5ec732b40d7ce4a9f1db9190b..5388241a030c18676a066ac8797ec79807c7cf8e 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<java version="1.7.0_03" class="java.beans.XMLDecoder">
+<java version="1.8.0_31" class="java.beans.XMLDecoder">
  <object class="secureSWF.userSettings.GuiSettings">
   <void property="adtPath">
    <string></string>
     <void class="java.awt.Point" method="getField">
      <string>x</string>
      <void method="set">
-      <object idref="Point0">
-       <void class="java.awt.Point" method="getField">
-        <string>y</string>
-        <void method="set">
-         <object idref="Point0"/>
-         <int>-8</int>
-        </void>
-       </void>
-      </object>
+      <object idref="Point0"/>
+      <int>-8</int>
+     </void>
+    </void>
+    <void class="java.awt.Point" method="getField">
+     <string>y</string>
+     <void method="set">
+      <object idref="Point0"/>
       <int>-8</int>
      </void>
     </void>
     <void class="java.awt.Dimension" method="getField">
      <string>width</string>
      <void method="set">
-      <object idref="Dimension0">
-       <void class="java.awt.Dimension" method="getField">
-        <string>height</string>
-        <void method="set">
-         <object idref="Dimension0"/>
-         <int>1036</int>
-        </void>
-       </void>
-      </object>
+      <object idref="Dimension0"/>
       <int>1696</int>
      </void>
     </void>
+    <void class="java.awt.Dimension" method="getField">
+     <string>height</string>
+     <void method="set">
+      <object idref="Dimension0"/>
+      <int>1036</int>
+     </void>
+    </void>
    </object>
   </void>
  </object>
index 450d8a6fb6d4acc6dcedc394c7dcb26f4a9da8c3..47953161db73f207a3c4c790316fc750075a2185 100644 (file)
@@ -1,44 +1,57 @@
 <!DOCTYPE html>
 <html>
-       <head>
-               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-               <meta http-equiv="Cache-Control" content="max-age=0">
-               <meta http-equiv="Cache-Control" content="no-cache">
-               <meta http-equiv="Expires" content="0">
-               <meta http-equiv="Expires" content="Tue, 01 Jan 1980 1:00:00 GMT">
-               <meta http-equiv="Pragma" content="no-cache">
-               <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=IE8">
-               <meta name="google" value="notranslate">
-               $favicon
-               $robots
-               $facebook
-               $description
-               $keywords
-               <title>$title</title>
-               <link href="$spstyle.css?junk=$junk" rel="stylesheet" type="text/css">
-               <style type="text/css" media="print">*{ visibility: hidden; display: none }</style>
-               <script type="text/javascript">
-                       FB_DEFAULT_LANG = '$lang';
-                       var backgroundColor = "$bgcolor";
-                       function redirect() {
-                               if (isMobile() || $alwaysHTML5) {
-                                       $redirectMobile
-                               } else if (isBadMobile()) {
-                                       $redirectPDF
-                               } else {
-                                       document.getElementById('fluidbook').style.opacity = 1;
-                                       swfobject.embedSWF("$pathToIndex?junk=$junk", "fluidbook", "100%", "100%", "$flashversion", "", getFlashvars($junk, $fv), {"allowScriptAccess": "always", "quality": "high", "scale": "noscale", "wmode": getWmode(), "allowFullScreen": "true", 'allowFullScreenInteractive': 'true'}, {"bgcolor": "#" + getBackgroundColor()});
-                               }
+<head>
+       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+       <meta http-equiv="Cache-Control" content="max-age=0">
+       <meta http-equiv="Cache-Control" content="no-cache">
+       <meta http-equiv="Expires" content="0">
+       <meta http-equiv="Expires" content="Tue, 01 Jan 1980 1:00:00 GMT">
+       <meta http-equiv="Pragma" content="no-cache">
+       <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=IE8">
+       <meta name="google" value="notranslate">
+       $favicon
+       $robots
+       $facebook
+       $description
+       $keywords
+       <title>$title</title>
+       <link href="$spstyle.css?junk=$junk" rel="stylesheet" type="text/css">
+       <style type="text/css" media="print">* {
+               visibility: hidden;
+               display: none
+       }</style>
+       <script type="text/javascript">
+               FB_DEFAULT_LANG = '$lang';
+               var backgroundColor = "$bgcolor";
+               function redirect() {
+                       if (isMobile() || $alwaysHTML5) {
+                               $redirectMobile
+                       } else if (isBadMobile()) {
+                               $redirectPDF
+                       } else {
+                               document.getElementById('fluidbook').style.opacity = 1;
+                               swfobject.embedSWF("$pathToIndex?junk=$junk", "fluidbook", "100%", "100%", "$flashversion", "", getFlashvars($junk, $fv), {
+                                       "allowScriptAccess": "always",
+                                       "quality": "high",
+                                       "scale": "noscale",
+                                       "wmode": getWmode(),
+                                       "allowFullScreen": "true",
+                                       "allowNetworking": "$allowNetworking",
+                                       'allowFullScreenInteractive': 'true'
+                               }, {"bgcolor": "#" + getBackgroundColor()});
                        }
-               </script>
-               <script type="text/javascript" src="$spfluidbook.js?junk=$junk"></script>
-               $ga
-               $redirectScript
-       </head>
-       <body onload="ready();">
-               <div id="fluidbook" style="opacity:0;">
-                       <div style="padding:20px;text-align:center;"><a class="getflash" href="http://get.adobe.com/flashplayer/" target="_blank" style="background-image:url('$pathToGetflash');"></a></div>
-                       <div style="padding:20px;">$alt</div>
-               </div>
-       </body>
+               }
+       </script>
+       <script type="text/javascript" src="$spfluidbook.js?junk=$junk"></script>
+       $ga
+       $redirectScript
+</head>
+<body onload="ready();">
+<div id="fluidbook" style="opacity:0;">
+       <div style="padding:20px;text-align:center;"><a class="getflash" href="http://get.adobe.com/flashplayer/"
+                                                       target="_blank"
+                                                       style="background-image:url('$pathToGetflash');"></a></div>
+       <div style="padding:20px;">$alt</div>
+</div>
+</body>
 </html>
\ No newline at end of file
index 0fb3ae2daccd524bbaa01636b2ed6cbda9f661a8..3c607d7e972f4d2bdfb342cb03c25cfb75006a08 100644 (file)
@@ -24,7 +24,7 @@ class wsAjax extends cubeAjax {
        public static function saveClient($args, &$x) {
                global $core;
                $dao = new commonDAOEntreprise($core->con);
-// Creation de l'entreprise
+               // Creation de l'entreprise
                if ($_POST['entreprise_id'] == 'new') {
                        if (!isset($_POST['ws_admin']) || !$_POST['ws_admin']) {
                                $_POST['ws_admin'] = $core->user->utilisateur_id;
@@ -35,7 +35,7 @@ class wsAjax extends cubeAjax {
                        $_POST['ws_admin'] = $core->user->utilisateur_id;
                }
                $entreprise = $dao->sauve($_POST);
-// Si c'est une nouvelle entreprise, on crée également le contact
+               // Si c'est une nouvelle entreprise, on crée également le contact
                if ($_POST['entreprise_id'] == 'new') {
                        $data = $_POST['contact'];
                        $data['entreprise'] = $entreprise->entreprise_id;
@@ -450,13 +450,13 @@ class wsAjax extends cubeAjax {
                if (!self::valideDemandeDevis($x)) {
                        return;
                }
-// L'utilisateur est-il déjà dans la base ?
+               // L'utilisateur est-il déjà dans la base ?
                $daoUtilisateur = new commonDAOUtilisateur($core->con);
                $utilisateur = $daoUtilisateur->selectByEmail($_POST['email']);
                if ($utilisateur != null) {
                        $utilisateur_id = $utilisateur->utilisateur_id;
                } else {
-// Création de l'entreprise
+                       // Création de l'entreprise
                        $daoEntreprise = new commonDAOEntreprise($core->con);
                        $datas = array();
                        $datas['entreprise_id'] = 'new';
@@ -474,7 +474,7 @@ class wsAjax extends cubeAjax {
                        $datas['ws_grade'] = 1;
                        $datas['ws_admin'] = 1;
                        $entreprise = $daoEntreprise->sauve($datas);
-// Création de l'utilisateur
+                       // Création de l'utilisateur
                        $datas = array();
                        $datas['utilisateur_id'] = 'new';
                        $datas['prenom'] = $_POST['prenom'];
@@ -509,21 +509,21 @@ class wsAjax extends cubeAjax {
                $daoDemande->sauve($datas);
 
                $fields = array('prenom' => 'Prenom',
-                       'nom' => 'Nom',
-                       'email' => 'E-mail',
-                       'telephone' => 'Telephone',
-                       'rs' => 'Société',
-                       'site' => 'Site web',
-                       'adresse' => 'Adresse',
-                       'code_postal' => 'Code postal',
-                       'ville' => 'Ville',
-                       'pays' => 'Pays',
-                       'produits' => 'Type',
-                       'lang' => 'Langue du visiteur',
-                       'nombre_liens' => 'Liens',
-                       'nombre_pages' => 'Pages',
-                       'nombre_langues' => 'Langues',
-                       'detail' => 'Commentaires');
+                               'nom' => 'Nom',
+                               'email' => 'E-mail',
+                               'telephone' => 'Telephone',
+                               'rs' => 'Société',
+                               'site' => 'Site web',
+                               'adresse' => 'Adresse',
+                               'code_postal' => 'Code postal',
+                               'ville' => 'Ville',
+                               'pays' => 'Pays',
+                               'produits' => 'Type',
+                               'lang' => 'Langue du visiteur',
+                               'nombre_liens' => 'Liens',
+                               'nombre_pages' => 'Pages',
+                               'nombre_langues' => 'Langues',
+                               'detail' => 'Commentaires');
                $mail = new cubeMail();
                $mail->charset = 'UTF-8';
                $mail->from = $_POST['prenom'] . ' ' . $_POST['nom'] . '<' . $_POST['email'] . '>';
@@ -574,7 +574,7 @@ class wsAjax extends cubeAjax {
                        $_POST['site'] = $_POST['site_internet'];
                }
                file_put_contents(ROOT . '/cache/demandeDevis.txt', print_r($_POST, true));
-// Validation des champs de formulaires
+               // Validation des champs de formulaires
                $ok = true;
                return $ok;
        }
@@ -643,14 +643,14 @@ class wsAjax extends cubeAjax {
                } elseif ($demande->status > 1) {
                        $res = __("Cette demande est actuellement en cours de traitement");
                } else {
-// On place la demande comme en cours d'édition
+                       // On place la demande comme en cours d'édition
                        $dao->setAdministrateur($demande->demande_id, $core->user->utilisateur_id);
 
-// On vérifie que l'utilisateur n'est pas déjà géré par un revendeur
+                       // On vérifie que l'utilisateur n'est pas déjà géré par un revendeur
                        $demandeur = $daoUtilisateur->selectById($demande->utilisateur, 'utilisateurs_entreprise');
                        $administrateurs = $daoUtilisateur->selectWSAdministrateursId();
                        if (!is_null($demandeur->ws_admin) && !in_array($demandeur->ws_admin, $administrateurs)) {
-// Si déjà géré par un revendeur
+                               // Si déjà géré par un revendeur
                                $revendeur = $daoUtilisateur->selectById($demandeur->ws_admin, 'utilisateurs_entreprise');
                                $actions[__('Je confie la demande à') . ' ' . $revendeur->rs . ' (' . $revendeur->prenom . ' ' . $revendeur->nom . ')'] = $demandeur->ws_admin;
                        } else {
@@ -832,17 +832,17 @@ class wsAjax extends cubeAjax {
                $rlinks = array();
                foreach ($links as $k => $link) {
                        if ($link['page'] >= $from) {
-                               $link['page']+=$offset;
+                               $link['page'] += $offset;
                        }
                        if ($internal && $link['type'] == 5) {
                                if ($link['numerotation'] == 'physical') {
                                        if ($link['to'] >= $from) {
-                                               $link['to']+=$offset;
+                                               $link['to'] += $offset;
                                        }
                                } else {
                                        $ph = array_search($link['to'], $numerotation) + 1;
                                        if ($ph >= $from) {
-                                               $ph+=$offset;
+                                               $ph += $offset;
                                                $vi = $numerotation[($ph - 1)];
                                                $link['to'] = $vi;
                                        }
@@ -855,7 +855,7 @@ class wsAjax extends cubeAjax {
                $rrulers = array();
                foreach ($rulers as $k => $ruler) {
                        if ($ruler['page'] > $from) {
-                               $ruler['page']+=$offset;
+                               $ruler['page'] += $offset;
                        }
                        $rrulers[$k] = $ruler;
                }
@@ -889,22 +889,23 @@ class wsAjax extends cubeAjax {
        public static function formExportBook($book_id) {
                global $core;
                $choices = array(__('Télécharger') => 'download',
-                       __("Installer sur le serveur d'hébergement") => 'install_hosting',
-                       __("Installer sur l'espace de références") => 'install_references',
-                       __('Installer sur un serveur distant') => 'install_ftp',
-                       __('Envoyer vers un projet Phonegap Android') => 'phonegap_android',
-                       __('Envoyer vers un projet Phonegap iOS') => 'phonegap_ios'
+                                __("Installer sur le serveur d'hébergement") => 'install_hosting',
+                                __("Installer sur l'espace de références") => 'install_references',
+                                __('Installer sur un serveur distant') => 'install_ftp',
+                                __('Envoyer vers un projet Phonegap Android') => 'phonegap_android',
+                                __('Envoyer vers un projet Phonegap iOS') => 'phonegap_ios'
                );
 
                $formatInstall = array('online' => false,
-                       'v1' => false,
-                       'html' => false,
-                       'v2' => false,
-                       'win-exe' => 'zip',
-                       'win-ins' => 'exe',
-                       'mac-exe' => 'zip',
-                       'win-cd' => 'zip',
-                       'phonegap' => 'zip');
+                                      'v1' => false,
+                                      'html' => false,
+                                      'v2' => false,
+                                      'win-exe' => 'zip',
+                                      'win-ins' => 'exe',
+                                      'win-html' => 'zip',
+                                      'mac-exe' => 'zip',
+                                      'win-cd' => 'zip',
+                                      'phonegap' => 'zip');
 
                $defaultVersion = isset($_POST['version']) ? $_POST['version'] : 'online';
                $version = '<tr><td class="right">' . __('Version') . '</td><td>' . form::combo('version', wsUrl::getFluidbookVersions(true), $defaultVersion) . '</td></tr>';
@@ -933,7 +934,7 @@ class wsAjax extends cubeAjax {
                                $datas = json_decode($book->exportdatas, true);
                        }
 
-                       $res.=$version;
+                       $res .= $version;
 
                        if (!isset($datas[$defaultAction][$defaultVersion])) {
                                $datas[$defaultAction][$defaultVersion] = array('dir' => '', 'file' => '');
@@ -979,7 +980,7 @@ class wsAjax extends cubeAjax {
 
                        $res .= '<tr><td class="right"><em>' . $s . '</em></td><td>' . form::field(array('destination[dir]', 'destination'), 50, 128, $defaultDestination['dir']) . ' / ' . $destinationFile . '</td></tr>';
                } else {
-                       $res.=$version;
+                       $res .= $version;
                }
 
                $res .= '<tr><td colspan="2" class="right">' . form::hidden('changed', '') . '<a href="#" class="submit">' . $core->typo->BoutonOK(__('Exporter')) . '</a></td></tr>';
@@ -1001,7 +1002,7 @@ class wsAjax extends cubeAjax {
 
                $env = Zend_Mobile_Push_Apns::SERVER_SANDBOX_URI;
 
-// Notifications
+               // Notifications
 
                $apns = new Zend_Mobile_Push_Apns();
                if ($env == Zend_Mobile_Push_Apns::SERVER_SANDBOX_URI) {
index fa9c637e0dc8a6f3f8b8c17f2e1d049b94afb98e..5db03571da819c390ab9309c14d5885727f209bf 100644 (file)
@@ -490,6 +490,7 @@ class wsUrl {
                $versions['win-ins'] = array('title' => __('Version offline') . ' - ' . __('Installeur Auto-executable Windows'), 'icon' => cubeMedia::silk('application_view_tile.png'));
                $versions['mac-exe'] = array('title' => __('Version offline') . ' - ' . __('Exécutable Mac OS X'), 'icon' => cubeMedia::image(IMG . '/macos.png'));
                $versions['win-cd'] = array('title' => __('Version offline') . ' - ' . __('CD-ROM') . ' / ' . __('Clé USB'), 'icon' => cubeMedia::silk('cd.png'));
+               $versions['win-html'] = array('title' => __('Version offline') . ' - ' . __('HTML'), 'icon' => cubeMedia::silk('cd.png'));
                if ($droits->admin) {
                        $versions['phonegap'] = array('title' => __('Version offline') . ' - ' . __('Application mobile'), 'icon' => cubeMedia::image(IMG . '/phonegap.png'));
                }
index b94227ce755371b3be067f77e5ce0130b70e9cc2..8c9a9be0ea222f8f5eb0340b457069c2c75b7372 100644 (file)
@@ -1,4 +1,5 @@
 <?php\r
+\r
 class wsSecureSWF {\r
        public static $files = array('index.swf', 'player.swf');\r
        public static $configOriginal;\r
@@ -6,20 +7,22 @@ class wsSecureSWF {
        public static $protected;\r
        public static $unprotected;\r
 \r
-       public static function checkProtectedSWF()\r
-       {\r
+       public static function _checkProtectedSWF($type) {\r
+               if ($type == 'offline') {\r
+                       self::$files = array('offline.swf');\r
+               } else if ($type == 'fluidbook') {\r
+                       self::$files = array('index.swf', 'player.swf');\r
+               }\r
                self::$protected = WS_COMPILE_ASSETS . '/';\r
                self::$unprotected = WS_COMPILE_ASSETS . '/_unprotected/';\r
-               self::$configOriginal = WS_COMPILE_ASSETS . '/_protect/fluidbook.sspj';\r
-               self::$configLocal = WS_COMPILE_ASSETS . '/_protect/_fluidbook.sspj';\r
+               self::$configOriginal = WS_COMPILE_ASSETS . '/_protect/' . $type . '.sspj';\r
+               self::$configLocal = WS_COMPILE_ASSETS . '/_protect/_' . $type . '.sspj';\r
 \r
                $protect = false;\r
-\r
                self::checkConfigFile();\r
-\r
                $configmtime = filemtime(self::$configLocal);\r
 \r
-               foreach(self::$files as $f) {\r
+               foreach (self::$files as $f) {\r
                        $p = self::$protected . '/' . $f;\r
                        $u = self::$unprotected . '/' . $f;\r
                        $pfilemtime = filemtime($p);\r
@@ -33,24 +36,27 @@ class wsSecureSWF {
                        return;\r
                }\r
 \r
-               self::protectFiles();\r
+               self::protectFiles($type);\r
        }\r
 \r
-       public static function checkConfigFile()\r
-       {\r
+       public static function checkProtectedSWF() {\r
+               self::_checkProtectedSWF('fluidbook');\r
+               self::_checkProtectedSWF('offline');\r
+       }\r
+\r
+       public static function checkConfigFile() {\r
                if (!file_exists(self::$configLocal) || filemtime(self::$configOriginal) > filemtime(self::$configLocal)) {\r
                        self::updateConfigFile();\r
                }\r
        }\r
 \r
-       protected static function updateConfigFile()\r
-       {\r
+       protected static function updateConfigFile() {\r
                $x = simplexml_load_file(self::$configOriginal);\r
                // Remplace les chemins par les chemins des fichiers sur le serveur\r
                self::replacePathFiles($x, 'inputFiles', self::$unprotected);\r
                self::replacePathFiles($x, 'outputFiles', self::$protected);\r
 \r
-               foreach($x->xpath("//void[@property='fileFullName']") as $f) {\r
+               foreach ($x->xpath("//void[@property='fileFullName']") as $f) {\r
                        $fname = trim((string)$f->string);\r
                        $fname = str_replace('\\', '/', $fname);\r
 \r
@@ -63,15 +69,14 @@ class wsSecureSWF {
                file_put_contents(self::$configLocal, $x->asXML());\r
        }\r
 \r
-       protected static function replacePathFiles($x, $property, $dir)\r
-       {\r
+       protected static function replacePathFiles($x, $property, $dir) {\r
                $o1 = $x->xpath("//void[@property='$property']");\r
                $o = array_pop($o1);\r
                $l = simplexml_load_string('<void property="' . $property . '" />');\r
                $a = $l->addChild('array');\r
                $a->addAttribute('class', 'java.lang.String');\r
                $a->addAttribute('length', count(self::$files));\r
-               foreach(self::$files as $k => $f) {\r
+               foreach (self::$files as $k => $f) {\r
                        $v = $a->addChild('void');\r
                        $v->addAttribute('index', $k);\r
                        $s = $v->addChild('string', $dir . $f);\r
@@ -79,8 +84,7 @@ class wsSecureSWF {
                cubeXML::replace($o, $l);\r
        }\r
 \r
-       protected static function protectFiles()\r
-       {\r
+       protected static function protectFiles($type) {\r
                $secureSWF = new cubeCommandLine('secureSWF', null, true);\r
                $secureSWF->setSudo();\r
                $secureSWF->setPath(CONVERTER_PATH);\r
@@ -88,8 +92,6 @@ class wsSecureSWF {
                $secureSWF->setManualArg(self::$protected);\r
                $secureSWF->execute();\r
 \r
-               file_put_contents(WS_COMPILE_ASSETS . '/_protect/secure.log', $secureSWF->commande . "\n\n\n" . $secureSWF->output);\r
+               file_put_contents(WS_COMPILE_ASSETS . '/_protect/secure_' . $type . '.log', $secureSWF->commande . "\n\n\n" . $secureSWF->output);\r
        }\r
 }\r
-\r
-?>
\ No newline at end of file
index bf7d8836bd96d4060887cc098ee3748d19c63c71..db43ba1bc61a7a48cfdb4822093b02ffb553a6a0 100644 (file)
@@ -5,8 +5,8 @@ $__autoload['wsPackagerHTML'] = dirname(__FILE__) . '/class.ws.packager.html.php
 $__autoload['wsPackagerWinEXE'] = dirname(__FILE__) . '/class.ws.packager.win.exe.php';\r
 $__autoload['wsPackagerWinINST'] = dirname(__FILE__) . '/class.ws.packager.win.inst.php';\r
 $__autoload['wsPackagerWinCD'] = dirname(__FILE__) . '/class.ws.packager.win.cd.php';\r
+$__autoload['wsPackagerWinHTML'] = dirname(__FILE__) . '/class.ws.packager.win.html.php';\r
 $__autoload['wsPackagerMacEXE'] = dirname(__FILE__) . '/class.ws.packager.mac.exe.php';\r
 $__autoload['wsPackagerAIR'] = dirname(__FILE__) . '/class.ws.packager.air.php';\r
 $__autoload['wsPackagerV1'] = dirname(__FILE__) . '/class.ws.packager.v1.php';\r
 $__autoload['wsPackagerPhonegap'] = dirname(__FILE__) . '/class.ws.packager.phonegap.php';\r
-?>
\ No newline at end of file
index 06e28fb606d09179a05ce0502d34f02e37c1be8c..3b24de56bbc17e66780deae7afdd1c17cef60869 100644 (file)
@@ -4,6 +4,7 @@ class wsPackagerHTML extends wsPackager {
 
        protected $origHTML;
        protected $_labels = array();
+       protected $_allowNeworking = 'all';
 
        public function __construct($book_id, $vdir = null, $whole = true) {
                parent::__construct($book_id, $vdir, $whole);
@@ -107,20 +108,20 @@ class wsPackagerHTML extends wsPackager {
 
                // Stuffs to replace in html
                $toReplace = array('lang' => strtolower($this->book->lang),
-                       'ga' => $ga,
-                       'facebook' => $facebook,
-                       'bgcolor' => $this->theme->parametres->loadingBackColor,
-                       'redirectMobile' => $redirectMobile,
-                       'redirectPDF' => $redirectPDF,
-                       'junk' => TIME,
-                       'description' => $description,
-                       'robots' => $robots,
-                       'favicon' => $favicon,
-                       'flashversion' => $this->getMinFlashVersion(),
-                       'fv' => json_encode($this->getFlashvars()),
-                       'alwaysHTML5' => $alwaysHTML5,
-                       'keywords' => $keywords);
-
+                                  'ga' => $ga,
+                                  'facebook' => $facebook,
+                                  'bgcolor' => $this->theme->parametres->loadingBackColor,
+                                  'redirectMobile' => $redirectMobile,
+                                  'redirectPDF' => $redirectPDF,
+                                  'junk' => TIME,
+                                  'description' => $description,
+                                  'robots' => $robots,
+                                  'favicon' => $favicon,
+                                  'flashversion' => $this->getMinFlashVersion(),
+                                  'fv' => json_encode($this->getFlashvars()),
+                                  'alwaysHTML5' => $alwaysHTML5,
+                                  'keywords' => $keywords,
+                                  'allowNetworking' => $this->_allowNeworking);
 
 
                $this->origHTML = file_get_contents($this->vdir . '/index.html');
index 47391756371d73e7c8e9ac16ada535f9afa84629..38df7af169277d7a7932e33e035190fd1f2f8ede 100644 (file)
@@ -33,6 +33,8 @@ class wsPackager {
                        $packager = new wsPackagerMacEXE($book_id);
                } elseif ($version == 'v1') {
                        $packager = new wsPackagerV1($book_id);
+               } elseif ($version == 'win-html') {
+                       $packager = new wsPackagerWinHTML($book_id);
                } else if ($version == 'phonegap') {
                        $packager = new wsPackagerPhonegap($book_id);
                }
diff --git a/inc/ws/Util/packager/class.ws.packager.win.html.php b/inc/ws/Util/packager/class.ws.packager.win.html.php
new file mode 100644 (file)
index 0000000..affa763
--- /dev/null
@@ -0,0 +1,12 @@
+<?php\r
+\r
+class wsPackagerWinHTML extends wsPackagerHTML {\r
+       protected $_allowNeworking = 'internal';\r
+\r
+       protected function copyFluidbookFiles() {\r
+               parent::copyFluidbookFiles();\r
+               unlink($this->vdir . '/index.swf');\r
+               unlink($this->vdir . '/player.swf');\r
+               copy(WS_COMPILE_ASSETS . '/offline.swf', $this->vdir . '/index.swf');\r
+       }\r
+}
\ No newline at end of file