'Zoom + lien produit' => 'ZoomProductLink',
), 'grade' => 5);
- $this->fields['product_email_title'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Titre de l'email") . ' "' . __('Envoyer à un ami') . '"', 'hint' => __('Laisser vide pour utiliser la valeur par défaut'));
- $this->fields['product_email_body'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __("Corps de l'email") . ' "' . __('Envoyer à un ami') . '"', 'hint' => __('Laisser vide pour utiliser la valeur par défaut'));
+ $this->fields['product_email_title'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Titre de l'email") . ' "' . __('Envoyer à un ami') . '"');
+ $this->fields['product_email_body'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __("Corps de l'email") . ' "' . __('Envoyer à un ami') . '"');
$this->fields['product_tweet'] = array('type' => 'textarea', 'default' => '%short%', 'editable' => true, 'label' => __("Contenu Partage court"), 'hint' => __('Contenu du partagé sur les partages courts'));
$this->fields['basketReferences'] = array('type' => 'freefile', 'default' => '', 'editable' => true,
class zoomLink extends normalLink
{
protected $maxzoom_default = 2;
+ protected $_groups = null;
+
+ public function getGroups()
+ {
+ if (null === $this->_groups) {
+ $this->_groups = [];
+ $groups = explode(',', $this->group);
+ foreach ($groups as $group) {
+ $this->_groups[] = CubeIT_Text::str2URL(trim($group));
+ }
+ }
+ return $this->_groups;
+ }
public function init()
{
{
$class = ' zoomarea';
- $groups = explode(',', $this->group);
+ $groups = $this->getGroups();
// 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
{
return [
'maxzoom' => empty($this->to) ? $this->maxzoom_default : $this->to,
- 'group' => $this->group,
- 'group-count' => empty($this->group) ? 0 : count(explode(',', $this->group)),
+ 'group' => implode(',', $this->getGroups()),
+ 'group-count' => empty($this->group) ? 0 : count($this->getGroups()),
'width' => round($this->width),
'height' => round($this->height),
'x' => round($this->left),
public function getClasses()
{
// Assign CSS classes for all groups so we can match and group them via JS
- $groups = explode(',', $this->group);
+ $groups = $this->getGroups();
$group_classes = [];
foreach ($groups as $group) {
if (empty($group)) continue;
- $group_classes[] = 'zoom-group-' . trim($group);
+ $group_classes[] = 'zoom-group-' . trim(CubeIT_Text::str2URL($group));
}
return array_merge($group_classes, ['zoomPopup'], parent::getClasses());
{
public function __construct($id, $init, &$compiler)
{
-
- $init['to'] = trim($init['to']);
$init['group'] = $init['to'];
parent::__construct($id, $init, $compiler);
}