<?php
/*
 * Software Name: Eorisis Pixels
 * Software URI: https://eorisis.com/shop/software/joomla/pixels
 * Author: Eorisis
 * Author URI: https://eorisis.com
 * Copyright: Copyright (C) 2011-2025 EORISIS. All Rights Reserved.
 * License: GNU General Public License version 2; See https://eorisis.com/gpl
 * Terms of Service: https://eorisis.com/tos
 */
defined('_JEXEC') or die;

use com_eorisis_pixels\framework\lib\core\cms\access;

if (version_compare(JVERSION, '3.8', '>='))
{
	JLoader::registerAlias('EorisisFormController', '\\Joomla\\CMS\\MVC\\Controller\\FormController');
}
else
{
	JLoader::registerAlias('EorisisFormController', 'JControllerForm');
}

class Eorisis_pixelsControllerUI extends EorisisFormController
{
	protected $view_list = 'dashboard';
	protected $view_item = 'ui';

	// --------------------------------------------------

	public function __construct($config = [])
	{
		parent::__construct($config);
	}

	// --------------------------------------------------

	protected function allowEdit($data = [], $key = 'id')
	{
		// Method to check if you can edit a record
		// @param   array   $data  An array of input data
		// @param   string  $key   The name of the key for the primary key
		// @return  boolean

		// Executes when entering an item for edit
		$task = 'core.edit.'.$this->view_item;
		$assetname = $this->option.'.'.$this->view_item;
		return (bool)access::authorise($task, $assetname);
	}
}
