public $rot;
public $class;
public $uid;
+ public $scorm;
public $zindex = 4;
protected $_init;
*/
public static function getInstance($id, $init, &$compiler)
{
+ $init['scorm'] = (stristr($init['to'], 'scorm') || stristr($init['alternative'], 'scorm'));
+
switch ($init['type']) {
case 1:
case 2:
public function getHTMLContainer()
{
- return '<div class="' . $this->getHTMLContainerClass() . '" data-id="' . $this->uid . '" id="l_' . $this->id . '"' . $this->getAdditionnalContent() . '>' . $this->getHTMLContent() . '</div>';
+ return '<div class="' . $this->getHTMLContainerClass() . '" data-scorm="' . $this->scorm . '" data-id="' . $this->uid . '" id="l_' . $this->id . '"' . $this->getAdditionnalContent() . '>' . $this->getHTMLContent() . '</div>';
}
public function getHTMLContainerClass()
class zoomLink extends normalLink
{
- protected $maxzoom_default = 2;
+ protected $maxzoom_default = 2;
public function getHTMLContainerClass()
{
- $class = ' zoomarea';
+ $class = ' zoomarea';
- $groups = explode(',', $this->group);
+ $groups = explode(',', $this->group);
- // If there's more than one group assigned, this link shouldn't be clickable (disabled via CSS)
- // This needs to be set here (parent element) instead of on the actual link so we don't end up with a dead zone
- if (count($groups) > 1) {
- $class .= ' pointer-events-none';
- }
+ // If there's more than one group assigned, this link shouldn't be clickable (disabled via CSS)
+ // This needs to be set here (parent element) instead of on the actual link so we don't end up with a dead zone
+ if (count($groups) > 1) {
+ $class .= ' pointer-events-none';
+ }
- return parent::getHTMLContainerClass() . $class;
+ return parent::getHTMLContainerClass() . $class;
}
public function getDefaultTooltip()
{
$res = parent::getAdditionnalContent();
- $res .= ' id="'. $this->uid .'"';
+ $res .= ' id="' . $this->uid . '"';
// Data attributes
$attributes = [
'maxzoom' => empty($this->to) ? $this->maxzoom_default : $this->to,
- 'group' => $this->group,
- 'group-count' => empty($this->group) ? 0 : count(explode(',', $this->group)),
+ 'group' => $this->group,
+ 'group-count' => empty($this->group) ? 0 : count(explode(',', $this->group)),
'width' => round($this->width),
'height' => round($this->height),
- 'x' => round($this->left),
- 'y' => round($this->top)
+ 'x' => round($this->left),
+ 'y' => round($this->top)
];
// Set data attributes
public function getClasses()
{
- // Assign CSS classes for all groups so we can match and group them via JS
- $groups = explode(',', $this->group);
- $group_classes = [];
+ // Assign CSS classes for all groups so we can match and group them via JS
+ $groups = explode(',', $this->group);
+ $group_classes = [];
- foreach ($groups as $group) {
- if (empty($group)) continue;
+ foreach ($groups as $group) {
+ if (empty($group)) continue;
- $group_classes[] = 'zoom-group-' . trim($group);
- }
+ $group_classes[] = 'zoom-group-' . trim($group);
+ }
return array_merge($group_classes, ['zoomPopup'], parent::getClasses());
}