]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 2 Jan 2014 12:55:49 +0000 (12:55 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 2 Jan 2014 12:55:49 +0000 (12:55 +0000)
inc/ws/Util/html5/class.ws.html5.links.php

index b367dca783b83e0493bc8319c5dfdb596e228b66..ab78307c1a5a2dd026d80ee305ce2b4106bd6d0d 100644 (file)
@@ -546,12 +546,30 @@ class htmlMultimediaLink extends wsHTML5Link {
 
                        $w = $this->width * $this->getCssScale();
                        $h = $this->height * $this->getCssScale();
-                       $this->_url = $d['fdir'] . '/' . $this->_config['html'];
+                       if ($this->_config['html']) {
+                               $this->_url = $d['fdir'] . '/' . $this->_config['html'];
 
-                       $iw = $this->_config['width'];
-                       $ih = $this->_config['height'];
+                               $iw = $this->_config['width'];
+                               $ih = $this->_config['height'];
+
+                               $res = '<iframe width="' . $iw . '" height="' . $ih . '" src="' . $this->_url . '" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>';
+                       } else {
+                               $res = '';
+                       }
+
+                       foreach ($this->_config['inject'] as $i) {
+                               $i = str_replace('$id', '"#' . $this->id . '"', $i);
+                               $this->compiler->htmlmultimedia[] = $i;
+                       }
+
+                       foreach ($this->_config['injectcss'] as $i) {
+                               
+                       }
+
+                       foreach ($this->_config['injectjs'] as $i) {
+                               
+                       }
 
-                       $res = '<iframe width="' . $iw . '" height="' . $ih . '" src="' . $this->_url . '" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>';
                        $this->copyExternalDir($d['dir']);
                        $this->_content = $res;
                }
@@ -592,7 +610,14 @@ class htmlMultimediaLink extends wsHTML5Link {
        }
 
        public function getConfigZIP($d) {
-               return array('html' => 'index.html', 'width' => $this->video_width, 'height' => $this->video_height);
+
+               $res = array('width' => $this->video_width, 'height' => $this->video_height);
+               if (file_exists($d . '/index.html')) {
+                       $r = array('html' => 'index.html', 'inject' => array(), 'injectcss' => array(), 'injectjs' => array());
+               } else {
+                       $r = array('html' => false, 'inject' => file_get_contents($d . '/init.js'), 'injectcss' => 'multimedia.css', 'injectjs' => 'multimedia.js');
+               }
+               return array_merge($res, $r);
        }
 
        public function getConfigOAM($d) {
@@ -605,7 +630,7 @@ class htmlMultimediaLink extends wsHTML5Link {
                $props = array('default-width' => 'width', 'default-height' => 'height', 'html-page' => 'html');
 
 
-               $res = array('content' => trim($c->content), 'name' => $c->_name, 'assets' => array());
+               $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;