public function overlapDoublePage()
{
+ // $this->page is normally an integer but it can also be a string (eg. background / aftersearch)
+ if (!is_int($this->page)) return false;
+
return ($this->page % 2 == 0 && $this->left + $this->width > $this->compiler->width);
}
$res .= '<iframe data-scale="' . $s . '" data-width="' . $iw . '" data-height="' . $ih . '" width="' . $iw . '" height="' . $ih . '" src="' . $this->_externalIframe . '" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" onmousewheel="" style="visibility:hidden;" tabindex="-1" onload="this.style.visibility=\'visible\';"></iframe>';
}
+ //### Debug to see how/where this code is being called multiple times
+ // ob_start();
+ // debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
+ // $trace = ob_get_contents();
+ // ob_end_clean();
+ // $this->compiler->log("##### Multimedia Link getHTMLContent ID: {$this->id} | {$this->alternative} ######\n\n!!!! BACKTRACE !!!!!\n$trace\n===============\n");
+
foreach ($this->_config['inject'] as $i) {
- $infos = ['path' => 'data/links/' . str_replace('.', '_', $this->alternative)];
+ $infos = ['path' => 'data/links/' . str_replace('.', '_', $this->alternative) . '/'];
$i = str_replace('$id', '"#l_' . $this->id . '"', $i);
$i = str_replace('$path', '"' . $infos['path'] . '"', $i);
$i = str_replace('$init', CubeIT_Util_Json::encode($infos), $i);
- $this->compiler->htmlmultimedia[] = $i;
+ // Key the array with the ID so we don't get duplicates even when this function is called multiple times
+ $this->compiler->htmlmultimedia[$this->id] = $i;
}
if (isset($this->_config['injectcss'])) {
}
if (isset($this->_config['injectjs'])) {
- foreach ($this->_config['injectjs'] as $i) {
- $this->compiler->pluginJs[] = $d['fdir'] . '/' . $i;
+ foreach ($this->_config['injectjs'] as $filename) {
+ $path = $d['fdir'] . '/' . $filename;
+ // Key the array with the path so we don't get duplicates even when this function is called multiple times
+ $this->compiler->pluginJs[$path] = $path;
}
}