| Server IP : 46.105.57.169 / Your IP : 216.73.216.84 Web Server : Apache System : Linux webd003.cluster120.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : maitricfuz ( 93378) PHP Version : 8.4.10 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/m/a/i/maitricfuz/www/saint-martin-lg/modules/mod_spgallery/fields/ |
Upload File : |
<?php
/**
* @package Smile Pack
* @version 2.1.2 Free
*
* @author Tassos Marinos <info@tassos.gr>
* @link http://www.tassos.gr
* @copyright Copyright © 2019 Tassos Marinos All Rights Reserved
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
*/
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Factory;
class SPGalleryHelper
{
/**
* Prepares the Gallery Manager Widget uploaded files prior to being passed
* to the Gallery Widget to display the Gallery on the front-end.
*
* @param array $items
* @param array $tags
*
* @return array
*/
public static function prepareItems($items = [], $tags = [])
{
foreach ($items as $key => &$item)
{
// Skip items that have not saved properly(items were still uploading and we saved the item)
if ($key === 'ITEM_ID')
{
unset($items[$key]);
continue;
}
$itemTags = [];
$stored_item_tags = isset($item['tags']) ? $item['tags'] : [];
if (is_array($stored_item_tags) && count($stored_item_tags))
{
foreach ($stored_item_tags as $tagId)
{
if (!array_key_exists($tagId, $tags))
{
continue;
}
$itemTags[] = $tags[$tagId];
}
}
$url = Uri::root() . ($item['image'] ? $item['image'] : $item['source']);
$item = array_merge($item, [
'url' => $url,
'slideshow' => isset($item['slideshow']) && $item['slideshow'] ? Uri::root() . $item['slideshow'] : $url,
'thumbnail_url' => $item['thumbnail'] ? Uri::root() . $item['thumbnail'] : '',
'tags' => $itemTags
]);
}
return $items;
}
}