AnonSec Shell
Server IP : 54.36.91.62  /  Your IP : 216.73.217.111
Web Server : Apache
System : Linux webm013.cluster127.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 : coopiak ( 151928)
PHP Version : 8.3.23
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/coopiak/amisdesseniors-fr/annonces/components/com_djcatalog2/helpers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/coopiak/amisdesseniors-fr/annonces/components/com_djcatalog2/helpers/theme.php
<?php
/**
 * @package DJ-Catalog2
 * @copyright Copyright (C) DJ-Extensions.com, All rights reserved.
 * @license http://www.gnu.org/licenses GNU/GPL
 * @author url: http://dj-extensions.com
 * @author email contact@dj-extensions.com
 */

defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
require_once(JPATH_ROOT.'/components/com_djcatalog2/defines.djcatalog2.php');
require_once(JPATH_ROOT.'/components/com_djcatalog2/helpers/djcatalog2.php');

class DJCatalog2ThemeHelper {
	static $themeSet = null;
	static $themeName = null;

	static $layoutBasePath = false;

	public static function setThemeAssets() {
		if (!isset(self::$themeSet)) {
			$app = Factory::getApplication();
			$document = Factory::getDocument();
			$params = Djcatalog2Helper::getParams(); //$app->getParams('com_djcatalog2');

			$theme = self::getThemeName();

			Joomla\CMS\HTML\HTMLHelper::_('jquery.framework');

			if ($params->get('theme_bootstrap_css', false)) {
				Joomla\CMS\HTML\HTMLHelper::_('bootstrap.loadCss', true, Factory::getDocument()->direction);
			}
			if ($params->get('theme_bootstrap_framework', true)) {
				Joomla\CMS\HTML\HTMLHelper::_('bootstrap.framework');
			}

			$document->addScriptDeclaration('
				window.DJC2BaseUrl = "'.Uri::base(true).'";
			');

			Text::script('COM_DJCATALOG2_ADD_TO_CART_ERROR_COMBINATION_PARAMS_INVALID');
			Text::script('COM_DJCATALOG2_PRODUCT_OUT_OF_STOCK');
			Text::script('COM_DJCATALOG2_PRODUCT_IN_STOCK');
			Text::script('COM_DJCATALOG2_PRODUCT_IN_STOCK_QTY');

			$lightboxes = array('slimbox', 'picbox', 'magnific');
			//$lightboxType = $params->get('lightbox_type', 'magnific');
			$lightboxType = 'magnific';

			//$slimboxJs = Uri::root(true).'/components/com_djcatalog2/assets/slimbox-1.8/js/slimbox.js';
			//$slimboxCss = Uri::root(true).'/components/com_djcatalog2/assets/slimbox-1.8/css/slimbox.css';

			//$lightboxes['slimbox']['css'] = $slimboxCss;
			//$lightboxes['slimbox']['js'] = $slimboxJs;

			//$picboxJs = Uri::root(true).'/components/com_djcatalog2/assets/picbox/js/picbox.js';
			//$picboxCss = Uri::root(true).'/components/com_djcatalog2/assets/picbox/css/picbox.css';

			//$lightboxes['picbox']['css'] = $picboxCss;
			//$lightboxes['picbox']['js'] = $picboxJs;

			$magnificJs = Uri::root(true).'/media/djextensions/magnific/magnific.js';
			$magnificCss = Uri::root(true).'/media/djextensions/magnific/magnific.css';

			$lightboxes['magnific']['css'] = $magnificCss;
			$lightboxes['magnific']['js'] = $magnificJs;

			$document->addStyleSheet($lightboxes[$lightboxType]['css']);
			$document->addScript($lightboxes[$lightboxType]['js']);

			if ($lightboxType == 'magnific') {
				$document->addScript(Uri::root(true).'/components/com_djcatalog2/assets/magnific/magnific-init.js');
			}

			$isRTL = false;
			if ($document->direction=='rtl'){
				$isRTL = true;
			} else if (isset($_COOKIE["jmfdirection"])){
				if ($_COOKIE["jmfdirection"]=='rtl'){
					$isRTL = true;
				}
			} else if (isset($_COOKIE["djdirection"])){
				if ($_COOKIE["djdirection"]=='rtl'){
					$isRTL = true;
				}
			}

			if ($params->get('theme_css', '1') == '1') {
				$css_suffix = ($isRTL) ? '.rtl' : '';

				$theme_css_url = Uri::root(true).'/components/com_djcatalog2/themes/default/css/theme'.$css_suffix.'.css';
				$theme_responsive_url = Uri::root(true).'/components/com_djcatalog2/themes/default/css/responsive'.$css_suffix.'.css';

				if (File::exists( DJCATCOMPONENTPATH.'/themes/'.$theme.'/css/theme'.$css_suffix.'.css' )) {
					$theme_css_url = Uri::root(true).'/components/com_djcatalog2/themes/'.$theme.'/css/theme'.$css_suffix.'.css';
				}

				$document->addStyleSheet($theme_css_url);

				if ($params->get('theme_responsive', '1') == '1') {
					if (File::exists( DJCATCOMPONENTPATH.'/themes/'.$theme.'/css/responsive'.$css_suffix.'.css' )) {
						$theme_responsive_url = Uri::root(true).'/components/com_djcatalog2/themes/'.$theme.'/css/responsive'.$css_suffix.'.css';
					}

					$document->addStyleSheet($theme_responsive_url);
				}
			}

			//$theme_js_file = $jquery ? 'theme.jquery.js' : 'theme.js';
			$theme_js_file = 'theme.js';
			$theme_js_url = Uri::root(true).'/components/com_djcatalog2/themes/default/js/'.$theme_js_file;

			if (File::exists( DJCATCOMPONENTPATH.'/themes/'.$theme.'/js/'.$theme_js_file )) {
				$theme_js_url = Uri::root(true).'/components/com_djcatalog2/themes/'.$theme.'/js/'.$theme_js_file;
			}

			$document->addScript($theme_js_url);

			$theme_class_file = DJCATCOMPONENTPATH.'/themes/default/theme.php';
			$theme_class = 'Djcatalog2Theme';

			if (File::exists( DJCATCOMPONENTPATH.'/themes/'.$theme.'/theme.php' )) {
				$theme_class_file = DJCATCOMPONENTPATH.'/themes/'.$theme.'/theme.php';
			}

			if (!class_exists($theme_class)) {
				if (file_exists($theme_class_file)) {
					require_once $theme_class_file;
				}
			}
			if (class_exists($theme_class)) {
				$themeClass = new $theme_class();
				if (method_exists($themeClass, 'setStyles')) {
					$themeClass->setStyles($params);
				}
			}
			self::$themeSet = true;
		}
	}
	public static function getThemeImage($filename, $retVal = 'url') {
		//$params = $app->getParams('com_djcatalog2');
		$params = Djcatalog2Helper::getParams();
		$theme = $params->get('theme','bootstrapped');
		$path = '';
		if (File::exists(DJCATCOMPONENTPATH.'/themes/'.$theme.'/images/'.$filename)) {
			$path = '/components/com_djcatalog2/themes/'.$theme.'/images/'.$filename;
		} else if (File::exists(DJCATCOMPONENTPATH.'/themes/default/images/'.$filename)) {
			$path = '/components/com_djcatalog2/themes/default/images/'.$filename;
		} else {
			return '';
		}

		return (($retVal == 'url') ? Uri::root(true) : JPATH_ROOT) . $path;
	}
	public static function getThemeName() {
		if (!self::$themeName) {
			$app = Factory::getApplication();
			$document = Factory::getDocument();
			//$params = $app->getParams('com_djcatalog2');
			$params = Djcatalog2Helper::getParams();
			self::$themeName = $params->get('theme','bootstrapped');
		}
		return self::$themeName;
	}
	public static function getLayoutBasePath() {
		if (static::$layoutBasePath === false) {
			$themeLayoutPath = JPATH_ROOT.'/components/com_djcatalog2/themes/' . static::getThemeName() .'/layouts';
			if (Folder::exists($themeLayoutPath)) {
				static::$layoutBasePath = $themeLayoutPath;
			} else {
				static::$layoutBasePath = null;
			}
		}

		return static::$layoutBasePath;
	}

}

Anon7 - 2022
AnonSec Team