Thaks Jérome
the best i can have with rokbox
www.tricotin.tramber9.o2switch.net/index...ls-fantaisie-abakan/
my small modif in popup.php
if(!$isRel) {
$rel = ' data-rokbox ';
if(!empty($params['gallery'])) {
$rel = ' data-rokbox data-rokbox-album="'.str_replace('"','', $params['gallery']).'"';
i don't succeed to call fonction for titlle ==> in my block_img overide i juste replace title by data-rokbox-caption
if($img->success) {
$attr = 'data-rokbox-caption="'.$this->escape(@$image->file_description).'"';
if (!empty ($this->element->images) && count($this->element->images) > 1) {
$attr .= '';
}
$html = '<img id="hikashop_main_image'.$variant_name.'" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle" data-rokbox-caption="'.$this->escape(@$image->file_description).'" title="'.$this->escape(@$image->file_description).'" alt="'.$this->escape(@$image->file_name).'" src="'.$img->url.'"/>';
and
$attr = 'data-rokbox-caption="'.$this->escape(@$image->file_description).'" onmouseover="return window.localPage.changeImage(this, \'hikashop_main_image'.$variant_name.'\', \''.$img->url.'\', '.$img->width.', '.$img->height.', \''.str_replace("'","\'",@$image->file_description).'\', \''.str_replace("'","\'",@$image->file_name).'\');"';
concerning overide, i can wait for your trick !!
i have tested with this file (function image) without success
<?php
defined('_JEXEC') or die('Restricted access');
include_once $originalFile;
class hikashopPopupHelperOverride extends hikashopPopupHelper {
}
class hikashopPopupHelper{
function image($content, $url, $id = null, $attr = '', $params = array()) {
$html = '';
$config = hikashop_config();
$popupMode = $config->get('image_popup_mode', 'mootools');
switch($popupMode) {
case 'shadowbox':
case 'shadowbox-embbeded':
return $this->imageShadowbox($content, $url, $id, $attr, $params);
case 'mootools':
default:
return $this->imageMootools($content, $url, $id, $attr, $params);
}
return $html;
}
function imageMootools($content, $url, $id = null, $attr = '', $params = array()) {
JHtml::_('behavior.modal');
$html = '';
if($content === null)
return $html;
$isOnclick = (strpos($attr, 'onclick="') !== false);
$onClick = '';
if(!$isOnclick)
$onClick = ' onclick="SqueezeBox.fromElement(this,{parse:\'rel\'});return false;"';
if(!empty($id))
$id = ' id="'.$id.'"';
else
$id = '';
$html = '<a '.$attr.$onClick.$id.' href="'.$url.'" rel="{handler:\'image\'}" target="_blank">'.$content.'</a>';
return $html;
}
function imageShadowbox($content, $url, $id = null, $attr = '', $params = array()) {
$html = '';
if($content === null)
return $html;
static $init = false;
if($init === false) {
$config = hikashop_config();
$shadowboxMode = $config->get('image_popup_mode', 'mootools');
$doc = JFactory::getDocument();
if($shadowboxMode != 'shadowbox-embbeded') {
$doc->addStyleSheet('//www.hikashop.com/cdn/shadowbox/shadowbox.css');
$doc->addScript('//www.hikashop.com/cdn/shadowbox/shadowbox.js');
$doc->addScriptDeclaration("\r\n".'Shadowbox.init();'."\r\n");
}
$doc->addScriptDeclaration("\r\n".'(function(){ window.Oby.registerAjax("hkContentChanged", function(){ Shadowbox.clearCache(); Shadowbox.setup(); }); })();'."\r\n");
$init = true;
}
$isRel = (strpos($attr, 'rel="') !== false);
$rel = '';
if(!$isRel) {
$rel = ' data-rokbox data-rokbox-album="'.str_replace('"','', $params['gallery']).'"';
if(!empty($params['gallery'])) {
$rel = ' data-rokbox data-rokbox-album="'.str_replace('"','', $params['gallery']).'"';
}
}
if(!empty($id))
$id = ' id="'.$id.'"';
else
$id = '';
$html = '<a '.$attr.$rel.$id.' href="'.$url.'">'.$content.'</a>';
return $html;
}
function getAttr($attr, $class) {
if(empty($attr)) {
return 'class="'.$class.'"';
}
$attr = ' '.$attr;
if(strpos($attr, ' class="') !== false) {
$attr = str_replace(' class="', ' class="'.$class.' ', $attr);
} elseif(strpos($attr, ' class=\'') !== false) {
$attr = str_replace(' class=\'', ' class=\''.$class.' ', $attr);
} else {
$attr .= ' class="'.$class.'"';
}
return trim($attr);
}
}
grosse bidouille
take care
Bertrand