Your IP : 216.73.216.224


Current Path : /var/www/html/administrator/components/com_jchat/Controller/
Upload File :
Current File : /var/www/html/administrator/components/com_jchat/Controller/ConfigController.php

<?php
namespace JExtstore\Component\JChat\Administrator\Controller;
/**
 *
 * @package JCHAT::CONFIG::administrator::components::com_jchat
 * @subpackage controllers
 * @author Joomla! Extensions Store
 * @copyright (C) 2024 - Joomla! Extensions Store
 * @license GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html 
 */
defined ( '_JEXEC' ) or die ( 'Restricted access' );
use Joomla\CMS\Language\Text;
use JExtstore\Component\JChat\Administrator\Framework\Controller as JChatController;

/**
 * Config controller concrete implementation
 *
 * @package JCHAT::CPANEL::administrator::components::com_jchat
 * @subpackage controllers
 * @since 1.0
 */
class ConfigController extends JChatController {

	/**
	 * Show configuration
	 * @access public
	 * @return void
	 */
	public function display($cachable = false, $urlparams = false) {
		parent::display($cachable);
	}

	/**
	 * Save config entity
	 * @access public
	 * @return bool
	 */
	public function saveEntity(): bool {
		$model = $this->getModel();
		$option = $this->option;
		
		if(!$model->storeEntity()) {
			// Model set exceptions for something gone wrong, so enqueue exceptions and levels on application object then set redirect and exit
			$modelException = $model->getException(null, false);
			$this->app->enqueueMessage($modelException->getMessage(), $modelException->getExceptionLevel());
			$this->setRedirect ( "index.php?option=$option&task=config.display", Text::_('COM_JCHAT_ERROR_SAVING_PARAMS'));
			return false;
		}
		$this->setRedirect( "index.php?option=$option&task=config.display", Text::_('COM_JCHAT_SAVED_PARAMS'));
		
		return true;
	}
}