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/voscatalogues/modules/mod_djc2map/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/coopiak/amisdesseniors-fr/voscatalogues/modules/mod_djc2map/helper.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\MVC\Model\BaseDatabaseModel;
class modDjc2MapHelper {
	var $_data = null;
	var $_cparams = null;
	var $_mparams = null;
	var $_categoryparams = array();
	
	function __construct( $params=array() )
	{
		$app = Factory::getApplication();
		
		$cparams = $app->getParams('com_djcatalog2');
		$ncparams = new JRegistry();
		$ncparams->merge($cparams);
		
		$this->_cparams = $ncparams;
		$this->_mparams = $params;
	}
	function getData() {
		if (!$this->_data){
			$app = Factory::getApplication();
			
			BaseDatabaseModel::addIncludePath(JPATH_BASE.'/components/com_djcatalog2/models', 'DJCatalog2Model');
			$followListing = (bool)($this->_mparams->get('follow_listing_page', false) && $app->input->getCmd('view') == 'items' && $app->input->getCmd('option') == 'com_djcatalog2');
			
			$model = null;
			if ($followListing) {
				$model = BaseDatabaseModel::getInstance('Items', 'Djcatalog2Model');
			} else {
				$model = BaseDatabaseModel::getInstance('Items', 'Djcatalog2Model', array('ignore_request'=>true));
			}
			
			$order		= $this->_mparams->get('orderby','i.ordering');
			$order_Dir	= $this->_mparams->get('orderdir','asc');
			$order_featured	= $this->_mparams->get('featured_first', 0);
			$filter_catid		= $this->_mparams->get('catid', array());
			$filter_producerid		= $this->_mparams->get('producer_id', 0);
			$filter_itemids		= $this->_mparams->get('item_ids', null);
			
			$recent = $this->_mparams->get('recent_only', 0);
			if ($recent) {
				$recentItems = Djcatalog2Helper::getRecentItems();
				if (empty($recentItems)) {
					return array();
				}
				$filter_itemids = implode(',', $recentItems);
			}
			
			$filter_featured	= $this->_mparams->get('featured_only', 0);
			$limit = $this->_mparams->get('items_limit',0);
			
			$state = $model->getState();
			
			//$this->_cparams->set('product_catalogue', 0);
			$model->setState('params', $this->_cparams);
			
			$model->setState('list.start', 0);
			$model->setState('list.limit', $limit);
			
			$model->setState('filter.category',$filter_catid);
			if ($filter_producerid > 0) {
				$model->setState('filter.producer', (int)$filter_producerid);
			} 
			$model->setState('filter.catalogue',false);
			$model->setState('filter.featured',$filter_featured);
			//$model->setState('list.ordering_featured',$order_featured);
			//$model->setState('list.ordering',$order);
			//$model->setState('list.direction',$order_Dir);
			
			$model->setState('filter.map', true);
			
			if ($filter_itemids) {
				$filter_itemids = explode(',', $filter_itemids);
				$ids = array();
				foreach($filter_itemids as $k=>$v) {
					$v = trim((string)$v);
					if ((int)$v > 0) {
						$ids[] = (int)$v;
					}
				}
				if (!empty($ids)) {
					$ids = array_unique($ids);
					$model->setState('filter.item_ids', $ids);
				}
			}
			
			$this->_data = $model->getItems();
		}
		return $this->_data;
	}
	function getCategoryParams($catid) {
		if (!isset($this->_categoryparams[$catid])) {
			$categories = Djc2Categories::getInstance(array('state'=>'1'));
			$category = $categories->get($catid);
			$this->_categoryparams[$catid] = $this->_cparams;
			if (!empty($category)) {
				$catpath = array_reverse($category->getPath());
				foreach($catpath as $k=>$v) {
					$parentCat = $categories->get((int)$v);
					if (!empty($parentCat) && !empty($category->params)) {
						$catparams = new JRegistry($parentCat->params); 
						$this->_categoryparams[$catid]->merge($catparams);
					}
				}
			}
		}		
		return $this->_categoryparams[$catid];
	}
}

?>

Anon7 - 2022
AnonSec Team