| 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/administrator/components/com_djcatalog2/controllers/ |
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;
use Joomla\CMS\MVC\Controller\FormController;
use Joomla\CMS\Factory;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Language\Text;
jimport('joomla.application.component.controllerform');
class Djcatalog2ControllerItem extends FormController
{
function __construct($config = array())
{
$this->view_list = 'items';
$this->view_item = 'item';
parent::__construct($config);
}
protected function allowAdd($data = array())
{
$user = Factory::getUser();
return $user->authorise('core.create', $this->option) || $user->authorise('djcatalog2.admin.catalogue', $this->option);
}
protected function allowEdit($data = array(), $key = 'id')
{
$canDo = Factory::getUser()->authorise('core.edit', $this->option) || Factory::getUser()->authorise('djcatalog2.admin.catalogue', $this->option);
if (!$canDo) {
$task = Factory::getApplication()->input->getCmd('task');
if ($task == 'edit' && Factory::getUser()->authorise('djcatalog2.access.catalogue', $this->option)) {
return true;
} else if ($task == 'cancel') {
return true;
}
}
return $canDo;
}
public function batch($model = null)
{
Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
$model = $this->getModel('Item', '', array());
$this->setRedirect(Route::_('index.php?option=com_djcatalog2&view=items' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
public function save($key = null, $urlVar = null)
{
$task = $this->getTask();
$model = $this->getModel();
$table = $model->getTable();
$app = Factory::getApplication();
if (empty($key)) {
$key = $table->getKeyName();
}
if ( $task == 'save2copy') {
$data = $this->input->post->get('jform', [], 'array');
$this->input->set('save2copy_id', $data[$key]);
}
return parent::save($key, $urlVar);
}
}
?>