$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()
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;
}
}
}
'extra' => __('Paramètre supplémentaire'),
'alternative' => __('Alternative'),
'read_mode' => __('Mode de lecture'),
- 'image' => __('Image'),
+ 'image' => __('Image'), 'image_rollover' => __('Animation au survol'),
'group' => __('Groupe'),
);
protected function _writeIndex($page)
{
+ if (!isset($this->seo->pages[$page])) {
+ return;
+ }
$seo = $this->seo->pages[$page];
$html = $seo->getHTML();
$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;
}
public $video_height;
public $video_width;
public $video_service;
+ public $rollover;
public $inline;
public $in_popup = false;
public $display_area;
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)
public function getClasses()
{
- return array();
+
+ $res = array();
+ if ($this->image_rollover != 'none') {
+ $res[] = 'image_rollover';
+ }
+ return $res;
}
public function copyExternalFile($file, $video = false)
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()
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