$linkData = wsLinks::decryptLink($linkData);
$animations = contentLink::parseAnimations($linkData['image_rollover']);
foreach ($animations as $animation) {
- if (isset($animation['backgroundcolor']) && $animation['backgroundcolor'] != 'transparent') {
+ if (isset($animation['backgroundcolor']) && $animation['backgroundcolor'] !== 'transparent') {
$dupData = $linkData;
$dupData['type'] = 14;
$dupData['to'] = $animation['backgroundcolor'];
$dupData['uid'] = 'b_' . $linkData['uid'];
- if (!isset($animation['zindex'])) {
- $animation['zindex'] = 0;
- }
- $z = intval($animation['zindex']) - 1;
- $dupData['image_rollover'] = 'zindex=' . $z;
+ $dupData['image_rollover'] = 'addzindex=-1';
array_push($links, $dupData);
array_push($links, $linkData);
unset($links[$k]);
}
+ public function getBookSurface()
+ {
+ $s = $this->width * $this->height;
+ return $s;
+ }
+
protected function _sortLinksByDepth($a, $b)
{
$c = $a->getDepth() - $b->getDepth();
public $hidden = false;
public $defaultZIndex = 70;
public $zindex = -1;
+ public $addzindex = 0;
public $rightClone = false;
public $iframeType = "none";
public $border = 0;
public function getCSSZIndex()
{
- $zindex = $this->getAddZIndex() + (($this->getDepth() + 1) * 1000) - min(999, round(999 * (($this->width * $this->height) / ($this->compiler->width * 2 * $this->compiler->height))));
+ $zindex = $this->getAddZIndex() + (($this->getDepth() + 1) * 10000) - min(9999, max(1, round(9999 * (($this->width * $this->height) / $this->compiler->getBookSurface()))));
return 'z-index:' . $zindex . ';';
}
public function getAddZIndex()
{
- return 0;
+ return $this->addzindex;
}
public function moveOnEvenPage()
if (isset($animation['zindex'])) {
$this->zindex = $animation['zindex'];
}
+ if (isset($animation['addzindex'])) {
+ $this->addzindex = $animation['addzindex'];
+ }
}
$res .= ' data-animations="' . htmlspecialchars(json_encode($animations), ENT_QUOTES) . '" ';
if ($this->_isHiddenFirst($animations)) {