Ok, I have a
very dirty fix using the boxplus autodiscover method.
First in
plugins/content/phocagallery/phocagallery.php in the if/else block for the detail window (line ~1457) i created an additional "else if"
to give each gallery an unique rel-parameter
Code: Select all
} else if ($tmpl['detail_window'] == 10) {
$output .=' rel="boxplus-'.$randName.'" ';
}
Then in
administrator/components/com_phocagallery/libraries/phocagallery/render/renderdetailwindow.php (line ~370) i commented out the entire content of the if-block (which is strange btw, because it creates a new instance of boxplus for every image – is it intended?)
Code: Select all
/*
// Image
$document->addScriptDeclaration('new boxplus($$("a.phocagallerycboxplus'.$this->extension.'"),{"theme":"'.$this->bpTheme.'","autocenter":'.(int)$this->bpBautocenter.',"autofit":'.(int)$this->bpAutofit.',"slideshow":'.(int)$this->bpSlideshow.',"loop":'.(int)$this->bpLoop.',"captions":"'.$this->bpCaptions.'","thumbs":"'.$this->bpThumbs.'","width":'.(int)$this->popupWidth.',"height":'.(int)$this->popupHeight.',"duration":'.(int)$this->bpDuration.',"transition":"'.$this->bpTransition.'","contextmenu":'.(int)$this->bpContextmenu.', phocamethod:1});');
// Icon
$document->addScriptDeclaration('new boxplus($$("a.phocagallerycboxplusi'.$this->extension.'"),{"theme":"'.$this->bpTheme.'","autocenter":'.(int)$this->bpBautocenter.',"autofit":'.(int)$this->bpAutofit.',"slideshow":'.(int)$this->bpSlideshow.',"loop":'.(int)$this->bpLoop.',"captions":"'.$this->bpCaptions.'","thumbs":"hide","width":'.(int)$this->popupWidth.',"height":'.(int)$this->popupHeight.',"duration":'.(int)$this->bpDuration.',"transition":"'.$this->bpTransition.'","contextmenu":'.(int)$this->bpContextmenu.', phocamethod:1});');
*/
Finally i placed the autodiscover code in the javascript file of my template (or the index.php)
Code: Select all
<script>
boxplus.autodiscover(true,{"theme":"shadow", "autocenter":true, "autofit":true, "slideshow":0, "loop":false, "captions":"bottom", "thumbs":"none", "width":800, "height":600, "duration":250, "transition":"sine", "protection":false});
</script>
Obviously this solutions has some serious drawbacks:
#1 the settings for boxplus are hardcoded and you cannot adjust them in the joomla-backend
#2 the changes on the phocagallery.php and renderdetailwindow.php files will be most probably overwritten with every phocagallery update
#3 the boxplus code will be loaded on every page – even if you don't need it – throwing errors in the console
So I am still hoping to find a more elegant solution.