RewriteRule ^viewer/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/fluidbook.js$ fluidbook/compile/fluidbook.js [L]\r
RewriteRule ^viewer/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/(.+)$ fluidbook/books/final/$1/$4 [L]\r
\r
+ RewriteRule ^viewer1/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/index.html$ viewer1/$1_$2_$3/index [L]\r
+ RewriteRule ^viewer1/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/fluidbook.js$ fluidbook/compile/fluidbook.js [L]\r
+ RewriteRule ^viewer1/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/(.+)$ fluidbook/books/finalv1/$1/$4 [L]\r
+\r
RewriteRule ^vieweru/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/index.html$ vieweru/$1_$2_$3/index [L]\r
RewriteRule ^vieweru/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/index.swf$ fluidbook/compile/_unprotected/index.swf [L]\r
RewriteRule ^vieweru/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/player.swf$ fluidbook/compile/_unprotected/player.swf [L]\r
$data['code_postal'] = $entreprise->code_postal;\r
$data['ville'] = $entreprise->ville;\r
$data['pays'] = $entreprise->pays;\r
- $data['site']=$entreprise->site;\r
+ $data['site'] = $entreprise->site;\r
$data['grade'] = 0;\r
$daoClient = new commonDAOClient($core->con);\r
try {\r
$book = $dao->setStatus($book_id, 1);\r
}\r
\r
+ if ($version == 'v2') {\r
+ $version = 'html';\r
+ } else if ($version == 'online') {\r
+ if ($book->parametres->version == '1') {\r
+ $version = 'v1';\r
+ } elseif ($book->parametres->version == '2') {\r
+ $version = 'html';\r
+ }\r
+ }\r
+\r
if (!wsDroits::admin()) {\r
if ($book->status < 1) {\r
$popup = commonAjax::form('downbook/' . $book_id . '/' . $version, __('Téléchargement du Fluidbook'), wsUrl::valideDownload($book_id, $version), __('Télécharger'), 2, '', '', true);\r
$datas['code_postal'] = $_POST['code_postal'];\r
$datas['ville'] = $_POST['ville'];\r
$datas['pays'] = $_POST['pays'];\r
- $datas['site']=$_POST['site'];\r
+ $datas['site'] = $_POST['site'];\r
if ($_POST['rs'] == '') {\r
$datas['nom'] = $_POST['prenom'] . ' ' . $_POST['nom'];\r
} else {\r
public static function contextBookDownload($id, $droits) {\r
global $core;\r
\r
+ $chooseVersion = wsDroits::admin();\r
+\r
+ if ($chooseVersion) {\r
+ $default = ' (' . __('Default') . ')';\r
+ } else {\r
+ $default = '';\r
+ }\r
+\r
$versions = array();\r
- $versions['html'] = array('title' => __('Version online'), 'icon' => cubeMedia::silk('page_world.png'));\r
- if (wsDroits::admin()) {\r
+ $versions['online'] = array('title' => __('Version online') . $default, 'icon' => cubeMedia::silk('page_world.png'));\r
+ if ($chooseVersion) {\r
$versions['v1'] = array('title' => __('Version online') . ' - V1', 'icon' => cubeMedia::silk('page_white_world.png'));\r
+ $versions['v2'] = array('title' => __('Version online') . ' - V2', 'icon' => cubeMedia::silk('page_white_world.png'));\r
}\r
$versions['win-exe'] = array('title' => __('Version offline') . ' - ' . __('Executable Windows'), 'icon' => cubeMedia::silk('application_view_tile.png'));\r
$versions['win-ins'] = array('title' => __('Version offline') . ' - ' . __('Installeur Auto-executable Windows'), 'icon' => cubeMedia::silk('application_view_tile.png'));\r
\r
if (wsDroits::admin()) {\r
$viewers = array('viewer' => array('title' => __('Version Flash'), 'icon' => cubeMedia::image(IMG . '/flash.png')),\r
- 'viewerh' => array('title' => __('Version HTML5'), 'icon' => cubeMedia::image(IMG . '/html5.png')),\r
- 'vieweru' => array('title' => __('Version Flash') . ' (' . __('debuggage') . ')', 'icon' => cubeMedia::image(IMG . '/flashbug.png')),\r
- 'viewerhu' => array('title' => __('Version HTML5') . ' (' . __('debuggage') . ')', 'icon' => cubeMedia::image(IMG . '/html5bug.png')));\r
+ 'viewerh' => array('title' => __('Version HTML5'), 'icon' => cubeMedia::image(IMG . '/html5.png')),\r
+ 'vieweru' => array('title' => __('Version Flash') . ' (' . __('debuggage') . ')', 'icon' => cubeMedia::image(IMG . '/flashbug.png')),\r
+ 'viewerhu' => array('title' => __('Version HTML5') . ' (' . __('debuggage') . ')', 'icon' => cubeMedia::image(IMG . '/html5bug.png')),\r
+ 'viewer1' => array('title' => __('Version 1'), 'icon' => cubeMedia::image(IMG . '/flash.png'))\r
+ );\r
}\r
\r
$res = '<div class="contextMenu viewbookContextMenu" id="' . $id . '">';\r
exit;\r
}\r
\r
+ public static function viewer1($args) {\r
+ $args = cubePage::getArgs($args);\r
+\r
+ $wmode = isset($args[1]) ? $args[1] : '';\r
+\r
+ $e = explode('_', $args[0]);\r
+ $newurl = null;\r
+ if (count($e) == 2 || $e[2] < TIME - 10) {\r
+ $e[2] = TIME;\r
+ http::redirect(SITE_PATH . 'viewer1/' . implode('_', $e) . '/' . $wmode);\r
+ exit;\r
+ }\r
+\r
+ $book_id = $e[0];\r
+\r
+ $wmode = $wmode != '' ? $wmode : 'default';\r
+\r
+ echo self::commonViewer($book_id, $e[1], false, $wmode, $newurl, '1');\r
+ }\r
+\r
public static function viewer($args) {\r
$args = cubePage::getArgs($args);\r
\r
echo self::commonViewer($book_id, $e[1], false, $wmode, $newurl);\r
}\r
\r
- public static function commonViewer($book_id, $hash, $standalone = false, $wmode = 'default', $fps = false) {\r
+ public static function commonViewer($book_id, $hash, $standalone = false, $wmode = 'default', $fps = false, $version = 2) {\r
if (!defined('MINIMIZE_JS')) {\r
define('MINIMIZE_JS', false);\r
}\r
global $meta;\r
global $jsvar;\r
\r
+ if ($version == 2) {\r
+ $flashVersion = '10.0.22';\r
+ } else {\r
+ $flashVersion = '8';\r
+ }\r
+\r
cubePage::swfobject(2);\r
\r
$dao = new wsDAOBook($core->con);\r
$res.='} else if(isBadMobile()) {' . "\n";\r
$res.="\t" . $redirectPDF . "\n";\r
$res.='} else {' . "\n";\r
- $res .= "\t" . 'swfobject.embedSWF("index.swf", "fluidbook", "100%", "100%", "10.0.22",';\r
+ $res .= "\t" . 'swfobject.embedSWF("index.swf", "fluidbook", "100%", "100%", "' . $flashVersion . '",';\r
$res .= '"", ' . json_encode($fv) . ',';\r
$res .= '{"allowScriptAccess":"always","quality":"high","scale":"noscale","wmode":getWmode(),"allowFullScreen":"true"},{"bgcolor":"#' . $theme->parametres->loadingBackColor . '"}';\r
$res .= ');' . "\n";\r
}\r
\r
public function compile($book_id, $version = 3, $complete = false) {\r
- if ($version == 3) {\r
- return $this->compile3($book_id, $complete);\r
- }\r
+\r
+ $this->compile3($book_id, $complete);\r
+ $this->compile1($book_id);\r
+\r
$this->touchCompile($book_id);\r
}\r
\r
+ public function compile1($book_id) {\r
+ $finalDir = WS_BOOKS . '/finalv1/' . $book_id . '/';\r
+ $packager = new wsPackagerV1($book_id, $finalDir, false);\r
+ $packager->makePackage(false);\r
+ \r
+ mkdir($finalDir,0777,true);\r
+ \r
+ fb('compile1');\r
+ }\r
+\r
public function compile3($book_id, $complete) {\r
$res = '';\r
\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', false,false);\r
- $flex->addVariable('textes', $textes, false, true, 'JSONObject', false,false);\r
+ $flex->addVariable('index', $index, false, true, 'JSONObject', false, false);\r
+ $flex->addVariable('textes', $textes, false, true, 'JSONObject', false, false);\r
\r
$rasterized = array();\r
$sizes = array();\r
if (is_null($this->parent)) {\r
return;\r
}\r
+ $this->fields['version'] = array('type' => 'combo', 'default' => '2', 'editable' => true, 'label' => __('Version'), 'datas' => array('1' => '1', '2' => '2'), 'grade' => 3);\r
$this->fields['title'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Titre de la publication"));\r
$this->fields['url_link'] = array('type' => 'text', 'default' => 'http://', 'editable' => true, 'label' => __("URL du lien de retour au site"));\r
$this->fields['signature'] = array('type' => 'combo', 'default' => '1', 'editable' => true, 'label' => __('Signature'), 'grade' => 3, 'datas' => wsDroits::getSignatures());\r
$this->forms['important'] = array('label' => __('Description de la publication'),\r
- 'fieldsnames' => array('title', 'url_link', 'signature'));\r
+ 'fieldsnames' => array('version', 'title', 'url_link', 'signature'));\r
// .\r
// .\r
$this->fields['friend'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Envoyer à un ami'));\r
$this->fields['widgetEnd'] = array('type' => 'integer', 'default' => 8, 'editable' => true, 'label' => __('Page de fin'), 'grade' => 3);\r
$this->forms['widget'] = array('label' => __('Widget') . ' (' . __('Mini Fluidbook') . ')',\r
'fieldsnames' => array('widget', 'widgetCover', 'widgetSize', 'widgetQuality', 'widgetStart', 'widgetEnd'));\r
+\r
+ $this->fields['extras'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Extras'), 'grade' => 5);\r
+ $this->fields['v1SWF'] = array('type' => 'freefile', 'default' => '', 'editable' => true,\r
+ 'label' => __('Index.swf spécifique'), 'grade' => 5, 'fileFilter' => $swfFilter);\r
+ $this->forms['v1'] = array('label' => __('Options spécifiques au fluidbook version 1'),\r
+ 'fieldsnames' => array('extras', 'v1SWF'));\r
}\r
\r
}\r
\r
protected $origHTML;\r
\r
- public function __construct($book_id) {\r
- parent::__construct($book_id);\r
+ public function __construct($book_id, $vdir, $whole) {\r
+ parent::__construct($book_id, $vdir, $whole);\r
$this->version = 'html';\r
}\r
\r
}\r
\r
public function prepareHTML5() {\r
+ if (!$this->whole) {\r
+ return;\r
+ }\r
$dest = $this->vdir . 'm';\r
mkdir($dest, 0777, true);\r
\r
protected $daoBook;\r
protected $zip;\r
protected $workingDir;\r
+ protected $whole = true;\r
\r
public static function package($book_id, $version, $zip = true) {\r
global $packager;\r
return $packager->makePackage($zip);\r
}\r
\r
- public function __construct($book_id) {\r
+ public function __construct($book_id, $vdir = null, $whole = true) {\r
global $core;\r
\r
$this->book_id = $book_id;\r
\r
+ $this->vdir = $vdir;\r
$this->dir = WS_SHM . '/packager/' . $book_id . '/';\r
+ $this->whole = $whole;\r
\r
if (!file_exists($this->dir)) {\r
mkdir($this->dir, 0777, true);\r
}\r
\r
protected function zip($zipfile = null) {\r
+ if (!$this->whole) {\r
+ return;\r
+ }\r
$url = $this->getURLBase('zip');\r
$final = $this->getPathBase('zip');\r
$rename = false;\r
}\r
\r
protected function initTempDir() {\r
- $this->vdir = $this->dir . $this->version . '/';\r
+ if (is_null($this->vdir)) {\r
+ $this->vdir = $this->dir . $this->version . '/';\r
+ }\r
+ fb($this->vdir);\r
$this->cleanVdir();\r
mkdir($this->vdir . '/data', 0777, true);\r
}\r
}\r
\r
public function __destruct() {\r
- $this->cleanVdir();\r
+ if ($this->whole) {\r
+ $this->cleanVdir();\r
+ }\r
}\r
\r
}\r
class wsPackagerV1 extends wsPackagerHTML {
- public function __construct($book_id) {
- parent::__construct($book_id);
+ public function __construct($book_id,$vdir,$whole) {
+ parent::__construct($book_id,$vdir,$whole);
$this->version = 'v1';
}
}
$one->addChild('page', $link['page']);
- $one->addChild('linkTo', $link['to']);
$one->addChild('linkType', $link['type']);
+ $one->addChild('linkTo', $link['to']);
$one->addChild('startX', $link['left']);
$one->addChild('endX', $link['left'] + $link['width']);
$one->addChild('startY', $link['top']);
$n = explode(',', $this->book->numerotation);
$keys = array_keys($n, $page);
if (count($keys)) {
- return $keys[0];
+ return $keys[0]+1;
}
return $default;
}
$core->url->register('editor', 'editor', '^editor/(.*)$', array('wsUrl', 'editor'));
$core->url->register('restoreLinks', 'restoreLinks', '^restoreLinks/(.*)$', array('wsUrl', 'restoreLinks'));
$core->url->register('viewer', 'viewer', '^viewer/(.*)$', array('wsUrl', 'viewer'));
+$core->url->register('viewer1', 'viewer1', '^viewer1/(.*)$', array('wsUrl', 'viewer1'));
$core->url->register('vieweru', 'vieweru', '^vieweru/(.*)$', array('wsUrl', 'vieweru'));
$core->url->register('viewerp', 'viewerp', '^viewerp/(.*)$', array('wsUrl', 'viewerp'));
$core->url->register('viewerh', 'viewerh', '^viewerh/(.*)$', array('wsUrl', 'viewerh'));