Что бы вывести изображение в popup от FancyBox необходимо проделать следующую работу:
1. Создать хелпер для вывода
В версии 220 удобно переопределять не только шаблоны элементов но так же создавать свои для шаблона. Итак в шаблоне создайте папку helpers а в нем файл popupcolor.php
\media\zoo\applications\jbuniversal\templates\ВАШ_ШАБЛОН\helpers\popupcolor.php
и пометите туда следующий код
<?php
/**
* JBZoo App is universal Joomla CCK, application for YooTheme Zoo component
* @package jbzoo
* @version 2.x Pro
* @author JBZoo App http://jbzoo.com
* @copyright Copyright (C) JBZoo.com, All rights reserved.
* @license http://jbzoo.com/license-pro.php JBZoo Licence
* @coder Sergey Kalistratov <kalistratov.s.m@gmail.com>
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
/**
* Class PopupColorHelper
*/
class PopupColorHelper extends JBHtmlHelper
{
public function colors(
$inputType = 'checkbox',
$data,
$name,
$selected = null,
$attrs = array(),
$width = '26px',
$height = '26px',
$titles = array()
)
{
$stringHelper = $this->_string;
$jbstring = $this->_jbstring;
$jbcolor = $this->app->jbcolor;
$unique = $jbstring->getId('jbcolor-');
$attrs['id'] = $unique;
$attrs['class'] = 'jbzoo-colors';
$html = array();
$html[] = '<div ' . $this->_buildAttrs($attrs) . '>';
$i = 0;
foreach ($data as $value => $color) {
$isFile = false;
if ($jbcolor->isFile($color)) {
$isFile = $color;
}
$i++;
$inputId = $jbstring->getId('jbcolor-input-');
$inputAttr = array(
'type' => $inputType,
'name' => $name,
'id' => $inputId,
'title' => isset($titles[$value]) ? $titles[$value] : $value,
'value' => $value,
'class' => 'jbcolor-input'
);
$labelAttr = array(
'for' => $inputId,
'title' => isset($titles[$value]) ? $titles[$value] : $value,
'class' => array(
$inputType,
'jbcolor-label',
'value-' . $stringHelper->sluggify($value),
'hasTip'
),
'style' => 'width:' . $width . ';height:' . $height . ';'
);
$attr = array(
'style' => ' background-color: ' . (!$isFile ? '#' . $color . ';' : 'transparent; width:' . $width . ';height:' . $height . ';')
);
if ($selected != null && ($selected == $value || is_array($selected) && in_array($value, $selected))) {
$inputAttr['checked'] = 'checked';
$inputAttr['class'] .= ' checked';
}
$html[] = '<input ' . $this->_buildAttrs($inputAttr) . '/>';
$html[] = '<label ' . $this->_buildAttrs($labelAttr) . '>';
$html[] = ($isFile ? '<div class="checkIn" style="background: url(\'' . $isFile . '\') center;">' : '');
$html[] = '<div ' . $this->_buildAttrs($attr) . '></div>';
$html[] = ($isFile ? '</div>' : '') . '</label>';
if ($isFile) {
$popupAttrs = array(
'href' => $isFile,
'class' => 'color-gallery',
'rel' => 'gallery-' . $unique,
'title' => $labelAttr['title']
);
$html[] = '<a ' . $this->_buildAttrs($popupAttrs) . '>Посмотреть</a>';
}
}
$html[] = '</div>';
$html[] = $this->_assets->initJBColorHelper($unique, $inputType == 'checkbox' ? 1 : 0, true);
$html[] = $this->app->jbassets->widget('#' . $unique . ' .color-gallery', 'fancybox', array(
'helpers' => array(
'title' => array('type' => 'outside'),
'buttons' => array('position' => "top"),
'thumbs' => array('width' => 80, 'height' => 80),
'overlay' => array('locked' => false)
)
), true);
return implode(PHP_EOL, $html);
}
}
2. Переопределяем шаблон
Создаем файл в папке. Ее по умолчанию нет, поэтому создавайте вручную.
\media\zoo\applications\jbuniversal\templates\bootstrap\cart-elements\price\color\tmpl\color.php
Со следующим кодом
<?php
/**
* JBZoo App is universal Joomla CCK, application for YooTheme Zoo component
* @package jbzoo
* @version 2.x Pro
* @author JBZoo App http://jbzoo.com
* @copyright Copyright (C) JBZoo.com, All rights reserved.
* @license http://jbzoo.com/license-pro.php JBZoo Licence
* @coder Alexander Oganov <t_tapak@yahoo.com>
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
echo $this->app->popupcolor->colors('radio', $dataColor, $name, $value, null, $width, $height);
Получаем следующий результат.
ВНИМАНИЕ!!!
1. Тестировалось на JBZoo
2. При следующих обновлениях эти изменения не должны пострадать.
3. При появлении проблем Тех.Поддержка ответственности не несет.













