$mail->to = 'tech@fluidbook.com';
$mail->subject = '[Fluidbook Workshop] Fluidbook consulté via l\'url publique';
$mail->body = 'Le fluidbook suivant a été consulté ' . $m . ' fois (et ' . $r->demo_counter . ' au total) via l\'url publique : ' . "\r\n" .
- 'Fluidbook # ' . $book_id . ' - ' . $r->nom;
+ 'Fluidbook # ' . $book_id . ' - ' . $r->nom;
$mail->send();
}
$num = '';
}
$pages[$r->book_page] = array('document_id' => $r->document_id,
- 'document_page' => $r->document_page,
- 'version' => $r->version,
- 'defaultNum' => $num,
- 'nb_pages' => $r->doc_pages
+ 'document_page' => $r->document_page,
+ 'version' => $r->version,
+ 'defaultNum' => $num,
+ 'nb_pages' => $r->doc_pages
);
if ($conversion) {
}
public function setChapters($book_id, $json) {
- $chapters = json_decode($json, TRUE);
+ $chapters = json_decode($json, true);
$res = array();
foreach ($chapters as $c) {
$c['label'] = trim($c['label']);
- $n = (string) $c['page'];
+ $n = (string)$c['page'];
$c['label'] = trim(preg_replace('|\s+' . $n . '$|iu', '', $c['label']));
$res[] = $c;
}
}
-
$c1->links = $c->specialLinks = $links;
$c1->rulers = $c->specialRulers = $rulers;
$c1->update = $c->changedate = TIME;
$chapters = $xml->xpath('//chapters');
foreach ($chapters as $ch) {
$c = array();
- $c['label'] = (string) $ch->txt;
+ $c['label'] = (string)$ch->txt;
- $p = intval((string) $ch->page);
+ $p = intval((string)$ch->page);
if ($p <= 0) {
continue;
}
$c['page'] = $n[$p];
- $c['level'] = intval((string) $ch->level);
+ $c['level'] = intval((string)$ch->level);
$res[] = $c;
}
}
public function isUpToDate($book, $version) {
- $version = (string) $version;
+ $version = (string)$version;
if ($version == '2') {
if (!file_exists(WS_BOOKS . '/final/' . $book->book_id)) {
return false;
return false;
}
} else if ($version == 'html5') {
+ return false;
// HTML5
$checks = array($book->changedate, cubeFiles::filemtimeRecursive(WS_BOOKS . '/working/' . $book->book_id), cubeFiles::filemtimeRecursive(WS_COMPILE_ASSETS . '/_html5'), cubeFiles::filemtimeRecursive(ROOT . '/inc/ws/Util/html5'));
foreach ($checks as $check) {
$tab = array();
$now = array();
while ($r->fetch()) {
- $ref[$r->book_page] = array((int) $r->document_id, (int) $r->document_page);
+ $ref[$r->book_page] = array((int)$r->document_id, (int)$r->document_page);
}
$i = 1;
foreach ($pages as $p) {
- $now[$i] = array((int) $p->document_id, (int) $p->document_page);
+ $now[$i] = array((int)$p->document_id, (int)$p->document_page);
$i++;
}
if ($now != $ref) {
$dir = WS_BOOKS . '/index/' . $book->book_id;
if ($book->parametres->ignoreSearchSeparators != '') {
- $dir.='/' . sha1($book->parametres->ignoreSearchSeparators);
+ $dir .= '/' . sha1($book->parametres->ignoreSearchSeparators);
}
if (!file_exists($dir)) {
mkdir($dir, 0777, true);
}
-
$res = '';
if ($v1) {
fb(time(), 'Compile V1');
- $res.=$this->compile1($book_id, $book, $pages);
+ $res .= $this->compile1($book_id, $book, $pages);
$this->touchCompile($book_id, '1');
}
if ($v2) {
}
if ($html5) {
fb(time(), 'Compile HTML5');
- $res.=$this->compileHTML5($book_id, $book);
+ $res .= $this->compileHTML5($book_id, $book);
$this->touchCompile($book_id, 'html5');
}
if ($v1 || $v2) {
$air = new cubeAIRCompiler($swf . '.swf', '/usr/local/flex/bin', $compilerDir, '2.0');
$air->setApplicationDatas('com.fluidbook' . $book_id, $book->parametres->title, $book->parametres->title, cubeText::str2URL($book->parametres->title), $book->lang);
$air->setInitialWindow($book->parametres->title);
- $res.=$air->compile();
+ $res .= $air->compile();
return $res;
}
$signature = $daoSignature->selectById($book->parametres->signature);
$exportSignature = array('main' => $signature->main,
- 'mainLink' => $signature->mainLink,
- 'partner' => $signature->partner,
- 'partnerLink' => $signature->partnerLink);
+ 'mainLink' => $signature->mainLink,
+ 'partner' => $signature->partner,
+ 'partnerLink' => $signature->partnerLink);
$index = '';
$textes = '';
$langNames[$mlang] = $n;
$cn = cubeCountry::getCountryName($flag, $mlang);
$countryNames[$mlang . '_' . $flag] = $cn;
- $chars.=$n . $cn;
+ $chars .= $n . $cn;
}
$chars = preg_split('/(?<!^)(?!$)/u', $chars);
$i = 0;
$allref = array();
foreach ($xml->item as $item) {
- $ref = (string) $item['reference'];
+ $ref = (string)$item['reference'];
if (isset($allref[$ref])) {
continue;
}
}
-
-
if ($book->parametres->pdfReplace) {
$replace = WS_BOOKS . '/working/' . $book->book_id . '/' . $book->parametres->pdfReplace;
if (file_exists($replace)) {
$res = '';
for ($i = 0; $i < 8; $i++) {
$j = rand(0, 61);
- $res.=$this->base62($j);
+ $res .= $this->base62($j);
}
$r = $this->con->select('SELECT book_id FROM books WHERE cid=\'' . $res . '\'');
if ($r->count() == 0) {
if (isset($tlinks[$infos['document_id']][$infos['document_page']])) {
$l = $tlinks[$infos['document_id']][$infos['document_page']];
foreach ($l as $link) {
- $link = (array) $link;
+ $link = (array)$link;
$link['page'] = $p;
$link['id'] = $i;
if (!isset($link['rot'])) {
'js/widget.js'
);
public $phonegapStandardPlugins = array('ios' => array('ExternalFileUtil'),
- 'android' => array('webintent'));
+ 'android' => array('webintent'));
public $pluginCSS = array();
public $pluginJs = array();
public $htmlmultimedia = array();
$signature = $daoSignature->selectById($this->book->parametres->signature);
$exportSignature = array('main' => $signature->main,
- 'mainLink' => $signature->mainLink,
- 'partner' => $signature->partner,
- 'partnerLink' => $signature->partnerLink);
+ 'mainLink' => $signature->mainLink,
+ 'partner' => $signature->partner,
+ 'partnerLink' => $signature->partnerLink);
$credits = '';
if ($signature->partner != '') {
$credits = '<a href="' . $signature->partnerLink . '" target="_blank">' . $signature->partner . '</a> ';
}
- $credits.='<a href="' . $signature->mainLink . '" target="_blank">' . $signature->main . '</a>';
+ $credits .= '<a href="' . $signature->mainLink . '" target="_blank">' . $signature->main . '</a>';
$hiddenContents = implode("\n", $this->hiddenContents);
$iscript = '';
if (count($this->htmlmultimedia)) {
- $iscript.='<script type="text/javascript">' . "\n";
- $iscript.=implode("\n", $this->htmlmultimedia);
- $iscript.='</script>' . "\n";
+ $iscript .= '<script type="text/javascript">' . "\n";
+ $iscript .= implode("\n", $this->htmlmultimedia);
+ $iscript .= '</script>' . "\n";
}
$script = '';
foreach ($this->pluginJs as $p) {
$script .= '<script type="text/javascript" charset="utf-8" src="' . $p . '"></script>' . "\n";
}
- $script.=$iscript;
+ $script .= $iscript;
$description = '';
$dim = getimagesize($this->themeRoot . '/' . $this->theme->parametres->logoLoader);
if ($dim !== false) {
$this->copy($this->themeRoot . '/' . $this->theme->parametres->logoLoader, $this->vdir . '/data/images/' . $this->theme->parametres->logoLoader);
- $splash.='<div class="logo"><img src="data/images/' . $this->theme->parametres->logoLoader . '" width="' . $dim[0] . '" height="' . $dim[1] . '" alt="" /></div>';
+ $splash .= '<div class="logo"><img src="data/images/' . $this->theme->parametres->logoLoader . '" width="' . $dim[0] . '" height="' . $dim[1] . '" alt="" /></div>';
}
}
$uhtml = str_replace('<!-- $' . $v . ' -->', $$v, $uhtml);
}
- $script.="\n\t\t" . '<script type="text/javascript" charset="utf-8">window.tester = true;</script>';
+ $script .= "\n\t\t" . '<script type="text/javascript" charset="utf-8">window.tester = true;</script>';
$vars = array('titre', 'credits', 'ga', 'style', 'script', 'print', 'hiddenContents', 'splash', 'message');
foreach ($vars as $v) {
$thtml = str_replace('<!-- $' . $v . ' -->', $$v, $thtml);
$cpages[$link->page] = '';
}
if ($link instanceof contentLink) {
- $cpages[$link->page].=$c;
+ $cpages[$link->page] .= $c;
} else {
- $pages[$link->page].=$c;
+ $pages[$link->page] .= $c;
}
if ($link->keep()) {
return;
}
- $this->config->bookmarkGroups[] = array('page' => ($link['page'] ), 'nb' => $link['to'], 'name' => $link['extra']);
+ $this->config->bookmarkGroups[] = array('page' => ($link['page']), 'nb' => $link['to'], 'name' => $link['extra']);
}
protected function writeJs() {
}
if (!$reminimize) {
- if (filemtime(__FILE__) > $mintime) {
+ if (filemtime(__FILE__) > $mintime || filemtime(__DIR__ . 'class.ws.html5.links.php') > $mintime) {
$reminimize = true;
}
}
if ($reminimize) {
$js = '';
foreach ($files as $file) {
- $js.=file_get_contents($this->assets . '/' . $file);
- $js.="\n\n";
+ $js .= file_get_contents($this->assets . '/' . $file);
+ $js .= "\n\n";
}
$tmp = cubeFiles::tempnam();
file_put_contents($tmp, $js);
$arrowsColor = $this->theme->parametres->arrowsColor;
// Set the icon list with the color
$icons = array('nav-bookmark' => $couleurI, 'nav-friend' => $couleurI, 'nav-help' => $couleurI, 'nav-index' => $couleurI, 'nav-sommaire' => $couleurI,
- 'nav-zoomin' => $couleurI, 'nav-zoomout' => $couleurI, 'nav-fullscreen' => $couleurI,
- 'interface-next' => $arrowsColor, 'interface-previous' => $arrowsColor, 'interface-search' => $couleurI, 'interface-back-arrow' => $subTextColor, 'interface-print' => $subTextColor,
- 'interface-down' => $arrowsColor, 'interface-close' => $arrowsColor,
- 'help-fingers' => $couleurI, 'help-mouse' => $couleurI, 'nav-home' => $couleurI, 'nav-archives' => $couleurI, 'nav-map' => $couleurI,
- 'nav-tag' => $couleurI, 'nav-print' => $couleurI, 'nav-friend' => $couleurI,
- 'share-facebook' => $couleurM, 'share-twitter' => $couleurM, 'share-email' => $couleurM, 'share-googleplus' => $couleurM, 'share-linkedin' => $couleurM, 'share-viadeo' => $couleurM,
- 'bookmark-left-off' => $bookmarksDisabledColors, 'bookmark-left-on' => $bookmarksEnabledColors,
- 'bookmark-right-off' => $bookmarksDisabledColors, 'bookmark-right-on' => $bookmarksEnabledColors
+ 'nav-zoomin' => $couleurI, 'nav-zoomout' => $couleurI, 'nav-fullscreen' => $couleurI,
+ 'interface-next' => $arrowsColor, 'interface-previous' => $arrowsColor, 'interface-search' => $couleurI, 'interface-back-arrow' => $subTextColor, 'interface-print' => $subTextColor,
+ 'interface-down' => $arrowsColor, 'interface-close' => $arrowsColor,
+ 'help-fingers' => $couleurI, 'help-mouse' => $couleurI, 'nav-home' => $couleurI, 'nav-archives' => $couleurI, 'nav-map' => $couleurI,
+ 'nav-tag' => $couleurI, 'nav-print' => $couleurI, 'nav-friend' => $couleurI,
+ 'share-facebook' => $couleurM, 'share-twitter' => $couleurM, 'share-email' => $couleurM, 'share-googleplus' => $couleurM, 'share-linkedin' => $couleurM, 'share-viadeo' => $couleurM,
+ 'bookmark-left-off' => $bookmarksDisabledColors, 'bookmark-left-on' => $bookmarksEnabledColors,
+ 'bookmark-right-off' => $bookmarksDisabledColors, 'bookmark-right-on' => $bookmarksEnabledColors
);
$this->config->iconsDimensions = array();
$convert = new cubeCommandLine('composite');
$cmd = '-compose Multiply ';
- $cmd.=$tmp . ' ' . $orig . ' ';
- $cmd.=$this->vdir . '/cover.jpg';
+ $cmd .= $tmp . ' ' . $orig . ' ';
+ $cmd .= $this->vdir . '/cover.jpg';
$convert->setManualArg($cmd);
$convert->execute();
$br = '.background.r' . $r . '{';
if ($ratio != 1) {
- $br.=self::writeCSSUA('transform', 'scale(' . $ratio . ')') . ';';
+ $br .= self::writeCSSUA('transform', 'scale(' . $ratio . ')') . ';';
}
- $br.='width:' . $wr . 'px;height:' . $hr . 'px;}';
+ $br .= 'width:' . $wr . 'px;height:' . $hr . 'px;}';
$res[] = $br;
}
$texts = '.texts{' . self::writeCSSUA('transform-origin', 'top left') . ';';
- $texts.=self::writeCSSUA('transform', 'scale(' . round((1 / $this->multiply) * $cssScale * $this->cssSVGScale, 3) . ')') . ';';
- $texts.='width:' . ($wm / $this->cssSVGScale) . '; max-width:' . ($wm / $this->cssSVGScale) . ';';
- $texts.='height:' . ($hm / $this->cssSVGScale) . '; max-height:' . ($hm / $this->cssSVGScale) . ';';
- $texts.='}';
+ $texts .= self::writeCSSUA('transform', 'scale(' . round((1 / $this->multiply) * $cssScale * $this->cssSVGScale, 3) . ')') . ';';
+ $texts .= 'width:' . ($wm / $this->cssSVGScale) . '; max-width:' . ($wm / $this->cssSVGScale) . ';';
+ $texts .= 'height:' . ($hm / $this->cssSVGScale) . '; max-height:' . ($hm / $this->cssSVGScale) . ';';
+ $texts .= '}';
$res[] = $texts;
// Theme
$shade = '.page .shade{';
- $shade.='opacity:' . ($this->theme->parametres->shadeAlpha / 100) . ';';
- $shade.='}';
+ $shade .= 'opacity:' . ($this->theme->parametres->shadeAlpha / 100) . ';';
+ $shade .= '}';
$res[] = $shade;
// Search field
$searchColor = self::colorToCSS($this->theme->parametres->couleurS);
$searchBackColor = self::colorToCSS($this->theme->parametres->searchFieldColor);
$search = '#q{';
- $search.='color:' . $searchColor . ';';
- $search.='background-color:' . $searchBackColor . ';';
+ $search .= 'color:' . $searchColor . ';';
+ $search .= 'background-color:' . $searchBackColor . ';';
if ($this->theme->parametres->searchShadeAlpha > 0) {
- $search.=self::writeCSSUA('box-shadow', '1px 1px 4px rgba(0,0,0,' . ($this->theme->parametres->searchShadeAlpha / 100) . ')') . ' inset;';
+ $search .= self::writeCSSUA('box-shadow', '1px 1px 4px rgba(0,0,0,' . ($this->theme->parametres->searchShadeAlpha / 100) . ')') . ' inset;';
}
- $search.='}';
- $search.='#searchHints,.hint{color:' . $searchColor . ';background-color:' . $searchBackColor . ';}';
- $search.='.hint:hover{color:' . $searchBackColor . ';background-color:' . $searchColor . ';}';
+ $search .= '}';
+ $search .= '#searchHints,.hint{color:' . $searchColor . ';background-color:' . $searchBackColor . ';}';
+ $search .= '.hint:hover{color:' . $searchBackColor . ';background-color:' . $searchColor . ';}';
$res[] = $search;
// Archives
// Header
$header = 'header{';
- $header.='height:' . $this->theme->parametres->menuHeight . 'px;';
- $header.='background-color:' . self::colorToCSS($this->theme->parametres->menuColor) . ';';
+ $header .= 'height:' . $this->theme->parametres->menuHeight . 'px;';
+ $header .= 'background-color:' . self::colorToCSS($this->theme->parametres->menuColor) . ';';
if ($this->theme->parametres->menuImage != '') {
$this->copy($this->themeRoot . '/' . $this->theme->parametres->menuImage, $this->vdir . '/data/images/' . $this->theme->parametres->menuImage);
- $header.='background-image:url(../images/' . $this->theme->parametres->menuImage . ');';
- $header.='background-repeat:no-repeat;';
- $header.='background-size:100% ' . $this->theme->parametres->menuHeight . 'px;';
+ $header .= 'background-image:url(../images/' . $this->theme->parametres->menuImage . ');';
+ $header .= 'background-repeat:no-repeat;';
+ $header .= 'background-size:100% ' . $this->theme->parametres->menuHeight . 'px;';
}
- $header.='}';
+ $header .= '}';
$res[] = $header;
//Icons
if ($this->theme->parametres->logo) {
$this->copy($this->themeRoot . '/' . $this->theme->parametres->logo, $this->vdir . '/data/images/' . $this->theme->parametres->logo);
$dim = getimagesize($this->vdir . '/data/images/' . $this->theme->parametres->logo);
- $logo.='background-image:url(../images/' . $this->theme->parametres->logo . ');width:' . $dim[0] . 'px;height:' . $dim[1] . 'px;';
+ $logo .= 'background-image:url(../images/' . $this->theme->parametres->logo . ');width:' . $dim[0] . 'px;height:' . $dim[1] . 'px;';
}
- $logo.='}';
+ $logo .= '}';
$res[] = $logo;
// Credits
$res[] = '.mview{background-color:' . $menuColor->toCSS() . ';color:' . $menuTextColor . ';}';
# Inner View
- $res[].='#innerView>div{background-color:' . $menuColor->toCSS() . ';color:' . $menuTextColor . ';}';
- $res[].='form input[type="text"],form input[type="email"]{background-color:' . self::colorToCSS($this->theme->parametres->subFieldColor) . ';color:' . self::colorToCSS($this->theme->parametres->subTextFieldColor) . ';}';
+ $res[] .= '#innerView>div{background-color:' . $menuColor->toCSS() . ';color:' . $menuTextColor . ';}';
+ $res[] .= 'form input[type="text"],form input[type="email"]{background-color:' . self::colorToCSS($this->theme->parametres->subFieldColor) . ';color:' . self::colorToCSS($this->theme->parametres->subTextFieldColor) . ';}';
// Archives
if ($this->book->parametres->externalArchivesBack) {
background-image: linear-gradient(top bottom, $top 0%,$bottom 100%); /* W3C */
}";
- $caption.=".mview .caption a{
+ $caption .= ".mview .caption a{
border:1px solid $border;
}";
$res[] = $caption;
protected function _cssBackground() {
$body = '#background,#splash{';
- $body.='background-color:#' . $this->theme->parametres->backgroundColor . ';';
+ $body .= 'background-color:#' . $this->theme->parametres->backgroundColor . ';';
switch ($this->theme->parametres->repeat) {
case wsTheme::REPEAT:
- $body.='background-repeat:repeat;';
+ $body .= 'background-repeat:repeat;';
break;
case wsTheme::NONE:
- $body.='background-repeat:no-repeat;';
+ $body .= 'background-repeat:no-repeat;';
break;
case wsTheme::RATIO:
- $body.='background-repeat:no-repeat;';
- $body.='background-size:cover;';
+ $body .= 'background-repeat:no-repeat;';
+ $body .= 'background-size:cover;';
break;
case wsTheme::STRETCH:
- $body.='background-repeat:no-repeat;';
- $body.='background-size:100% 100%;';
+ $body .= 'background-repeat:no-repeat;';
+ $body .= 'background-size:100% 100%;';
break;
}
if ($this->theme->parametres->backgroundImage != '') {
}
$this->copy($this->themeRoot . '/' . $this->theme->parametres->backgroundImage, $this->vdir . '/data/images/' . $this->theme->parametres->backgroundImage);
- $body.='background-image:url(../images/' . $this->theme->parametres->backgroundImage . ');';
- $body.='background-position:';
+ $body .= 'background-image:url(../images/' . $this->theme->parametres->backgroundImage . ');';
+ $body .= 'background-position:';
switch ($this->theme->parametres->backgroundVAlign) {
case wsTheme::TOP:
- $body.='top';
+ $body .= 'top';
break;
case wsTheme::MIDDLE:
- $body.='center';
+ $body .= 'center';
break;
case wsTheme::BOTTOM:
- $body.='bottom';
+ $body .= 'bottom';
break;
}
- $body.=' ';
+ $body .= ' ';
switch ($this->theme->parametres->backgroundHAlign) {
case wsTheme::LEFT:
- $body.='left';
+ $body .= 'left';
break;
case wsTheme::CENTER:
- $body.='center';
+ $body .= 'center';
break;
case wsTheme::RIGHT:
- $body.='right';
+ $body .= 'right';
break;
}
- $body.=';';
+ $body .= ';';
}
- $body.='}';
+ $body .= '}';
return $body;
}
public $id;
public $rot;
+ protected $_init;
+
/**
*
* @var wsHTML5Compiler
}
public function __construct($id, $init, &$compiler) {
+ $this->_init = $init;
foreach ($init as $k => $v) {
$this->$k = $v;
}
public function unzipFile($file, $moveAssets = false) {
$fdir = 'data/links/' . $file;
$dir = $this->compiler->vdir . '/' . $fdir;
+ if (file_exists($dir) && is_file($dir)) {
+ unlink($dir);
+ }
if (!file_exists($dir)) {
mkdir($dir, 0777, true);
}
public function getCSSContainer() {
if (!($this instanceof contentLink) && $this->page % 2 == 1) {
$this->page--;
- $this->left+=$this->compiler->width;
+ $this->left += $this->compiler->width;
}
$css = '#l_' . $this->id . '{';
- $css.='left:' . $this->left * $this->getCssScale() . 'px;top:' . $this->top * $this->getCssScale() . 'px;';
- $css.='width:' . $this->width * $this->getCssScale() . 'px;height:' . $this->height * $this->getCssScale() . 'px;';
+ $css .= 'left:' . $this->left * $this->getCssScale() . 'px;top:' . $this->top * $this->getCssScale() . 'px;';
+ $css .= 'width:' . $this->width * $this->getCssScale() . 'px;height:' . $this->height * $this->getCssScale() . 'px;';
if ($this->rot) {
- $css.= wsHTML5Compiler::writeCSSUA('transform', 'rotate(' . $this->rot . 'deg)');
- $css.= wsHTML5Compiler::writeCSSUA('transform-origin', '0% 0%');
+ $css .= wsHTML5Compiler::writeCSSUA('transform', 'rotate(' . $this->rot . 'deg)');
+ $css .= wsHTML5Compiler::writeCSSUA('transform-origin', '0% 0%');
}
- $css.=$this->getCSS();
- $css.='}';
+ $css .= $this->getCSS();
+ $css .= '}';
return $css;
}
}
+class htmlMultimediaPopupLink extends htmlMultimediaPopupImage {
+
+ public function getAdditionnalContent() {
+ $i = $this->_init;
+ $i['inline'] = true;
+
+ $l = wsHTML5Link::getMultimediaInstance($this->id . '_content', $i, $this->compiler);
+ $markup = $l->getHTMLContainer();
+ return ' data-multimedia="' . rawurlencode($markup) . '" ';
+ }
+}
+
+
class htmlMultimediaPopupImage extends normalLink {
public function getURL() {
$res = '<div class="videoContainer" ';
if (!is_null($w) && !is_null($h)) {
- $res.='data-width="' . $w . '" data-height="' . $h . '" ';
+ $res .= 'data-width="' . $w . '" data-height="' . $h . '" ';
} else if (!is_null($compiler)) {
$path = WS_BOOKS . '/working/' . $compiler->book_id . '/' . $basename . '.jpg';
$dim = getimagesize($path);
- $res.='data-width="' . $dim[0] . '" data-height="' . $dim[1] . '" ';
- }
- $res.=' data-autoplay="' . $autoplay . '"';
- $res.=' data-controls="' . $controls . '"';
- $res.=' data-loop="' . $loop . '"';
- $res.=' data-sound="' . $sound . '"';
- $res.=' data-name="' . $basename . '"';
- $res.='></div>';
+ $res .= 'data-width="' . $dim[0] . '" data-height="' . $dim[1] . '" ';
+ }
+ $res .= ' data-autoplay="' . $autoplay . '"';
+ $res .= ' data-controls="' . $controls . '"';
+ $res .= ' data-loop="' . $loop . '"';
+ $res .= ' data-sound="' . $sound . '"';
+ $res .= ' data-name="' . $basename . '"';
+ $res .= '></div>';
return $res;
}
public function getHTMLContent() {
if ($this->_content == '') {
$ext = files::getExtension($this->alternative);
+ fb($this->alternative);
+ fb($ext);
if ($ext == 'oam') {
$d = $this->unzipFile($this->alternative, true);
$this->_config = $this->getConfigOAM($d['dir']);
} elseif ($ext == 'html') {
$fdir = 'data/links';
$dir = $this->compiler->vdir . '/' . $fdir;
+
$d = array('fdir' => $fdir, 'dir' => $dir);
if (!file_exists($d['dir'])) {
fb($d['dir']);
$this->copyExternalFile($d['dir'] . '/' . $this->alternative);
}
+ fb($this->_config);
+
$w = $this->width * $this->getCssScale();
$h = $this->height * $this->getCssScale();
if ($this->_config['html']) {
$this->_url = $d['fdir'] . '/' . $this->_config['html'];
if ($this->extra) {
- $this->_url.='?' . $this->extra;
+ $this->_url .= '?' . $this->extra;
}
$iw = $this->_config['width'];
public function getCSSContainer() {
if (!($this instanceof contentLink) && $this->page % 2 == 1) {
$this->page--;
- $this->left+=$this->compiler->width;
+ $this->left += $this->compiler->width;
}
$css = '#l_' . $this->id . '{';
- $css.='left:' . $this->left * $this->getCssScale() . 'px;top:' . $this->top * $this->getCssScale() . 'px;';
- $css.='width:' . $this->_config['width'] . 'px;height:' . $this->_config['height'] . 'px;';
- $css.=$this->getCSS();
- $css.='}';
+ $css .= 'left:' . $this->left * $this->getCssScale() . 'px;top:' . $this->top * $this->getCssScale() . 'px;';
+ $css .= 'width:' . $this->_config['width'] . 'px;height:' . $this->_config['height'] . 'px;';
+ $css .= $this->getCSS();
+ $css .= '}';
return $css;
}
$sy = ($this->height / ($this->_config['height'])) * $this->getCssScale();
$res = wsHTML5Compiler::writeCSSUA('transform', 'scale(' . $sx . ',' . $sy . ')');
- $res.= wsHTML5Compiler::writeCSSUA('transform-origin', '0% 0%');
+ $res .= wsHTML5Compiler::writeCSSUA('transform-origin', '0% 0%');
if (!$this->_config['html']) {
return '';
} else {
$r = array('html' => false, 'inject' => array(file_get_contents($d . '/init.js')), 'injectcss' => array('multimedia.css'), 'injectjs' => array('multimedia.js'));
}
- return array_merge($res, $r);
+ $res = array_merge($res, $r);
+ return $res;
}
public function getConfigHTML($d, $html) {
public function getConfigOAM($d) {
$x = simplexml_load_file($d . '/config.xml');
- $config = (string) $x->oamfile['src'];
+ $config = (string)$x->oamfile['src'];
$config = str_replace('/Assets', '', $d . '/' . $config);
$x = simplexml_load_file($config, 'SimpleXMLElement', LIBXML_NOCDATA);
$c = CubeIT_Util_Xml::toObject($x);
public function getCSSContainer() {
$css = parent::getCSSContainer();
$css .= '#l_' . $this->id . ' audio{';
- $css.='width:' . round($this->width * $this->getCssScale()) . 'px;';
- $css.='height:' . round($this->height * $this->getCssScale()) . 'px;';
- $css.='display:block;';
- $css.='}';
+ $css .= 'width:' . round($this->width * $this->getCssScale()) . 'px;';
+ $css .= 'height:' . round($this->height * $this->getCssScale()) . 'px;';
+ $css .= 'display:block;';
+ $css .= '}';
return $css;
}
public static function makeAudioTag($linkDatas, $w = null, $h = null, $compiler = null) {
$res = '<audio controls ';
if ($linkDatas->video_loop) {
- $res.='loop ';
+ $res .= 'loop ';
}
if ($linkDatas->video_auto_start) {
- $res.='autoplay ';
+ $res .= 'autoplay ';
}
- $res.=' src="' . wsHTML5Link::getUniversalLocation($linkDatas->to) . '"';
- $res.='></audio>';
+ $res .= ' src="' . wsHTML5Link::getUniversalLocation($linkDatas->to) . '"';
+ $res .= '></audio>';
return $res;
}
public function getCSSContainer() {
if (!($this instanceof contentLink) && $this->page % 2 == 1) {
$this->page--;
- $this->left+=$this->compiler->width;
+ $this->left += $this->compiler->width;
}
$css = '#l_' . $this->id . '{';
- $css.='left:' . $this->left * $this->getCssScale() . 'px;top:' . $this->top * $this->getCssScale() . 'px;';
- $css.='width:' . $this->width * $this->getCssScale() . 'px;height:' . $this->height * $this->getCssScale() . 'px;';
+ $css .= 'left:' . $this->left * $this->getCssScale() . 'px;top:' . $this->top * $this->getCssScale() . 'px;';
+ $css .= 'width:' . $this->width * $this->getCssScale() . 'px;height:' . $this->height * $this->getCssScale() . 'px;';
if ($this->rot) {
- $css.= wsHTML5Compiler::writeCSSUA('transform', 'rotate(' . $this->rot . 'deg)');
- $css.= wsHTML5Compiler::writeCSSUA('transform-origin', '0% 0%');
+ $css .= wsHTML5Compiler::writeCSSUA('transform', 'rotate(' . $this->rot . 'deg)');
+ $css .= wsHTML5Compiler::writeCSSUA('transform-origin', '0% 0%');
}
- $css.=$this->getCSS();
- $css.='}';
+ $css .= $this->getCSS();
+ $css .= '}';
return $css;
}
public function getAdditionnalContent() {
$res = parent::getAdditionnalContent();
- $res.=' data-src="' . $this->_url . '" data-width="900" data-height="650"';
+ $res .= ' data-src="' . $this->_url . '" data-width="900" data-height="650"';
return $res;
}
$arrowsColor = '#' . $this->theme->parametres->arrowsColor;\r
// Set the icon list with the color\r
$icons = array('nav-bookmark' => $couleurI, 'nav-friend' => $couleurI, 'nav-help' => $couleurI, 'nav-index' => $couleurI, 'nav-sommaire' => $couleurI,\r
- 'next' => $arrowsColor, 'previous' => $arrowsColor, 'search' => $couleurI);\r
+ 'next' => $arrowsColor, 'previous' => $arrowsColor, 'search' => $couleurI);\r
\r
foreach ($icons as $icon => $color) {\r
- wsTools::colorizeAndRasterizeIcon($this->theme->parametres->iconSet, $icon, $color, $this->vdir . '/data/images/',4, $w, $h);\r
+ wsTools::colorizeAndRasterizeIcon($this->theme->parametres->iconSet, $icon, $color, $this->vdir . '/data/images/', 4, $w, $h);\r
$res[] = '#icon-' . $icon . '{width:' . $w . 'px;height:' . $h . 'px;background-image:url(data/images/' . $icon . '.svg), url(data/images/' . $icon . '.png);background-repeat:no-repeat;background-size:' . $w . 'px ' . $h . 'px}';\r
}\r
return $res;\r
\r
$res = '<div class="' . $class . '">';\r
foreach ($line['groups'] as $group) {\r
- $res.=$this->writeGroup($group);\r
+ $res .= $this->writeGroup($group);\r
}\r
- $res.='</div>';\r
+ $res .= '</div>';\r
return $res;\r
}\r
\r
\r
$res = '<div class="' . $class . '">';\r
foreach ($group['spans'] as $span) {\r
- $res.=$this->writeSpan($span);\r
+ $res .= $this->writeSpan($span);\r
}\r
- $res.='</div>';\r
+ $res .= '</div>';\r
return $res;\r
}\r
\r
\r
$br = '.background.r' . $r . '{';\r
if ($ratio != 1) {\r
- $br.=$this->writeCSSUA('transform', 'scale(' . $ratio . ')') . ';';\r
+ $br .= $this->writeCSSUA('transform', 'scale(' . $ratio . ')') . ';';\r
}\r
- $br.='width:' . $wr . 'px;height:' . $hr . 'px;}';\r
+ $br .= 'width:' . $wr . 'px;height:' . $hr . 'px;}';\r
$res[] = $br;\r
}\r
$res[] = '.doublePage,#pages,.landscape #shadow.double{width:' . $w2 . ';max-width:' . $w2 . ';height:' . $h . ';max-height:' . $h . '}';\r
$res[] = '.landscape #shadow.single.right{left: ' . $w . ';}';\r
$res[] = '.landscape .page.right{left:' . $w . '}';\r
$texts = '.texts{' . $this->writeCSSUA('transform-origin', 'top left') . ';';\r
- $texts.=$this->writeCSSUA('transform', 'scale(' . (1 / $this->multiply) . ')') . ';';\r
- $texts.='width:' . $wm . '; max-width:' . $wm . ';';\r
- $texts.='height:' . $hm . '; max-height:' . $hm . ';';\r
- $texts.='}';\r
+ $texts .= $this->writeCSSUA('transform', 'scale(' . (1 / $this->multiply) . ')') . ';';\r
+ $texts .= 'width:' . $wm . '; max-width:' . $wm . ';';\r
+ $texts .= 'height:' . $hm . '; max-height:' . $hm . ';';\r
+ $texts .= '}';\r
$res[] = $texts;\r
\r
// Theme\r
// Background\r
$body = '#main{';\r
- $body.='background-color:#' . $this->theme->parametres->backgroundColor . ';';\r
+ $body .= 'background-color:#' . $this->theme->parametres->backgroundColor . ';';\r
switch ($this->theme->parametres->repeat) {\r
case wsTheme::REPEAT:\r
- $body.='background-repeat:repeat;';\r
+ $body .= 'background-repeat:repeat;';\r
break;\r
case wsTheme::NONE:\r
- $body.='background-repeat:no-repeat;';\r
+ $body .= 'background-repeat:no-repeat;';\r
break;\r
case wsTheme::RATIO:\r
- $body.='background-repeat:no-repeat;';\r
+ $body .= 'background-repeat:no-repeat;';\r
break;\r
case wsTheme::STRETCH:\r
- $body.='background-repeat:no-repeat;';\r
- $body.='background-size:100% 100%;';\r
+ $body .= 'background-repeat:no-repeat;';\r
+ $body .= 'background-size:100% 100%;';\r
break;\r
}\r
if ($this->theme->parametres->backgroundImage != '') {\r
copy($this->themeRoot . '/' . $this->theme->parametres->backgroundImage, $this->vdir . '/data/images/' . $this->theme->parametres->backgroundImage);\r
- $body.='background-image:url(../images/' . $this->theme->parametres->backgroundImage . ');';\r
- $body.='background-position:';\r
+ $body .= 'background-image:url(../images/' . $this->theme->parametres->backgroundImage . ');';\r
+ $body .= 'background-position:';\r
\r
\r
switch ($this->theme->parametres->backgroundVAlign) {\r
case wsTheme::TOP:\r
- $body.='top';\r
+ $body .= 'top';\r
break;\r
case wsTheme::MIDDLE:\r
- $body.='center';\r
+ $body .= 'center';\r
break;\r
case wsTheme::BOTTOM:\r
- $body.='bottom';\r
+ $body .= 'bottom';\r
break;\r
}\r
- $body.=' ';\r
+ $body .= ' ';\r
switch ($this->theme->parametres->backgroundHAlign) {\r
case wsTheme::LEFT:\r
- $body.='left';\r
+ $body .= 'left';\r
break;\r
case wsTheme::CENTER:\r
- $body.='center';\r
+ $body .= 'center';\r
break;\r
case wsTheme::RIGHT:\r
- $body.='right';\r
+ $body .= 'right';\r
break;\r
}\r
- $body.=';';\r
+ $body .= ';';\r
}\r
\r
- $body.='}';\r
+ $body .= '}';\r
$res[] = $body;\r
\r
// Header\r
$header = '#header{';\r
- $header.='height:' . $this->theme->parametres->menuHeight . 'px;';\r
- $header.='background-color:' . self::colorToCSS($this->theme->parametres->menuColor) . ';';\r
+ $header .= 'height:' . $this->theme->parametres->menuHeight . 'px;';\r
+ $header .= 'background-color:' . self::colorToCSS($this->theme->parametres->menuColor) . ';';\r
if ($this->theme->parametres->menuImage != '') {\r
copy($this->themeRoot . '/' . $this->theme->parametres->menuImage, $this->vdir . '/data/images/' . $this->theme->parametres->menuImage);\r
- $header.='background-image:url(../images/' . $this->theme->parametres->menuImage . ');';\r
- $header.='background-repeat:no-repeat;';\r
- $header.='background-size:100% ' . $this->theme->parametres->menuHeight . 'px;';\r
+ $header .= 'background-image:url(../images/' . $this->theme->parametres->menuImage . ');';\r
+ $header .= 'background-repeat:no-repeat;';\r
+ $header .= 'background-size:100% ' . $this->theme->parametres->menuHeight . 'px;';\r
}\r
- $header.='}';\r
+ $header .= '}';\r
$res[] = $header;\r
\r
//Icons\r
if ($this->theme->parametres->logo) {\r
copy($this->themeRoot . '/' . $this->theme->parametres->logo, $this->vdir . '/data/images/' . $this->theme->parametres->logo);\r
$dim = getimagesize($this->vdir . '/data/images/' . $this->theme->parametres->logo);\r
- $logo.='background-image:url(../images/' . $this->theme->parametres->logo . ');width:' . $dim[0] . 'px;height:' . $dim[1] . 'px;';\r
+ $logo .= 'background-image:url(../images/' . $this->theme->parametres->logo . ');width:' . $dim[0] . 'px;height:' . $dim[1] . 'px;';\r
}\r
- $logo.='}';\r
+ $logo .= '}';\r
$res[] = $logo;\r
\r
// Credits\r
}\r
\r
foreach ($this->cssRotation as $rotation => $index) {\r
- $rotation*= - 1;\r
+ $rotation *= -1;\r
\r
\r
$to = 'transform-origin:left top;';\r
\r
$css = '.r' . $index . '{';\r
- $css.=self::writeCSSUA('transform', 'rotate(' . $rotation . 'deg)') . ';';\r
- $css.=self::writeCSSUA('transform-origin', 'left top');\r
- $css.='}';\r
+ $css .= self::writeCSSUA('transform', 'rotate(' . $rotation . 'deg)') . ';';\r
+ $css .= self::writeCSSUA('transform-origin', 'left top');\r
+ $css .= '}';\r
$res[] = $css;\r
}\r
\r
$res[] = $this->addGroup($group, $document_id);\r
}\r
return array('x' => $this->normalizeFloatValue($line['x']),\r
- 'y' => $this->normalizeFloatValue($line['y']),\r
- 'rotation' => $this->getCSSRotation($this->normalizeFloatValue($line['rotation'], 0)),\r
- "groups" => $res);\r
+ 'y' => $this->normalizeFloatValue($line['y']),\r
+ 'rotation' => $this->getCSSRotation($this->normalizeFloatValue($line['rotation'], 0)),\r
+ "groups" => $res);\r
}\r
\r
protected function addGroup($group, $document_id) {\r
\r
protected function addSpan($span, $document_id) {\r
\r
- $text = (string) $span;\r
+ $text = (string)$span;\r
if ($text == '') {\r
return false;\r
}\r
}\r
\r
protected function getIndex($value, &$tab) {\r
- $value = (string) $value;\r
+ $value = (string)$value;\r
if (isset($tab[$value])) {\r
return $tab[$value];\r
}\r
return $res;\r
}\r
\r
- protected function normalizeFloatValue($value, $round=3) {\r
+ protected function normalizeFloatValue($value, $round = 3) {\r
$value = str_replace(',', '.', $value);\r
- $value = (float) $value;\r
+ $value = (float)$value;\r
$value = round($value, $round);\r
return $value;\r
}\r
}\r
\r
public function __destruct() {\r
- \r
+\r
}\r
\r
public static function colorToCSS($color) {\r
$hex = substr($color, $k * 2, 2);\r
$$name = intval($hex, 16);\r
}\r
- $alpha/=255;\r
+ $alpha /= 255;\r
if ($alpha == 0) {\r
return 'transparent';\r
} elseif ($alpha == 1) {\r