/** * @inheritDoc */ public function init() { parent::init(); $this->registerScripts($this->getView()); /** * Check if a css class has been assigned to the element * if not add the fancybox and fancybox.image class * else append the default classes to the user inputed */ if (isset($this->htmlOptions['linkOptions']['class'])) { $class = $this->htmlOptions['linkOptions']['class']; $this->htmlOptions['linkOptions']['class'] = 'fancybox bancybox.image ' . $class; } else { $this->htmlOptions['linkOptions']['class'] = 'fancybox bancybox.image '; } /** * Check if a css class has been assigned to the element * if not assign by default a boostrap class */ if (!isset($this->htmlOptions['thumbnailOptions']['class'])) { $this->htmlOptions['thumbnailOptions']['class'] = 'img-thumbnail'; } /** * Check if a group has been assigned to the gallery * if not assign the default auto generated id of the widget */ if (!isset($this->htmlOptions['linkOptions']['data-group-fancybox'])) { $this->htmlOptions['linkOptions']['data-fancybox-group'] = $this->id; } }
public function init() { parent::init(); if (!isset($this->htmlOptions['linkOptions']['id'])) { $this->htmlOptions['linkOptions']['id'] = $this->id; } $view = $this->getView(); $this->registerScripts($view); }