| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 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/components/com_djcatalog2/models/ |
Upload File : |
<?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;
jimport('joomla.application.component.model');
require_once dirname(__FILE__).'/items.php';
require_once dirname(__FILE__).'/item.php';
class DJCatalog2ModelConfigurable extends BaseDatabaseModel
{
public function getItems() {
$input = Factory::getApplication()->input;
$model = BaseDatabaseModel::getInstance('Items', 'DJCatalog2Model', array('ignore_request' => true));
$state = $model->getState();
$model->setState('list.start', 0);
$model->setState('list.limit', 0);
$model->setState('filter.configurable', true);
$id = $input->getInt('id');
$cid = $input->getInt('cid');
$item = null;
if ($id > 0) {
$item = $this->getItem($id);
if (!empty($item)) {
$cid = $item->cat_id;
}
}
if ($cid > 0) {
$model->setState('filter.category', $cid);
}
$items = $model->getItems();
return $items;
}
public function getItem($id = null) {
if (empty($id)) {
$id = Factory::getApplication()->input->getInt('id');
}
if (!$id) return false;
$model = BaseDatabaseModel::getInstance('Item', 'DJCatalog2Model', array('ignore_request' => true));
$state = $model->getState();
return $model->getItem($id);
}
public function getCategories($cid = null) {
if (empty($id)) {
$cid = Factory::getApplication()->input->getInt('cid', 0);
}
$user = Factory::getUser();
$groups = $user->getAuthorisedViewLevels();
$categories = Djc2Categories::getInstance(array('state'=>'1', 'access'=>$groups));
$category = $categories->get($cid);
if (empty($category)) {
return false;
}
return $category->getChildren();
}
public function getConfiguration() {
}
}