{
$datas = parse_url($loc);
- if (isset($datas['scheme']) && !is_null($datas['scheme']) || strpos($loc, '#') === 0) {
+ if ((isset($datas['scheme']) && !is_null($datas['scheme'])) || strpos($loc, '#') === 0) {
return $loc;
} else {
if ($css) {
}
}
+ public function getConfigZIP($d)
+ {
+ return $this->compiler->getConfigZIP($d);
+ }
+
+ public function getConfigHTML($d, $html)
+ {
+ $res = array('width' => $this->video_width, 'height' => $this->video_height);
+ $r = array('html' => $html, 'inject' => array(), 'injectcss' => array(), 'injectjs' => array());
+
+ return array_merge($res, $r);
+ }
+
+ public function getConfigOAM($d)
+ {
+ $x = simplexml_load_string(file_get_contents($d . '/config.xml'));
+ $config = (string)$x->oamfile['src'];
+ $config = str_replace('/Assets', '', $d . '/' . $config);
+ $x = simplexml_load_string(file_get_contents($config), 'SimpleXMLElement', LIBXML_NOCDATA);
+ $c = CubeIT_Util_Xml::toObject($x);
+
+ $props = array('default-width' => 'width', 'default-height' => 'height', 'html-page' => 'html');
+
+
+ $res = array('inject' => array(), 'injectcss' => array(), 'injectjs' => array(), 'content' => trim($c->content), 'name' => $c->_name, 'assets' => array());
+ foreach ($c->properties->property as $p) {
+ if (isset($props[$p->_name])) {
+ $res[$props[$p->_name]] = $p->_defaultValue;
+ }
+ }
+ foreach ($c->require as $r) {
+ if ($r->_type == 'folder') {
+ continue;
+ }
+ $res['assets'][] = $r->_src;
+ }
+ return $res;
+ }
+
}
class normalLink extends wsHTML5Link
return '_self';
}
+
}
class showLinkLink extends normalLink
return $res;
}
- public function getConfigZIP($d)
- {
- return $this->compiler->getConfigZIP($d);
- }
-
- public function getConfigHTML($d, $html)
- {
- $res = array('width' => $this->video_width, 'height' => $this->video_height);
- $r = array('html' => $html, 'inject' => array(), 'injectcss' => array(), 'injectjs' => array());
-
- return array_merge($res, $r);
- }
-
- public function getConfigOAM($d)
- {
- $x = simplexml_load_file($d . '/config.xml');
- $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);
-
- $props = array('default-width' => 'width', 'default-height' => 'height', 'html-page' => 'html');
-
-
- $res = array('inject' => array(), 'injectcss' => array(), 'injectjs' => array(), 'content' => trim($c->content), 'name' => $c->_name, 'assets' => array());
- foreach ($c->properties->property as $p) {
- if (isset($props[$p->_name])) {
- $res[$props[$p->_name]] = $p->_defaultValue;
- }
- }
- foreach ($c->require as $r) {
- if ($r->_type == 'folder') {
- continue;
- }
- $res['assets'][] = $r->_src;
- }
- return $res;
- }
}
$thumbnails = true;
if (file_exists($XML_path)) {
- $slideshow_XML = simplexml_load_file($XML_path);
+ $slideshow_XML = simplexml_load_string(file_get_contents($XML_path));
$slideshowData = CubeIT_Util_Xml::toObject($slideshow_XML);
foreach ($slideshowData->image as $img) {
$full_path = $this->path_absolute . '/' . $img->_name;
class iframeLink extends wsHTML5Link
{
+ protected $_defaultTooltip;
+
function getHTMLContainerClass()
{
return parent::getHTMLContainerClass() . ' iframe';
function getHTMLContent()
{
- return '<iframe src="' . $this->to . '" width="100%" height="100%" frameborder="0" marginwidth="0" marginheight="0" scrolling="auto" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" onmousewheel=""></iframe>';
+ return '<iframe src="' . self::_handleFile($this) . '" width="100%" height="100%" frameborder="0" marginwidth="0" marginheight="0" scrolling="auto" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" onmousewheel=""></iframe>';
+ }
+
+ /**
+ * @param $link wsHTML5Link
+ */
+ public static function _handleFile($link)
+ {
+ if (!CubeIT_Util_Url::isDistant($link->to)) {
+ $e = explode('.', $link->to);
+ $ext = array_pop($e);
+ if ($ext === 'oam' || $ext === 'zip') {
+ if ($ext === 'oam') {
+ $d = $link->unzipFile($link->to, true);
+ $config = $link->getConfigOAM($d['dir']);
+ $link->copyExternalDir($d['dir'], $d['fdir']);
+ } else if ($ext === 'zip') {
+ $d = $link->unzipFile($link->to, false);
+ $config = $link->getConfigZip($d['dir']);
+ $link->copyExternalDir($d['dir'], $d['fdir']);
+ }
+ if ($config['html']) {
+ return $d['fdir'] . '/' . $config['html'];
+ }
+ } else {
+ $link->_defaultTooltip = 'click to open the file';
+ $link->copyExternalFile($link->to);
+ return wsHTML5Link::getUniversalLocation($link->to);
+ }
+ }
+
+ return $link->to;
}
}
{
$res = parent::getAdditionnalContent();
$markup = '<div class="iframeContainer" data-type="' . $this->iframeType . '">';
- $markup .= '<iframe src="' . $this->to . '" width="100%" height="100%" frameborder="0" marginwidth="0" marginheight="0" scrolling="auto" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" onmousewheel=""></iframe>';
+ $markup .= '<iframe src="' . iframeLink::_handleFile($this) . '" width="100%" height="100%" frameborder="0" marginwidth="0" marginheight="0" scrolling="auto" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" onmousewheel=""></iframe>';
$markup .= '</div>';
return $res . ' data-iframe="' . rawurlencode($markup) . '" ';
}