From a3e68b53db537774545dca192719fd705b353e13 Mon Sep 17 00:00:00 2001 From: trob Date: Sun, 14 Jun 2020 20:32:00 +0200 Subject: [PATCH] Add some more params accessible in the fileupload layout file, so e.g. rel= lightbox[] can be restricted per element and/or per list row --- .../layouts/fabrik-element-fileupload-image.php | 16 ++++++++++++++++ .../fabrik_element/fileupload/models/image.php | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/plugins/fabrik_element/fileupload/layouts/fabrik-element-fileupload-image.php b/plugins/fabrik_element/fileupload/layouts/fabrik-element-fileupload-image.php index 138fe59a449..9dff3346fe1 100644 --- a/plugins/fabrik_element/fileupload/layouts/fabrik-element-fileupload-image.php +++ b/plugins/fabrik_element/fileupload/layouts/fabrik-element-fileupload-image.php @@ -1,4 +1,20 @@ lightboxAttrs + $displayData->listRow + $displayData->elementname + $displayData->restrict_lightbox + $displayData->fullSize + $displayData->file + $displayData->makeLink + $displayData->title + $displayData->isJoin + $displayData->width + $displayData->showImage + $displayData->inListView + $displayData->height + $displayData->isSlideShow +*/ defined('JPATH_BASE') or die; $d = $displayData; diff --git a/plugins/fabrik_element/fileupload/models/image.php b/plugins/fabrik_element/fileupload/models/image.php index 5bcb6c6d333..1b9e6a9c252 100644 --- a/plugins/fabrik_element/fileupload/models/image.php +++ b/plugins/fabrik_element/fileupload/models/image.php @@ -133,6 +133,12 @@ public function render(&$model, &$params, $file, $thisRow = null) $layout = $model->getLayout('image'); $displayData = new stdClass; $displayData->lightboxAttrs = FabrikHelperHTML::getLightboxAttributes($title, $n); + + //$$$trob: Add some more params accessible in the layout file + $displayData->listRow = isset($thisRow->__pk_val) ? $thisRow->__pk_val : ''; + $displayData->elementname = $model->getElement()->name; + $displayData->restrict_lightbox = $params->get('restrict_lightbox', 1); + $displayData->fullSize = $model->storage->preRenderPath($fullSize); $displayData->file = $file; $displayData->makeLink = $params->get('make_link', true)