]> _ Git - cubeextranet.git/commitdiff
wip #2298 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 15 Oct 2018 17:06:04 +0000 (17:06 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 15 Oct 2018 17:06:04 +0000 (17:06 +0000)
inc/ws/Controlleur/class.ws.flash.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Util/class.ws.links.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index a78c6cda2d4925ee2de043c55edb92168028207f..4cd843bfe181c2c9e19edf9d457cd6d26dd20b0d 100644 (file)
@@ -16,7 +16,12 @@ class wsFlash extends cubeFlashGateway
                $gateway->addAttribute('creation', $droits->creation ? '1' : '0');
                $gateway->addAttribute('revendeur', $droits->revendeur ? '1' : '0');
                $gateway->addAttribute('admin', $droits->admin ? '1' : '0');
-               $gateway->addAttribute('grade', $core->user->ws_grade);
+               if (null !== $core->user) {
+                       $grade = -1;
+               } else {
+                       $grade = $core->user->ws_grade;
+               }
+               $gateway->addAttribute('grade', $grade);
        }
 
        public function saveConversionSettings()
index f9c56323b5b99a7af3de81b0e2e997d2cfca706e..21e334a53f3da4b85304726f953383c33f77ffdf 100644 (file)
@@ -1023,19 +1023,21 @@ class wsDAOBook extends commonDAO
                        if (file_exists($fby)) {
                                $words = CubeIT_Util_Json::decode(file_get_contents($fby), CubeIT_Util_Json::TYPE_OBJECT);
 
-                               foreach ($words as $i => $w) {
-                                       $word = $w->word;
-                                       $word = trim($word, "\0");
-                                       if ($word == '') {
-                                               continue;
-                                       }
-                                       unset($w->word);
-                                       $w->page = $book_page;
-                                       $w->idx = $i;
-                                       if (!isset($res->{$word})) {
-                                               $res->{$word} = array();
+                               if (is_array($words)) {
+                                       foreach ($words as $i => $w) {
+                                               $word = $w->word;
+                                               $word = trim($word, "\0");
+                                               if ($word == '') {
+                                                       continue;
+                                               }
+                                               unset($w->word);
+                                               $w->page = $book_page;
+                                               $w->idx = $i;
+                                               if (!isset($res->{$word})) {
+                                                       $res->{$word} = array();
+                                               }
+                                               $res->{$word}[] = $w;
                                        }
-                                       $res->{$word}[] = $w;
                                }
                        }
                }
index b11eecde8828eb2d555f343e17da195f7c841e8e..6e58b2fd5e2a2d96c61f0d2f08f3175b38f29584 100644 (file)
@@ -31,7 +31,7 @@ class wsLinks
                        'extra' => __('Paramètre supplĂ©mentaire'),
                        'alternative' => __('Alternative'),
                        'read_mode' => __('Mode de lecture'),
-                       'image' => __('Image'),
+                       'image' => __('Image'), 'image_rollover' => __('Animation au survol'),
                        'group' => __('Groupe'),
                );
 
index 80670630ba996bbfded438f5e8576c8a9ed3bd7d..6ac9b6727716c276e88e2074f6ab4240027c5b0d 100644 (file)
@@ -577,6 +577,9 @@ class wsHTML5Compiler
        protected function _writeIndex($page)
        {
 
+               if (!isset($this->seo->pages[$page])) {
+                       return;
+               }
                $seo = $this->seo->pages[$page];
                $html = $seo->getHTML();
 
@@ -1021,7 +1024,9 @@ class wsHTML5Compiler
                                $dupData = $linkData;
                                $dupData['image'] = '';
                                $dupData['to'] = $linkData['image'];
+                               $dupData['rollover'] = $linkData['image_rollover'];
                                $dupData['type'] = 15;
+                               $dupData['uid'] = 'i_' . $linkData['uid'];
                                if (wsHTML5Link::isScorm($linkData)) {
                                        $dupData['scorm'] = true;
                                }
index 8528b96fca942c19b1810e161bb9c0ab459508a9..833fa0e80ab44087c2c4a51a8209ff948f69fc18 100644 (file)
@@ -21,6 +21,7 @@ class wsHTML5Link
        public $video_height;
        public $video_width;
        public $video_service;
+       public $rollover;
        public $inline;
        public $in_popup = false;
        public $display_area;
@@ -200,7 +201,7 @@ class wsHTML5Link
 
        public static function isScorm($linkData)
        {
-               return (isset($linkData['scorm']) && $linkData['scorm']) || (stristr($linkData['to'], 'scorm') || stristr($linkData['alternative'], 'scorm'));
+               return (isset($linkData['scorm']) && $linkData['scorm']) || (stristr($linkData['to'], 'scorm') || (isset($linkData['alternative']) && stristr($linkData['alternative'], 'scorm')));
        }
 
        public function __construct($id, $init, &$compiler)
@@ -282,7 +283,12 @@ class wsHTML5Link
 
        public function getClasses()
        {
-               return array();
+
+               $res = array();
+               if ($this->image_rollover != 'none') {
+                       $res[] = 'image_rollover';
+               }
+               return $res;
        }
 
        public function copyExternalFile($file, $video = false)
@@ -517,7 +523,7 @@ class zoomhdLink extends normalLink
        public function init()
        {
                $this->compiler->addJs('js/libs/fluidbook/links/fluidbook.links.zoomhd.js');
-               $this->compiler->writeLinksData=true;
+               $this->compiler->writeLinksData = true;
        }
 
        public function getURL()
@@ -1039,6 +1045,13 @@ class imageLink extends contentLink
                return 'background-image:url(' . wsHTML5Link::getUniversalLocation($this->to, true) . ');background-size:100% 100%;background-repeat:no-repeat;';
        }
 
+       public function getAdditionnalContent()
+       {
+               $res = parent::getAdditionnalContent();
+               $res .= ' data-rollover="' . $this->rollover . '"';
+               return $res;
+       }
+
 }
 
 class inlineSlideshowLink extends contentLink