$this->config->rasterizePages = cubeArray::parseRange($this->config->rasterizePages);
$this->config->vectorPages = array_diff(cubeArray::parseRange($this->config->vectorPages), $this->config->rasterizePages);
$this->config->triggersLinks = [];
- $this->config->hasContentLock=false;
+ $this->config->hasContentLock = false;
}
protected function populateConfig()
$dupData['alternative'] = $linkData['animation'];
$dupData['type'] = 6;
$dupData['uid'] = 'a_' . $linkData['uid'];
- $dupData['video_width']=$dupData['video_height']=0;
+ $dupData['video_width'] = $dupData['video_height'] = 0;
if (wsHTML5Link::isScorm($linkData)) {
$dupData['scorm'] = true;
}
$i = 0;
$pages = array();
$cpages = array();
+ $ctpages = array();
$css = array();
$linkPages = [];
$allLinksData = [];
+ $depths = [10 => 'ctpages', 20 => 'ctpages', 30 => 'cpages', 40 => 'cpages', 50 => 'pages', 60 => 'pages', 70 => 'pages', 80 => 'pages',];
+
usort($links, array($this, '_sortLinks'));
foreach ($links as $linkData) {
if (!isset($pages[$lta->page])) {
$pages[$lta->page] = '';
$cpages[$lta->page] = '';
+ $ctpages[$lta->page] = '';
}
- if ($lta instanceof contentLink) {
- $cpages[$lta->page] .= $c;
- } else {
- $pages[$lta->page] .= $c;
- }
+
+ $v = $depths[$lta->getDepth()];
+ $$v[$lta->page] .= $c;
}
// Make old "aftersearch" link compatible with new "extra" menu option by extracting link URL
if ($link->page == 'aftersearch') {
$linkPages[$link->page] = true;
}
-
$allLinksData[$linkData['uid']] = $linkData;
if ($link->keep()) {
$c = '';
$cc = '';
+ $ct = '';
if (isset($pages[$i])) {
$c = $pages[$i];
}
if (isset($cpages[$i])) {
$cc = $cpages[$i];
}
+ if (isset($ctpages[$i])) {
+ $ct = $ctpages[$i];
+ }
$this->config->links[$i] = $c;
$this->config->clinks[$i] = $cc;
+ $this->config->ctlinks[$i] = $ct;
}
if ($this->writeLinksData) {
public $uid;
public $scorm;
public $hidden = false;
- public $zindex = 4;
+ public $defaultZIndex = 70;
+ public $zindex = -1;
public $rightClone = false;
public $iframeType = "none";
public $border = 0;
case 5:
return new internalLink($id, $init, $compiler);
case 4:
- if ($init['inline']) {
+
+ $init['inline'] = self::normalizeInlineIntegration($init['inline']);
+ if ($init['inline'] === 'inline') {
+ $init['inline'] = 'inline';
return new videoLink($id, $init, $compiler);
+ } else if ($init['inline'] === 'popup') {
+ $init['inline'] = 'popup';
+ return new videoPopupLink($id, $init, $compiler);
+ } else if ($init['inline'] === 'background_texts') {
+ $init['inline'] = 'background_texts';
+ return new videoBackgroundLink($id, $init, $compiler);
}
- return new videoPopupLink($id, $init, $compiler);
+
case 7:
if ($compiler->book->parametres->basketManager === 'Puma') {
return new pumaCartLink($id, $init, $compiler);
break;
case 27:
return new eventOverlayLink($id, $init, $compiler);
-
case 29:
return new facebookLikeLink($id, $init, $compiler);
case 30:
default:
return null;
}
+
+
+ }
+
+ public static function normalizeInlineIntegration($inline)
+ {
+ if ($inline == '1' || $inline === 'true') {
+ return 'inline';
+
+ } else if (!$inline || $inline === 'false') {
+ return 'popup';
+ }
+ return $inline;
}
public static function parseExtras($extras, $normalizeKey = false)
if ($init['alternative'] == '') {
return null;
}
+ $init['inline'] = self::normalizeInlineIntegration($init['inline']);
$ext = mb_strtolower(files::getExtension($init['alternative']));
if (in_array($ext, array('oam', 'zip', 'html')) || substr($init['alternative'], 0, 4) == 'http') {
- if ($init['inline']) {
+ if ($init['inline'] === 'inline') {
return new htmlMultimediaLink($id, $init, $compiler);
} else {
return new htmlMultimediaPopupLink($id, $init, $compiler);
}
} else if (in_array($ext, array('gif', 'jpeg', 'jpg', 'png', 'svg'))) {
- if ($init['inline']) {
+ if ($init['inline'] === 'inline') {
return new htmlMultimediaImage($id, $init, $compiler);
} else {
return new htmlMultimediaPopupImage($id, $init, $compiler);
$this->init();
}
+ public function getDepth()
+ {
+ if ($this->zindex == -1) {
+ return $this->defaultZIndex;
+ }
+ return $this->zindex;
+ }
+
public function getTooltipAttribute($t = null)
{
if (null === $t) {
public function getCSSZIndex()
{
- $zindex = (($this->zindex + 1) * 1000) - min(999, round(($this->width * $this->height) / 300));
+ $zindex = (($this->getDepth() + 1) * 1000) - min(999, round(($this->width * $this->height) / 300));
return 'z-index:' . $zindex . ';';
}
class htmlMultimediaImage extends wsHTML5Link
{
- public $zindex = 2;
+ public $defaultZIndex = 50;
public function getHTMLContainerClass()
{
class contentLink extends wsHTML5Link
{
- public $zindex = 0;
+ public $defaultZIndex = 30;
public function getHTMLContainerClass()
{
$res = parent::getAdditionnalContent();
$animations = self::parseAnimations($this->image_rollover);
foreach ($animations as $animation) {
- if (isset($animation['zindex'])) {
- $this->zindex = $animation['zindex'];
- }
+// if (isset($animation['zindex'])) {
+// $this->defaultZIndex = $animation['zindex'];
+// }
}
$res .= ' data-animations="' . htmlspecialchars(json_encode($animations), ENT_QUOTES) . '" ';
if ($this->_isHiddenFirst($animations)) {
}
return false;
}
-
- public function getCSSZIndex()
- {
- if ($this->zindex === 0) {
- return '';
- }
- return 'z-index:' . ($this->zindex + 500) . ';';
- }
}
class eventOverlayLink extends wsHTML5Link
{
- public $zindex = 3;
+ public $defaultZIndex = 60;
public function getHTMLContainerClass()
{
}
}
+class videoBackgroundLink extends videoLink
+{
+ public $defaultZIndex = 10;
+
+ public function __construct($id, $init, &$compiler)
+ {
+ /*
+ * public $video_loop;
+ public $video_sound_on;
+ public $video_controls;
+ public $video_auto_start;
+ public $video_height;
+ public $video_width;
+ */
+ $init['video_loop'] = true;
+ $init['video_controls'] = false;
+ $init['video_auto_start'] = true;
+ parent::__construct($id, $init, $compiler);
+ }
+}
+
class videoLink extends wsHTML5Link
{
- public $zindex = 2;
+ public $defaultZIndex = 50;
public static function addVideoJS($compiler)
{
$attributes = static::getVideoAttributes($linkDatas, $w, $h, $compiler);
- $res = '<div class="videoContainer"';
+ $res = '<div class="videoContainer integration-' . $linkDatas->inline . '"';
foreach ($attributes as $name => $value) {
$res .= " data-{$name}='{$value}'";
}
protected $_content = '';
protected $_url;
protected $_externalIframe = false;
- public $zindex = 2;
+ public $defaultZIndex = 50;
public function getHTMLContent()
{
$slides_options = [];
// If the zip file contained a slideshow.xml file, use that for fetching images and their captions
- if (file_exists($XML_path)) {
- $slideshow_XML = simplexml_load_string(file_get_contents($XML_path));
+ if (file_exists($XML_path) && $slideshow_XML = simplexml_load_string(file_get_contents($XML_path))) {
$slideshowData = CubeIT_Util_Xml::toObject($slideshow_XML);
$thumbnails = isset($slideshowData->_thumbnails) && $slideshowData->_thumbnails !== 'false';
$slides = $this->_getSlidesFromDirectory($this->path_absolute);
}
-
} else {
// Or by default, just get all the images that were in the zip file...
$slides = $this->_getSlidesFromDirectory($this->path_absolute);