Styling the download link container

lcollong

FabriKant d'applications web
Hi,

There is a new feature on the fileUpload Element which allow to add a download link under the image (append).
This is a very useful one as you can both display a thumb image from a non protected directory and use the ajaxify download link for the real image from an htaccess protected directory.

However this feature is surrounded by a div without a class which would allow some better rendering. (float left/right for example).

So I did a very simple hack that I think would be helpful for others also around line 1000 of the file plugins/fabrik_element/fileupload/fileupload.php. Class name could be changed.

Code:
        if ($params->get('fu_download_append', '0') === '1')
        {
            return $render->output . '<div class="fabrik-fu-list-download">' . $downloadHTML . '</div>';;
        }
        else
        {
            return $render->output;
        }
 
I agree. But I guess Hugh had some good reasons ! :)
Thanks for committing it anyway
 
in the same file, to avoid a notice for undefined key (don't know why the function is called with invalid '$i' ...), around line 940 :

Code:
                if (array_key_exists($title_name, $thisRow))
                {
                    if (!empty($thisRow->$title_name))
                    {
                        $title = $thisRow->$title_name;
                        $title = FabrikWorker::JSONtoData($title, true);
                        $title = array_key_exists($i, $title) ? $title[$i] : '';
                    }
                }

Also, it seems the layout file "fabrik-element-fileupload-downloadlink.php" when used in "append" context could not been overridden. I did not success where as the file "fabrik-element-elementlist-details.php" overrides well on the same site (different list).
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top