Your IP : 216.73.217.142


Current Path : /var/www/consult-e-syn/public_html/components/com_ats/Controller/
Upload File :
Current File : /var/www/consult-e-syn/public_html/components/com_ats/Controller/Attachment.php

<?php
/**
 * @package   ats
 * @copyright Copyright (c)2011-2022 Nicholas K. Dionysopoulos / Akeeba Ltd
 * @license   GNU General Public License version 3, or later
 */

namespace Akeeba\TicketSystem\Site\Controller;

defined('_JEXEC') or die;

use FOF40\Container\Container;

class Attachment extends \Akeeba\TicketSystem\Admin\Controller\Attachment
{
    public function __construct(Container $container, array $config = array())
    {
        $this->cacheableTasks = [];

        parent::__construct($container, $config);
    }


    public function execute($task)
    {
        $allowed = array(
            'default', 'unpublish', 'publish', 'remove', 'read'
        );

        // Only allow a small subset of available tasks
        if(!in_array($task, $allowed))
        {
            return false;
        }

        if ($task == 'default')
        {
            $task = $this->getCrudTask();
        }

        // There aren't such actions on frontend
        if(in_array($task , array('new', 'edit', 'read', 'add')))
        {
            $task = 'read';
        }

        return parent::execute($task);
    }
}