Spade

Mini Shell

Directory:~$ /proc/self/root/home/lmsyaran/public_html/css/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ //proc/self/root/home/lmsyaran/public_html/css/com_config.zip

PKUn�[M��IJ�
config.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

// Load classes
JLoader::registerPrefix('Config', JPATH_COMPONENT);

// Application
$app = JFactory::getApplication();

// Tell the browser not to cache this page.
$app->setHeader('Expires', 'Mon, 26 Jul 1997 05:00:00
GMT', true);

$controllerHelper = new ConfigControllerHelper;
$controller = $controllerHelper->parseController($app);

$controller->prefix = 'Config';

// Perform the Request task
$controller->execute();
PKVn�[\�D��controller/cancel.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Cancel Controller
 *
 * @since  3.2
 */
class ConfigControllerCancel extends JControllerBase
{
	/**
	 * Application object - Redeclared for proper typehinting
	 *
	 * @var    JApplicationCms
	 * @since  3.2
	 */
	protected $app;

	/**
	 * Method to handle cancel
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   3.2
	 */
	public function execute()
	{
		// Redirect back to home(base) page
		$this->app->redirect(JUri::base());
	}
}
PKVn�[�M��controller/canceladmin.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Cancel Controller for Admin
 *
 * @since  3.2
 */
class ConfigControllerCanceladmin extends ConfigControllerCancel
{
	/**
	 * The context for storing internal data, e.g. record.
	 *
	 * @var    string
	 * @since  3.2
	 */
	protected $context;

	/**
	 * The URL option for the component.
	 *
	 * @var    string
	 * @since  3.2
	 */
	protected $option;

	/**
	 * URL for redirection.
	 *
	 * @var    string
	 * @since  3.2
	 * @note   Replaces _redirect.
	 */
	protected $redirect;

	/**
	 * Method to handle admin cancel
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   3.2
	 */
	public function execute()
	{
		// Check for request forgeries.
		if (!JSession::checkToken())
		{
			$this->app->enqueueMessage(JText::_('JINVALID_TOKEN_NOTICE'));
			$this->app->redirect('index.php');
		}

		if (empty($this->context))
		{
			$this->context = $this->option . '.edit' .
$this->context;
		}

		// Redirect.
		$this->app->setUserState($this->context . '.data',
null);

		if (!empty($this->redirect))
		{
			// Don't redirect to an external URL.
			if (!JUri::isInternal($this->redirect))
			{
				$this->redirect = JUri::base();
			}

			$this->app->redirect($this->redirect);
		}
		else
		{
			parent::execute();
		}
	}
}
PKXn�[�YlqHHcontroller/cmsbase.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Base Display Controller
 *
 * @since  3.2
 */
class ConfigControllerCmsbase extends JControllerBase
{
	/**
	 * Prefix for the view and model classes
	 *
	 * @var    string
	 * @since  3.2
	 */
	public $prefix;

	/**
	 * Execute the controller.
	 *
	 * @return  mixed  A rendered view or true
	 *
	 * @since   3.2
	 */
	public function execute()
	{
		// Check for request forgeries
		if (!JSession::checkToken())
		{
			$this->app->enqueueMessage(JText::_('JINVALID_TOKEN_NOTICE'));
			$this->app->redirect('index.php');
		}

		// Get the application
		$this->app = $this->getApplication();
		$this->app->redirect('index.php?option=' .
$this->input->get('option'));

		$this->componentFolder =
$this->input->getWord('option', 'com_content');
		$this->viewName        =
$this->input->getWord('view');

		return $this;
	}
}
PKXn�[}_y�*	*	controller/config/display.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Display Controller for global configuration
 *
 * @since  3.2
 */
class ConfigControllerConfigDisplay extends ConfigControllerDisplay
{
	/**
	 * Method to display global configuration.
	 *
	 * @return  boolean	True on success, false on failure.
	 *
	 * @since   3.2
	 */
	public function execute()
	{
		// Get the application
		$app = $this->getApplication();

		// Get the document object.
		$document     = JFactory::getDocument();

		$viewName     = $this->input->getWord('view',
'config');
		$viewFormat   = $document->getType();
		$layoutName   = $this->input->getWord('layout',
'default');

		// Access backend com_config
		JLoader::registerPrefix(ucfirst($viewName), JPATH_ADMINISTRATOR .
'/components/com_config');
		$displayClass = new ConfigControllerApplicationDisplay;

		// Set backend required params
		$document->setType('json');
		$app->input->set('view', 'application');

		// Execute backend controller
		$serviceData = json_decode($displayClass->execute(), true);

		// Reset params back after requesting from service
		$document->setType('html');
		$app->input->set('view', $viewName);

		// Register the layout paths for the view
		$paths = new SplPriorityQueue;
		$paths->insert(JPATH_COMPONENT . '/view/' . $viewName .
'/tmpl', 'normal');

		$viewClass  = 'ConfigView' . ucfirst($viewName) .
ucfirst($viewFormat);
		$modelClass = 'ConfigModel' . ucfirst($viewName);

		if (class_exists($viewClass))
		{
			if ($viewName !== 'close')
			{
				$model = new $modelClass;

				// Access check.
				if (!JFactory::getUser()->authorise('core.admin',
$model->getState('component.option')))
				{
					return;
				}
			}

			$view = new $viewClass($model, $paths);

			$view->setLayout($layoutName);

			// Push document object into the view.
			$view->document = $document;

			// Load form and bind data
			$form = $model->getForm();

			if ($form)
			{
				$form->bind($serviceData);
			}

			// Set form and data to the view
			$view->form = &$form;
			$view->data = &$serviceData;

			// Render view.
			echo $view->render();
		}

		return true;
	}
}
PKXn�[~����controller/config/save.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Save Controller for global configuration
 *
 * @since  3.2
 */
class ConfigControllerConfigSave extends JControllerBase
{
	/**
	 * Application object - Redeclared for proper typehinting
	 *
	 * @var    JApplicationCms
	 * @since  3.2
	 */
	protected $app;

	/**
	 * Method to save global configuration.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   3.2
	 */
	public function execute()
	{
		// Check for request forgeries.
		if (!JSession::checkToken())
		{
			$this->app->enqueueMessage(JText::_('JINVALID_TOKEN_NOTICE'));
			$this->app->redirect('index.php');
		}

		// Check if the user is authorized to do this.
		if (!JFactory::getUser()->authorise('core.admin'))
		{
			$this->app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'));
			$this->app->redirect('index.php');
		}

		// Set FTP credentials, if given.
		JClientHelper::setCredentialsFromRequest('ftp');

		$model = new ConfigModelConfig;
		$form  = $model->getForm();
		$data  = $this->input->post->get('jform', array(),
'array');

		// Validate the posted data.
		$return = $model->validate($form, $data);

		// Check for validation errors.
		if ($return === false)
		{
			/*
			 * The validate method enqueued all messages for us, so we just need to
redirect back.
			 */

			// Save the data in the session.
			$this->app->setUserState('com_config.config.global.data',
$data);

			// Redirect back to the edit screen.
			$this->app->redirect(JRoute::_('index.php?option=com_config&controller=config.display.config',
false));
		}

		// Attempt to save the configuration.
		$data = $return;

		// Access backend com_config
		JLoader::registerPrefix('Config', JPATH_ADMINISTRATOR .
'/components/com_config');
		$saveClass = new ConfigControllerApplicationSave;

		// Get a document object
		$document = JFactory::getDocument();

		// Set backend required params
		$document->setType('json');

		// Execute backend controller
		$return = $saveClass->execute();

		// Reset params back after requesting from service
		$document->setType('html');

		// Check the return value.
		if ($return === false)
		{
			/*
			 * The save method enqueued all messages for us, so we just need to
redirect back.
			 */

			// Save the data in the session.
			$this->app->setUserState('com_config.config.global.data',
$data);

			// Save failed, go back to the screen and display a notice.
			$this->app->redirect(JRoute::_('index.php?option=com_config&controller=config.display.config',
false));
		}

		// Redirect back to com_config display
		$this->app->enqueueMessage(JText::_('COM_CONFIG_SAVE_SUCCESS'));
		$this->app->redirect(JRoute::_('index.php?option=com_config&controller=config.display.config',
false));

		return true;
	}
}
PKXn�[E0TY�
�
controller/display.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Base Display Controller
 *
 * @since  3.2
 */
class ConfigControllerDisplay extends JControllerBase
{
	/**
	 * Application object - Redeclared for proper typehinting
	 *
	 * @var    JApplicationCms
	 * @since  3.2
	 */
	protected $app;

	/**
	 * Prefix for the view and model classes
	 *
	 * @var    string
	 * @since  3.2
	 */
	public $prefix = 'Config';

	/**
	 * Execute the controller.
	 *
	 * @return  mixed  A rendered view or true
	 *
	 * @since   3.2
	 */
	public function execute()
	{
		// Get the document object.
		$document = JFactory::getDocument();

		$componentFolder = $this->input->getWord('option',
'com_config');

		if ($this->app->isClient('administrator'))
		{
			$viewName = $this->input->getWord('view',
'application');
		}
		else
		{
			$viewName = $this->input->getWord('view',
'config');
		}

		$viewFormat = $document->getType();
		$layoutName = $this->input->getWord('layout',
'default');

		// Register the layout paths for the view
		$paths = new SplPriorityQueue;

		if ($this->app->isClient('administrator'))
		{
			$paths->insert(JPATH_ADMINISTRATOR . '/components/' .
$componentFolder . '/view/' . $viewName . '/tmpl', 1);
		}
		else
		{
			$paths->insert(JPATH_BASE . '/components/' .
$componentFolder . '/view/' . $viewName . '/tmpl', 1);
		}

		$viewClass  = $this->prefix . 'View' . ucfirst($viewName) .
ucfirst($viewFormat);
		$modelClass = $this->prefix . 'Model' . ucfirst($viewName);

		if (class_exists($viewClass))
		{
			$model     = new $modelClass;
			$component =
$model->getState()->get('component.option');

			// Make sure com_joomlaupdate and com_privacy can only be accessed by
SuperUser
			if (in_array(strtolower($component), array('com_joomlaupdate',
'com_privacy'))
				&& !JFactory::getUser()->authorise('core.admin'))
			{
				$this->app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'),
'error');

				return;
			}

			// Access check.
			if (!JFactory::getUser()->authorise('core.admin',
$component)
				&& !JFactory::getUser()->authorise('core.options',
$component))
			{
				$this->app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'),
'error');

				return;
			}

			$view = new $viewClass($model, $paths);

			$view->setLayout($layoutName);

			// Push document object into the view.
			$view->document = $document;

			// Reply for service requests
			if ($viewFormat === 'json')
			{
				$this->app->allowCache(false);
				return $view->render();
			}

			// Render view.
			echo $view->render();
		}

		return true;
	}
}
PKXn�[Q<RF
F
controller/helper.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Helper class for controllers
 *
 * @since  3.2
 */
class ConfigControllerHelper
{
	/**
	 * Method to parse a controller from a url
	 * Defaults to the base controllers and passes an array of options.
	 * $options[0] is the location of the controller which defaults to the
core libraries (referenced as 'j'
	 * and then the named folder within the component entry point file.
	 * $options[1] is the name of the controller file,
	 * $options[2] is the name of the folder found in the component controller
folder for controllers
	 * not prefixed with Config.
	 * Additional options maybe added to parameterize the controller.
	 *
	 * @param   JApplicationBase  $app  An application object
	 *
	 * @return  JController  A JController object
	 *
	 * @since   3.2
	 */
	public function parseController($app)
	{
		$tasks = array();

		if ($task = $app->input->get('task'))
		{
			// Toolbar expects old style but we are using new style
			// Remove when toolbar can handle either directly
			if (strpos($task, '/') !== false)
			{
				$tasks = explode('/', $task);
			}
			else
			{
				$tasks = explode('.', $task);
			}
		}
		elseif ($controllerTask = $app->input->get('controller'))
		{
			// Temporary solution
			if (strpos($controllerTask, '/') !== false)
			{
				$tasks = explode('/', $controllerTask);
			}
			else
			{
				$tasks = explode('.', $controllerTask);
			}
		}

		if (empty($tasks[0]) || $tasks[0] === 'Config')
		{
			$location = 'Config';
		}
		else
		{
			$location = ucfirst(strtolower($tasks[0]));
		}

		if (empty($tasks[1]))
		{
			$activity = 'Display';
		}
		else
		{
			$activity = ucfirst(strtolower($tasks[1]));
		}

		$view = '';

		if (!empty($tasks[2]))
		{
			$view = ucfirst(strtolower($tasks[2]));
		}

		// Some special handling for com_config administrator
		$option = $app->input->get('option');

		if ($option === 'com_config' &&
$app->isClient('administrator'))
		{
			$component = $app->input->get('component');

			if (!empty($component))
			{
				$view = 'Component';
			}
			elseif ($option === 'com_config')
			{
				$view = 'Application';
			}
		}

		$controllerName = $location . 'Controller' . $view . $activity;

		if (!class_exists($controllerName))
		{
			return false;
		}

		$controller = new $controllerName;
		$controller->options = array();
		$controller->options = $tasks;

		return $controller;
	}
}
PKXn�[����controller/modules/cancel.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Cancel Controller for module editing
 *
 * @package     Joomla.Site
 * @subpackage  com_config
 * @since       3.2
 */
class ConfigControllerModulesCancel extends ConfigControllerCanceladmin
{
	/**
	 * Method to cancel module editing.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   3.2
	 */
	public function execute()
	{
		// Check if the user is authorized to do this.
		$user = JFactory::getUser();

		if (!$user->authorise('module.edit.frontend',
'com_modules.module.' . $this->input->get('id')))
		{
			$this->app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'));
			$this->app->redirect('index.php');
		}

		$this->context = 'com_config.config.global';

		// Get returnUri
		$returnUri = $this->input->post->get('return', null,
'base64');

		if (!empty($returnUri))
		{
			$this->redirect = base64_decode(urldecode($returnUri));
		}
		else
		{
			$this->redirect = JUri::base();
		}

		$id = $this->input->getInt('id');

		// Access backend com_module
		JLoader::register('ModulesControllerModule',
JPATH_ADMINISTRATOR .
'/components/com_modules/controllers/module.php');
		JLoader::register('ModulesViewModule', JPATH_ADMINISTRATOR .
'/components/com_modules/views/module/view.json.php');
		JLoader::register('ModulesModelModule', JPATH_ADMINISTRATOR .
'/components/com_modules/models/module.php');

		$cancelClass = new ModulesControllerModule;

		$cancelClass->cancel($id);

		parent::execute();
	}
}
PKXn�[�@/�llcontroller/modules/display.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Display Controller for module editing
 *
 * @package     Joomla.Site
 * @subpackage  com_config
 * @since       3.2
 */
class ConfigControllerModulesDisplay extends ConfigControllerDisplay
{
	/**
	 * Method to display module editing.
	 *
	 * @return  boolean  True on success, false on failure.
	 *
	 * @since   3.2
	 */
	public function execute()
	{

		// Get the application
		$app = $this->getApplication();

		// Get the document object.
		$document     = JFactory::getDocument();

		$viewName     = $this->input->getWord('view',
'modules');
		$viewFormat   = $document->getType();
		$layoutName   = $this->input->getWord('layout',
'default');
		$returnUri    = $this->input->get->get('return', null,
'base64');

		// Construct redirect URI
		if (!empty($returnUri))
		{
			$redirect = base64_decode(urldecode($returnUri));

			// Don't redirect to an external URL.
			if (!JUri::isInternal($redirect))
			{
				$redirect = JUri::base();
			}
		}
		else
		{
			$redirect = JUri::base();
		}

		// Access backend com_module
		JLoader::register('ModulesController', JPATH_ADMINISTRATOR .
'/components/com_modules/controller.php');
		JLoader::register('ModulesViewModule', JPATH_ADMINISTRATOR .
'/components/com_modules/views/module/view.json.php');
		JLoader::register('ModulesModelModule', JPATH_ADMINISTRATOR .
'/components/com_modules/models/module.php');

		$displayClass = new ModulesController;

		// Get the parameters of the module with Id
		$document->setType('json');

		// Execute backend controller
		if (!($serviceData = json_decode($displayClass->display(), true)))
		{
			$app->redirect($redirect);
		}

		// Reset params back after requesting from service
		$document->setType('html');
		$app->input->set('view', $viewName);

		// Register the layout paths for the view
		$paths = new SplPriorityQueue;
		$paths->insert(JPATH_COMPONENT . '/view/' . $viewName .
'/tmpl', 'normal');

		$viewClass  = 'ConfigView' . ucfirst($viewName) .
ucfirst($viewFormat);
		$modelClass = 'ConfigModel' . ucfirst($viewName);

		if (class_exists($viewClass))
		{
			$model = new $modelClass;

			// Access check.
			$user = JFactory::getUser();

			if (!$user->authorise('module.edit.frontend',
'com_modules.module.' . $serviceData['id']))
			{
				$app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'),
'error');
				$app->redirect($redirect);
			}

			// Need to add module name to the state of model
			$model->getState()->set('module.name',
$serviceData['module']);

			$view = new $viewClass($model, $paths);

			$view->setLayout($layoutName);

			// Push document object into the view.
			$view->document = $document;

			// Load form and bind data
			$form = $model->getForm();

			if ($form)
			{
				$form->bind($serviceData);
			}

			// Set form and data to the view
			$view->form = &$form;
			$view->item = &$serviceData;

			// Render view.
			echo $view->render();
		}

		return true;
	}
}
PKXn�[9mX���controller/modules/save.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Save Controller for module editing
 *
 * @package     Joomla.Site
 * @subpackage  com_config
 * @since       3.2
 */
class ConfigControllerModulesSave extends JControllerBase
{
	/**
	 * Method to save module editing.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   3.2
	 */
	public function execute()
	{
		// Check for request forgeries.
		if (!JSession::checkToken())
		{
			$this->app->enqueueMessage(JText::_('JINVALID_TOKEN'));
			$this->app->redirect('index.php');
		}

		// Check if the user is authorized to do this.
		$user = JFactory::getUser();

		if (!$user->authorise('module.edit.frontend',
'com_modules.module.' . $this->input->get('id')))
		{
			$this->app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'),
'error');
			$this->app->redirect('index.php');
		}

		// Set FTP credentials, if given.
		JClientHelper::setCredentialsFromRequest('ftp');

		// Get submitted module id
		$moduleId = '&id=' .
$this->input->get('id');

		// Get returnUri
		$returnUri = $this->input->post->get('return', null,
'base64');
		$redirect = '';

		if (!empty($returnUri))
		{
			$redirect = '&return=' . $returnUri;
		}

		// Access backend com_modules to be done
		JLoader::register('ModulesControllerModule',
JPATH_ADMINISTRATOR .
'/components/com_modules/controllers/module.php');
		JLoader::register('ModulesModelModule', JPATH_ADMINISTRATOR .
'/components/com_modules/models/module.php');

		$controllerClass = new ModulesControllerModule;

		// Get a document object
		$document = JFactory::getDocument();

		// Set backend required params
		$document->setType('json');

		// Execute backend controller
		$return = $controllerClass->save();

		// Reset params back after requesting from service
		$document->setType('html');

		// Check the return value.
		if ($return === false)
		{
			// Save the data in the session.
			$data = $this->input->post->get('jform', array(),
'array');

			$this->app->setUserState('com_config.modules.global.data',
$data);

			// Save failed, go back to the screen and display a notice.
			$this->app->enqueueMessage(JText::_('JERROR_SAVE_FAILED'));
			$this->app->redirect(JRoute::_('index.php?option=com_config&controller=config.display.modules'
. $moduleId . $redirect, false));
		}

		// Redirect back to com_config display
		$this->app->enqueueMessage(JText::_('COM_CONFIG_MODULES_SAVE_SUCCESS'));

		// Set the redirect based on the task.
		switch ($this->options[3])
		{
			case 'apply':
				$this->app->redirect(JRoute::_('index.php?option=com_config&controller=config.display.modules'
. $moduleId . $redirect, false));
				break;

			case 'save':
			default:

				if (!empty($returnUri))
				{
					$redirect = base64_decode(urldecode($returnUri));

					// Don't redirect to an external URL.
					if (!JUri::isInternal($redirect))
					{
						$redirect = JUri::base();
					}
				}
				else
				{
					$redirect = JUri::base();
				}

				$this->app->redirect($redirect);
				break;
		}
	}
}
PKXn�[�&��O
O
 controller/templates/display.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Display Controller for global configuration
 *
 * @since  3.2
 */
class ConfigControllerTemplatesDisplay extends ConfigControllerDisplay
{
	/**
	 * Method to display global configuration.
	 *
	 * @return  boolean  True on success, false on failure.
	 *
	 * @since   3.2
	 */
	public function execute()
	{
		// Get the application
		$app = $this->getApplication();

		// Get the document object.
		$document     = JFactory::getDocument();

		$viewName     = $this->input->getWord('view',
'templates');
		$viewFormat   = $document->getType();
		$layoutName   = $this->input->getWord('layout',
'default');

		// Access backend com_config
		JLoader::register('TemplatesController', JPATH_ADMINISTRATOR .
'/components/com_templates/controller.php');
		JLoader::register('TemplatesViewStyle', JPATH_ADMINISTRATOR .
'/components/com_templates/views/style/view.json.php');
		JLoader::register('TemplatesModelStyle', JPATH_ADMINISTRATOR .
'/components/com_templates/models/style.php');

		$displayClass = new TemplatesController;

		// Set backend required params
		$document->setType('json');
		$this->input->set('id',
$app->getTemplate(true)->id);

		// Execute backend controller
		$serviceData = json_decode($displayClass->display(), true);

		// Reset params back after requesting from service
		$document->setType('html');
		$this->input->set('view', $viewName);

		// Register the layout paths for the view
		$paths = new SplPriorityQueue;
		$paths->insert(JPATH_COMPONENT . '/view/' . $viewName .
'/tmpl', 'normal');

		$viewClass  = 'ConfigView' . ucfirst($viewName) .
ucfirst($viewFormat);
		$modelClass = 'ConfigModel' . ucfirst($viewName);

		if (class_exists($viewClass))
		{
			if ($viewName !== 'close')
			{
				$model = new $modelClass;

				// Access check.
				if (!JFactory::getUser()->authorise('core.admin',
$model->getState('component.option')))
				{
					$app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'),
'error');

					return;
				}
			}

			$view = new $viewClass($model, $paths);

			$view->setLayout($layoutName);

			// Push document object into the view.
			$view->document = $document;

			// Load form and bind data
			$form = $model->getForm();

			if ($form)
			{
				$form->bind($serviceData);
			}

			// Set form and data to the view
			$view->form = &$form;

			// Render view.
			echo $view->render();
		}

		return true;
	}
}
PKXn�[��x�	�	controller/templates/save.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Save Controller for global configuration
 *
 * @since  3.2
 */
class ConfigControllerTemplatesSave extends JControllerBase
{
	/**
	 * Method to save global configuration.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   3.2
	 */
	public function execute()
	{
		// Check for request forgeries.
		if (!JSession::checkToken())
		{
			JFactory::getApplication()->redirect('index.php',
JText::_('JINVALID_TOKEN'));
		}

		// Check if the user is authorized to do this.
		if (!JFactory::getUser()->authorise('core.admin'))
		{
			JFactory::getApplication()->redirect('index.php',
JText::_('JERROR_ALERTNOAUTHOR'));

			return;
		}

		// Set FTP credentials, if given.
		JClientHelper::setCredentialsFromRequest('ftp');

		$app = JFactory::getApplication();

		// Access backend com_templates
		JLoader::register('TemplatesControllerStyle',
JPATH_ADMINISTRATOR .
'/components/com_templates/controllers/style.php');
		JLoader::register('TemplatesModelStyle', JPATH_ADMINISTRATOR .
'/components/com_templates/models/style.php');
		JLoader::register('TemplatesTableStyle', JPATH_ADMINISTRATOR .
'/components/com_templates/tables/style.php');
		$controllerClass = new TemplatesControllerStyle;

		// Get a document object
		$document = JFactory::getDocument();

		// Set backend required params
		$document->setType('json');
		$this->input->set('id',
$app->getTemplate(true)->id);

		// Execute backend controller
		$return = $controllerClass->save();

		// Reset params back after requesting from service
		$document->setType('html');

		// Check the return value.
		if ($return === false)
		{
			// Save the data in the session.
			$app->setUserState('com_config.config.global.data', $data);

			// Save failed, go back to the screen and display a notice.
			$message = JText::sprintf('JERROR_SAVE_FAILED');

			$app->redirect(JRoute::_('index.php?option=com_config&controller=config.display.templates',
false), $message, 'error');

			return false;
		}

		// Set the success message.
		$message = JText::_('COM_CONFIG_SAVE_SUCCESS');

		// Redirect back to com_config display
		$app->redirect(JRoute::_('index.php?option=com_config&controller=config.display.templates',
false), $message);

		return true;
	}
}
PKXn�[�j==
model/cms.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\Registry\Registry;

/**
 * Prototype admin model.
 *
 * @since  3.2
 */
abstract class ConfigModelCms extends JModelDatabase
{
	/**
	 * The model (base) name
	 *
	 * @var    string
	 * @since  3.2
	 */
	protected $name;

	/**
	 * The URL option for the component.
	 *
	 * @var    string
	 * @since  3.2
	 */
	protected $option = null;

	/**
	 * The prefix to use with controller messages.
	 *
	 * @var    string
	 * @since  3.2
	 */
	protected $text_prefix = null;

	/**
	 * Indicates if the internal state has been set
	 *
	 * @var    boolean
	 * @since  3.2
	 */
	protected $__state_set = null;

	/**
	 * Constructor
	 *
	 * @param   array  $config  An array of configuration options (name,
state, dbo, table_path, ignore_request).
	 *
	 * @since   3.2
	 * @throws  Exception
	 */
	public function __construct($config = array())
	{
		// Guess the option from the class name (Option)Model(View).
		if (empty($this->option))
		{
			$r = null;

			if (!preg_match('/(.*)Model/i', get_class($this), $r))
			{
				throw new
Exception(JText::_('JLIB_APPLICATION_ERROR_MODEL_GET_NAME'),
500);
			}

			$this->option = 'com_' . strtolower($r[1]);
		}

		// Set the view name
		if (empty($this->name))
		{
			if (array_key_exists('name', $config))
			{
				$this->name = $config['name'];
			}
			else
			{
				$this->name = $this->getName();
			}
		}

		// Set the model state
		if (array_key_exists('state', $config))
		{
			$this->state = $config['state'];
		}
		else
		{
			$this->state = new Registry;
		}

		// Set the model dbo
		if (array_key_exists('dbo', $config))
		{
			$this->db = $config['dbo'];
		}

		// Register the paths for the form
		$paths = $this->registerTablePaths($config);

		// Set the internal state marker - used to ignore setting state from the
request
		if (!empty($config['ignore_request']))
		{
			$this->__state_set = true;
		}

		// Set the clean cache event
		if (isset($config['event_clean_cache']))
		{
			$this->event_clean_cache = $config['event_clean_cache'];
		}
		elseif (empty($this->event_clean_cache))
		{
			$this->event_clean_cache = 'onContentCleanCache';
		}

		$state = new Registry($config);

		parent::__construct($state);
	}

	/**
	 * Method to get the model name
	 *
	 * The model name. By default parsed using the classname or it can be set
	 * by passing a $config['name'] in the class constructor
	 *
	 * @return  string  The name of the model
	 *
	 * @since   3.2
	 * @throws  Exception
	 */
	public function getName()
	{
		if (empty($this->name))
		{
			$r = null;

			if (!preg_match('/Model(.*)/i', get_class($this), $r))
			{
				throw new
Exception(JText::_('JLIB_APPLICATION_ERROR_MODEL_GET_NAME'),
500);
			}

			$this->name = strtolower($r[1]);
		}

		return $this->name;
	}

	/**
	 * Method to get model state variables
	 *
	 * @return  object  The property where specified, the state object where
omitted
	 *
	 * @since   3.2
	 */
	public function getState()
	{
		if (!$this->__state_set)
		{
			// Protected method to auto-populate the model state.
			$this->populateState();

			// Set the model state set flag to true.
			$this->__state_set = true;
		}

		return $this->state;
	}

	/**
	 * Method to register paths for tables
	 *
	 * @param   array  $config  Configuration array
	 *
	 * @return  object  The property where specified, the state object where
omitted
	 *
	 * @since   3.2
	 */
	public function registerTablePaths($config = array())
	{
		// Set the default view search path
		if (array_key_exists('table_path', $config))
		{
			$this->addTablePath($config['table_path']);
		}
		elseif (defined('JPATH_COMPONENT_ADMINISTRATOR'))
		{
			// Register the paths for the form
			$paths = new SplPriorityQueue;
			$paths->insert(JPATH_COMPONENT_ADMINISTRATOR . '/table',
'normal');

			// For legacy purposes. Remove for 4.0
			$paths->insert(JPATH_COMPONENT_ADMINISTRATOR . '/tables',
'normal');
		}
	}

	/**
	 * Clean the cache
	 *
	 * @param   string   $group     The cache group
	 * @param   integer  $clientId  The ID of the client
	 *
	 * @return  void
	 *
	 * @since   3.2
	 */
	protected function cleanCache($group = null, $clientId = 0)
	{
		$conf = JFactory::getConfig();
		$dispatcher = JEventDispatcher::getInstance();

		$options = array(
			'defaultgroup' => $group ?: (isset($this->option) ?
$this->option :
JFactory::getApplication()->input->get('option')),
			'cachebase' => $clientId ? JPATH_ADMINISTRATOR .
'/cache' : $conf->get('cache_path', JPATH_SITE .
'/cache'));

		$cache = JCache::getInstance('callback', $options);
		$cache->clean();

		// Trigger the onContentCleanCache event.
		$dispatcher->trigger($this->event_clean_cache, $options);
	}

	/**
	 * Method to auto-populate the model state.
	 *
	 * This method should only be called once per instantiation and is
designed
	 * to be called on the first call to the getState() method unless the
model
	 * configuration flag to ignore the request is set.
	 *
	 * @return  void
	 *
	 * @note    Calling getState in this method will result in recursion.
	 * @since   3.2
	 */
	protected function populateState()
	{
		$this->loadState();
	}

	/**
	 * Method to test whether a record can be deleted.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to delete the record. Defaults to the
permission set in the component.
	 *
	 * @since   3.2
	 */
	protected function canDelete($record)
	{
		if (empty($record->id) || $record->published != -2)
		{
			return false;
		}

		return JFactory::getUser()->authorise('core.delete',
$this->option);
	}

	/**
	 * Method to test whether a record can have its state changed.
	 *
	 * @param   object  $record  A record object.
	 *
	 * @return  boolean  True if allowed to change the state of the record.
Defaults to the permission set in the component.
	 *
	 * @since   3.2
	 */
	protected function canEditState($record)
	{
		return JFactory::getUser()->authorise('core.edit.state',
$this->option);
	}
}
PKXn�[-*��model/config.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Model for the global configuration
 *
 * @since  3.2
 */
class ConfigModelConfig extends ConfigModelForm
{
	/**
	 * Method to get a form object.
	 *
	 * @param   array    $data      Data for the form.
	 * @param   boolean  $loadData  True if the form is to load its own data
(default case), false if not.
	 *
	 * @return  mixed	A JForm object on success, false on failure
	 *
	 * @since	3.2
	 */
	public function getForm($data = array(), $loadData = true)
	{
		// Get the form.
		$form = $this->loadForm('com_config.config',
'config', array('control' => 'jform',
'load_data' => $loadData));

		if (empty($form))
		{
			return false;
		}

		return $form;
	}
}
PKXn�[��E�
�
model/form/config.xmlnu�[���<?xml version="1.0"
encoding="utf-8"?>
<form>
	<fieldset
		name="metadata"
		label="COM_CONFIG_METADATA_SETTINGS">
		<field
			name="MetaDesc"
			type="textarea"
			label="COM_CONFIG_FIELD_METADESC_LABEL"
			description="COM_CONFIG_FIELD_METADESC_DESC"
			filter="string"
			cols="60"
			rows="3" 
		/>

		<field
			name="MetaKeys"
			type="textarea"
			label="COM_CONFIG_FIELD_METAKEYS_LABEL"
			description="COM_CONFIG_FIELD_METAKEYS_DESC"
			filter="string"
			cols="60"
			rows="3" 
		/>

		<field
			name="MetaRights"
			type="textarea"
			label="JFIELD_META_RIGHTS_LABEL"
			description="JFIELD_META_RIGHTS_DESC"
			filter="string"
			cols="60"
			rows="2"
		/>

	</fieldset>

	<fieldset
		name="seo"
		label="CONFIG_SEO_SETTINGS_LABEL">
		<field
			name="sef"
			type="radio"
			label="COM_CONFIG_FIELD_SEF_URL_LABEL"
			description="COM_CONFIG_FIELD_SEF_URL_DESC"
			default="1"
			class="btn-group"
			filter="integer"
			>
			<option value="1">JYES</option>
			<option value="0">JNO</option>
		</field>

		<field
			name="sitename_pagetitles"
			type="list"
			label="COM_CONFIG_FIELD_SITENAME_PAGETITLES_LABEL"
			description="COM_CONFIG_FIELD_SITENAME_PAGETITLES_DESC"
			default="0"
			filter="integer"
			>
			<option
value="2">COM_CONFIG_FIELD_VALUE_AFTER</option>
			<option
value="1">COM_CONFIG_FIELD_VALUE_BEFORE</option>
			<option value="0">JNO</option>
		</field>

	</fieldset>	

	<fieldset
		name="site"
		label="CONFIG_SITE_SETTINGS_LABEL">

		<field
			name="sitename"
			type="text"
			label="COM_CONFIG_FIELD_SITE_NAME_LABEL"
			description="COM_CONFIG_FIELD_SITE_NAME_DESC"
			required="true"
			filter="string"
			size="50" 
		/>

		<field
			name="offline"
			type="radio"
			label="COM_CONFIG_FIELD_SITE_OFFLINE_LABEL"
			description="COM_CONFIG_FIELD_SITE_OFFLINE_DESC"
			default="0"
			class="btn-group"
			filter="integer"
			>
			<option value="1">JYES</option>
			<option value="0">JNO</option>
		</field>

		<field
			name="access"
			type="accesslevel"
			label="COM_CONFIG_FIELD_DEFAULT_ACCESS_LEVEL_LABEL"
			description="COM_CONFIG_FIELD_DEFAULT_ACCESS_LEVEL_DESC"
			default="1"
			filter="integer" 
		/>

		<field
			name="list_limit"
			type="list"
			label="COM_CONFIG_FIELD_DEFAULT_LIST_LIMIT_LABEL"
			description="COM_CONFIG_FIELD_DEFAULT_LIST_LIMIT_DESC"
			default="20"
			filter="integer"
			>
			<option value="5">J5</option>
			<option value="10">J10</option>
			<option value="15">J15</option>
			<option value="20">J20</option>
			<option value="25">J25</option>
			<option value="30">J30</option>
			<option value="50">J50</option>
			<option value="100">J100</option>
		</field>
		
	</fieldset>

	<fieldset>
		<field
			name="asset_id"
			type="hidden" 
		/>
	</fieldset>
</form>
PKXn�[��7��model/form/modules.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
	<fieldset>
		<field 
			name="id" 
			type="number"
			label="JGLOBAL_FIELD_ID_LABEL"
			description="JGLOBAL_FIELD_ID_DESC"
			default="0"
			readonly="true"
		/>

		<field
			name="title" 
			type="text"
			label="JGLOBAL_TITLE"
			description="COM_MODULES_FIELD_TITLE_DESC"
			maxlength="100"
			required="true"
			size="35"
		/>

		<field 
			name="note" 
			type="text"
			label="COM_MODULES_FIELD_NOTE_LABEL"
			description="COM_MODULES_FIELD_NOTE_DESC"
			maxlength="255"
			size="35"
		/>

		<field 
			name="module" 
			type="hidden"
			label="COM_MODULES_FIELD_MODULE_LABEL"
			description="COM_MODULES_FIELD_MODULE_DESC"
			readonly="readonly"
			size="20"
		/>

		<field 
			name="showtitle" 
			type="radio"
			label="COM_MODULES_FIELD_SHOWTITLE_LABEL"
			description="COM_MODULES_FIELD_SHOWTITLE_DESC"
			class="btn-group btn-group-yesno"
			default="1"
			size="1"
			>
			<option value="1">JSHOW</option>
			<option value="0">JHIDE</option>
		</field>

		<field 
			name="published" 
			type="radio"
			label="JSTATUS"
			description="COM_MODULES_FIELD_PUBLISHED_DESC"
			class="btn-group"
			default="1"
			size="1"
			>
			<option value="1">JPUBLISHED</option>
			<option value="0">JUNPUBLISHED</option>
			<option value="-2">JTRASHED</option>
		</field>

		<field
			name="publish_up"
			type="calendar"
			label="COM_MODULES_FIELD_PUBLISH_UP_LABEL"
			description="COM_MODULES_FIELD_PUBLISH_UP_DESC"
			filter="user_utc"
			class="input-medium"
			translateformat="true"
			showtime="true"
			size="22"
		/>

		<field
			name="publish_down"
			type="calendar"
			label="COM_MODULES_FIELD_PUBLISH_DOWN_LABEL"
			description="COM_MODULES_FIELD_PUBLISH_DOWN_DESC"
			filter="user_utc"
			class="input-medium"
			translateformat="true"
			showtime="true"
			size="22"
		/>

		<field 
			name="client_id" 
			type="hidden"
			label="COM_MODULES_FIELD_CLIENT_ID_LABEL"
			description="COM_MODULES_FIELD_CLIENT_ID_DESC"
			readonly="true"
			size="1"
		/>

		<field 
			name="position" 
			type="moduleposition"
			label="COM_MODULES_FIELD_POSITION_LABEL"
			description="COM_MODULES_FIELD_POSITION_DESC"
			default=""
			maxlength="50"
		/>

		<field 
			name="access" 
			type="accesslevel"
			label="JFIELD_ACCESS_LABEL"
			description="JFIELD_ACCESS_DESC"
			size="1"
		/>

		<field 
			name="ordering" 
			type="moduleorder"
			label="JFIELD_ORDERING_LABEL"
			description="JFIELD_ORDERING_DESC"
		/>

		<field 
			name="content" 
			type="editor"
			label="COM_MODULES_FIELD_CONTENT_LABEL"
			description="COM_MODULES_FIELD_CONTENT_DESC"
			buttons="true"
			class="inputbox"
			filter="JComponentHelper::filterText"
			hide="readmore,pagebreak"
		/>

		<field 
			name="language" 
			type="contentlanguage"
			label="JFIELD_LANGUAGE_LABEL"
			description="JFIELD_MODULE_LANGUAGE_DESC"
			>
			<option value="*">JALL</option>
		</field>

		<field name="assignment" type="hidden" />

		<field name="assigned" type="hidden" />
	</fieldset>
</form>
PKXn�[$�y�((model/form/modules_advanced.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
	<fields name="params">
		<fieldset
			name="advanced">

			<field
				name="module_tag"
				type="moduletag"
				label="COM_MODULES_FIELD_MODULE_TAG_LABEL"
				description="COM_MODULES_FIELD_MODULE_TAG_DESC"
				default="div"
				validate="options"
			/>

			<field
				name="bootstrap_size"
				type="integer"
				label="COM_MODULES_FIELD_BOOTSTRAP_SIZE_LABEL"
				description="COM_MODULES_FIELD_BOOTSTRAP_SIZE_DESC"
				first="0"
				last="12"
				step="1"
			/>

			<field
				name="header_tag"
				type="headertag"
				label="COM_MODULES_FIELD_HEADER_TAG_LABEL"
				description="COM_MODULES_FIELD_HEADER_TAG_DESC"
				default="h3"
				validate="options"
			/>

			<field
				name="header_class"
				type="text"
				label="COM_MODULES_FIELD_HEADER_CLASS_LABEL"
				description="COM_MODULES_FIELD_HEADER_CLASS_DESC"
			/>

			<field
				name="style"
				type="chromestyle"
				label="COM_MODULES_FIELD_MODULE_STYLE_LABEL"
				description="COM_MODULES_FIELD_MODULE_STYLE_DESC"
			/>
		</fieldset>
	</fields>
</form>
PKXn�[�iv~~model/form/templates.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
	<fieldset>
		<field
			name="id"
			type="number"
			label="JGLOBAL_FIELD_ID_LABEL"
			description="JGLOBAL_FIELD_ID_DESC"
			id="id"
			default="0"
			readonly="true"
			class="readonly"
		/>

		<field
			name="template"
			type="text"
			label="COM_TEMPLATES_FIELD_TEMPLATE_LABEL"
			description="COM_TEMPLATES_FIELD_TEMPLATE_DESC"
			class="readonly"
			size="30"
			readonly="true" 
		/>

		<field
			name="client_id"
			type="hidden"
			label="COM_TEMPLATES_FIELD_CLIENT_LABEL"
			description="COM_TEMPLATES_FIELD_CLIENT_DESC"
			class="readonly"
			default="0"
			readonly="true" 
		/>

		<field
			name="title"
			type="text"
			label="COM_TEMPLATES_FIELD_TITLE_LABEL"
			description="COM_TEMPLATES_FIELD_TITLE_DESC"
			class="inputbox"
			size="50"
			required="true" 
		/>

		<field name="assigned" type="hidden" />

	</fieldset>
</form>
PKXn�[�-�Q"Q"model/form.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\Utilities\ArrayHelper;

/**
 * Prototype form model.
 *
 * @see    JForm
 * @see    JFormField
 * @see    JFormRule
 * @since  3.2
 */
abstract class ConfigModelForm extends ConfigModelCms
{
	/**
	 * Array of form objects.
	 *
	 * @var    array
	 * @since  3.2
	 */
	protected $forms = array();

	/**
	 * Method to checkin a row.
	 *
	 * @param   integer  $pk  The numeric id of the primary key.
	 *
	 * @return  boolean  False on failure or error, true otherwise.
	 *
	 * @since   3.2
	 * @throws  RuntimeException
	 */
	public function checkin($pk = null)
	{
		// Only attempt to check the row in if it exists.
		if ($pk)
		{
			$user = JFactory::getUser();

			// Get an instance of the row to checkin.
			$table = $this->getTable();

			if (!$table->load($pk))
			{
				throw new RuntimeException($table->getError());
			}

			// Check if this is the user has previously checked out the row.
			if ($table->checked_out > 0 && $table->checked_out !=
$user->get('id') &&
!$user->authorise('core.admin', 'com_checkin'))
			{
				throw new RuntimeException($table->getError());
			}

			// Attempt to check the row in.
			if (!$table->checkin($pk))
			{
				throw new RuntimeException($table->getError());
			}
		}

		return true;
	}

	/**
	 * Method to check-out a row for editing.
	 *
	 * @param   integer  $pk  The numeric id of the primary key.
	 *
	 * @return  boolean  False on failure or error, true otherwise.
	 *
	 * @since   3.2
	 */
	public function checkout($pk = null)
	{
		// Only attempt to check the row in if it exists.
		if ($pk)
		{
			$user = JFactory::getUser();

			// Get an instance of the row to checkout.
			$table = $this->getTable();

			if (!$table->load($pk))
			{
				throw new RuntimeException($table->getError());
			}

			// Check if this is the user having previously checked out the row.
			if ($table->checked_out > 0 && $table->checked_out !=
$user->get('id'))
			{
				throw new
RuntimeException(JText::_('JLIB_APPLICATION_ERROR_CHECKOUT_USER_MISMATCH'));
			}

			// Attempt to check the row out.
			if (!$table->checkout($user->get('id'), $pk))
			{
				throw new RuntimeException($table->getError());
			}
		}

		return true;
	}

	/**
	 * Abstract method for getting the form from the model.
	 *
	 * @param   array    $data      Data for the form.
	 * @param   boolean  $loadData  True if the form is to load its own data
(default case), false if not.
	 *
	 * @return  mixed  A JForm object on success, false on failure
	 *
	 * @since   3.2
	 */
	abstract public function getForm($data = array(), $loadData = true);

	/**
	 * Method to get a form object.
	 *
	 * @param   string   $name     The name of the form.
	 * @param   string   $source   The form source. Can be XML string if file
flag is set to false.
	 * @param   array    $options  Optional array of options for the form
creation.
	 * @param   boolean  $clear    Optional argument to force load a new form.
	 * @param   string   $xpath    An optional xpath to search for the fields.
	 *
	 * @return  mixed  JForm object on success, False on error.
	 *
	 * @see     JForm
	 * @since   3.2
	 */
	protected function loadForm($name, $source = null, $options = array(),
$clear = false, $xpath = false)
	{
		// Handle the optional arguments.
		$options['control'] = ArrayHelper::getValue($options,
'control', false);

		// Create a signature hash.
		$hash = sha1($source . serialize($options));

		// Check if we can use a previously loaded form.
		if (isset($this->_forms[$hash]) && !$clear)
		{
			return $this->_forms[$hash];
		}

		// Get the form.
		// Register the paths for the form -- failing here
		$paths = new SplPriorityQueue;
		$paths->insert(JPATH_COMPONENT_ADMINISTRATOR .
'/model/form', 'normal');
		$paths->insert(JPATH_COMPONENT_ADMINISTRATOR .
'/model/field', 'normal');
		$paths->insert(JPATH_COMPONENT . '/model/form',
'normal');
		$paths->insert(JPATH_COMPONENT . '/model/field',
'normal');
		$paths->insert(JPATH_COMPONENT . '/model/rule',
'normal');

		// Legacy support to be removed in 4.0.  -- failing here
		$paths->insert(JPATH_COMPONENT . '/models/forms',
'normal');
		$paths->insert(JPATH_COMPONENT . '/models/fields',
'normal');
		$paths->insert(JPATH_COMPONENT . '/models/rules',
'normal');

		// Solution until JForm supports splqueue
		JForm::addFormPath(JPATH_COMPONENT . '/models/forms');
		JForm::addFieldPath(JPATH_COMPONENT . '/models/fields');
		JForm::addFormPath(JPATH_COMPONENT_ADMINISTRATOR .
'/model/form');
		JForm::addFieldPath(JPATH_COMPONENT_ADMINISTRATOR .
'/model/field');
		JForm::addFormPath(JPATH_COMPONENT . '/model/form');
		JForm::addFieldPath(JPATH_COMPONENT . '/model/field');

		try
		{
			$form = JForm::getInstance($name, $source, $options, false, $xpath);

			if (isset($options['load_data']) &&
$options['load_data'])
			{
				// Get the data for the form.
				$data = $this->loadFormData();
			}
			else
			{
				$data = array();
			}

			// Allow for additional modification of the form, and events to be
triggered.
			// We pass the data because plugins may require it.
			$this->preprocessForm($form, $data);

			// Load the data into the form after the plugins have operated.
			$form->bind($data);
		}
		catch (Exception $e)
		{
			JFactory::getApplication()->enqueueMessage($e->getMessage());

			return false;
		}

		// Store the form for later.
		$this->_forms[$hash] = $form;

		return $form;
	}

	/**
	 * Method to get the data that should be injected in the form.
	 *
	 * @return  array    The default data is an empty array.
	 *
	 * @since   3.2
	 */
	protected function loadFormData()
	{
		return array();
	}

	/**
	 * Method to allow derived classes to preprocess the data.
	 *
	 * @param   string  $context  The context identifier.
	 * @param   mixed   &$data    The data to be processed. It gets
altered directly.
	 *
	 * @return  void
	 *
	 * @since   3.2
	 */
	protected function preprocessData($context, &$data)
	{
		// Get the dispatcher and load the users plugins.
		$dispatcher = JEventDispatcher::getInstance();
		JPluginHelper::importPlugin('content');

		// Trigger the data preparation event.
		$results = $dispatcher->trigger('onContentPrepareData',
array($context, $data));

		// Check for errors encountered while preparing the data.
		if (count($results) > 0 && in_array(false, $results, true))
		{
			JFactory::getApplication()->enqueueMessage($dispatcher->getError(),
'error');
		}
	}

	/**
	 * Method to allow derived classes to preprocess the form.
	 *
	 * @param   JForm   $form   A JForm object.
	 * @param   mixed   $data   The data expected for the form.
	 * @param   string  $group  The name of the plugin group to import
(defaults to "content").
	 *
	 * @return  void
	 *
	 * @see     JFormField
	 * @since   3.2
	 * @throws  Exception if there is an error in the form event.
	 */
	protected function preprocessForm(JForm $form, $data, $group =
'content')
	{
		// Import the appropriate plugin group.
		JPluginHelper::importPlugin($group);

		// Get the dispatcher.
		$dispatcher = JEventDispatcher::getInstance();

		// Trigger the form preparation event.
		$results = $dispatcher->trigger('onContentPrepareForm',
array($form, $data));

		// Check for errors encountered while preparing the form.
		if (count($results) && in_array(false, $results, true))
		{
			// Get the last error.
			$error = $dispatcher->getError();

			if (!($error instanceof Exception))
			{
				throw new Exception($error);
			}
		}
	}

	/**
	 * Method to validate the form data.
	 *
	 * @param   JForm   $form   The form to validate against.
	 * @param   array   $data   The data to validate.
	 * @param   string  $group  The name of the field group to validate.
	 *
	 * @return  mixed  Array of filtered data if valid, false otherwise.
	 *
	 * @see     JFormRule
	 * @see     JFilterInput
	 * @since   3.2
	 */
	public function validate($form, $data, $group = null)
	{
		// Filter and validate the form data.
		$data   = $form->filter($data);
		$return = $form->validate($data, $group);

		// Check for an error.
		if ($return instanceof Exception)
		{
			JFactory::getApplication()->enqueueMessage($return->getMessage(),
'error');

			return false;
		}

		// Check the validation results.
		if ($return === false)
		{
			// Get the validation messages from the form.
			foreach ($form->getErrors() as $message)
			{
				if ($message instanceof Exception)
				{
					$message = $message->getMessage();
				}

				JFactory::getApplication()->enqueueMessage($message,
'error');
			}

			return false;
		}

		return $data;
	}
}
PKXn�[器�model/modules.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Config Module model.
 *
 * @since  3.2
 */
class ConfigModelModules extends ConfigModelForm
{
	/**
	 * Method to auto-populate the model state.
	 *
	 * Note. Calling getState in this method will result in recursion.
	 *
	 * @return  void
	 *
	 * @since   3.2
	 */
	protected function populateState()
	{
		$app = JFactory::getApplication('administrator');

		// Load the User state.
		$pk = $app->input->getInt('id');

		$state = $this->loadState();

		$state->set('module.id', $pk);

		$this->setState($state);
	}

	/**
	 * Method to get the record form.
	 *
	 * @param   array    $data      Data for the form.
	 * @param   boolean  $loadData  True if the form is to load its own data
(default case), false if not.
	 *
	 * @return  JForm  A JForm object on success, false on failure
	 *
	 * @since   3.2
	 */
	public function getForm($data = array(), $loadData = true)
	{
		// Get the form.
		$form = $this->loadForm('com_config.modules',
'modules', array('control' => 'jform',
'load_data' => $loadData));

		if (empty($form))
		{
			return false;
		}

		$form->setFieldAttribute('position', 'client', 
'site');

		return $form;
	}

	/**
	 * Method to preprocess the form
	 *
	 * @param   JForm   $form   A form object.
	 * @param   mixed   $data   The data expected for the form.
	 * @param   string  $group  The name of the plugin group to import
(defaults to "content").
	 *
	 * @return  void
	 *
	 * @since   3.2
	 * @throws  Exception if there is an error loading the form.
	 */
	protected function preprocessForm(JForm $form, $data, $group =
'content')
	{
		jimport('joomla.filesystem.path');

		$lang     = JFactory::getLanguage();

		$module = $this->getState()->get('module.name');
		$basePath = JPATH_BASE;

		$formFile = JPath::clean($basePath . '/modules/' . $module .
'/' . $module . '.xml');

		// Load the core and/or local language file(s).
		$lang->load($module, $basePath, null, false, true)
			||	 $lang->load($module, $basePath . '/modules/' . $module,
null, false, true);

		if (file_exists($formFile))
		{
			// Get the module form.
			if (!$form->loadFile($formFile, false, '//config'))
			{
				throw new Exception(JText::_('JERROR_LOADFILE_FAILED'));
			}

			// Attempt to load the xml file.
			if (!$xml = simplexml_load_file($formFile))
			{
				throw new Exception(JText::_('JERROR_LOADFILE_FAILED'));
			}
		}

		// Load the default advanced params
		JForm::addFormPath(JPATH_BASE .
'/components/com_config/model/form');
		$form->loadFile('modules_advanced', false);

		// Trigger the default form events.
		parent::preprocessForm($form, $data, $group);
	}

	/**
	 * Method to get list of module positions in current template
	 *
	 * @return  array
	 *
	 * @since   3.2
	 */
	public function getPositions()
	{
		$lang         = JFactory::getLanguage();
		$templateName = JFactory::getApplication()->getTemplate();

		// Load templateDetails.xml file
		$path = JPath::clean(JPATH_BASE . '/templates/' . $templateName
. '/templateDetails.xml');
		$currentTemplatePositions = array();

		if (file_exists($path))
		{
			$xml = simplexml_load_file($path);

			if (isset($xml->positions[0]))
			{
				// Load language files
				$lang->load('tpl_' . $templateName . '.sys',
JPATH_BASE, null, false, true)
				||	$lang->load('tpl_' . $templateName . '.sys',
JPATH_BASE . '/templates/' . $templateName, null, false, true);

				foreach ($xml->positions[0] as $position)
				{
					$value = (string) $position;
					$text = preg_replace('/[^a-zA-Z0-9_\-]/', '_',
'TPL_' . strtoupper($templateName) . '_POSITION_' .
strtoupper($value));

					// Construct list of positions
					$currentTemplatePositions[] = self::createOption($value,
JText::_($text) . ' [' . $value . ']');
				}
			}
		}

		$templateGroups = array();

		// Add an empty value to be able to deselect a module position
		$option = self::createOption();
		$templateGroups[''] = self::createOptionGroup('',
array($option));

		$templateGroups[$templateName] = self::createOptionGroup($templateName,
$currentTemplatePositions);

		// Add custom position to options
		$customGroupText = JText::_('COM_MODULES_CUSTOM_POSITION');

		$editPositions   = true;
		$customPositions = self::getActivePositions(0, $editPositions);
		$templateGroups[$customGroupText] =
self::createOptionGroup($customGroupText, $customPositions);

		return $templateGroups;
	}

	/**
	 * Get a list of modules positions
	 *
	 * @param   integer  $clientId       Client ID
	 * @param   boolean  $editPositions  Allow to edit the positions
	 *
	 * @return  array  A list of positions
	 *
	 * @since   3.6.3
	 */
	public static function getActivePositions($clientId, $editPositions =
false)
	{
		$db = JFactory::getDbo();
		$query = $db->getQuery(true)
			->select('DISTINCT position')
			->from($db->quoteName('#__modules'))
			->where($db->quoteName('client_id') . ' = ' .
(int) $clientId)
			->order($db->quoteName('position'));

		$db->setQuery($query);

		try
		{
			$positions = $db->loadColumn();
			$positions = is_array($positions) ? $positions : array();
		}
		catch (RuntimeException $e)
		{
			JError::raiseWarning(500, $e->getMessage());

			return;
		}

		// Build the list
		$options = array();

		foreach ($positions as $position)
		{
			if (!$position && !$editPositions)
			{
				$options[] = JHtml::_('select.option', 'none',
':: ' . JText::_('JNONE') . ' ::');
			}
			else
			{
				$options[] = JHtml::_('select.option', $position, $position);
			}
		}

		return $options;
	}

	/**
	 * Create and return a new Option
	 *
	 * @param   string  $value  The option value [optional]
	 * @param   string  $text   The option text [optional]
	 *
	 * @return  object  The option as an object (stdClass instance)
	 *
	 * @since   3.6.3
	 */
	private static function createOption($value = '', $text =
'')
	{
		if (empty($text))
		{
			$text = $value;
		}

		$option = new stdClass;
		$option->value = $value;
		$option->text  = $text;

		return $option;
	}

	/**
	 * Create and return a new Option Group
	 *
	 * @param   string  $label    Value and label for group [optional]
	 * @param   array   $options  Array of options to insert into group
[optional]
	 *
	 * @return  array  Return the new group as an array
	 *
	 * @since   3.6.3
	 */
	private static function createOptionGroup($label = '', $options
= array())
	{
		$group = array();
		$group['value'] = $label;
		$group['text']  = $label;
		$group['items'] = $options;

		return $group;
	}
}
PKXn�["'��WWmodel/templates.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Template style model.
 *
 * @since  3.2
 */
class ConfigModelTemplates extends ConfigModelForm
{
	/**
	 * Method to auto-populate the model state.
	 *
	 * Note. Calling getState in this method will result in recursion.
	 *
	 * @return  null
	 *
	 * @since   3.2
	 */
	protected function populateState()
	{
		$state = $this->loadState();

		// Load the parameters.
		$params = JComponentHelper::getParams('com_templates');
		$state->set('params', $params);

		$this->setState($state);
	}

	/**
	 * Method to get the record form.
	 *
	 * @param   array    $data      An optional array of data for the form to
interrogate.
	 * @param   boolean  $loadData  True if the form is to load its own data
(default case), false if not.
	 *
	 * @return  JForm    A JForm object on success, false on failure
	 *
	 * @since   3.2
	 */
	public function getForm($data = array(), $loadData = true)
	{
		// Get the form.
		$form = $this->loadForm('com_config.templates',
'templates', array('control' => 'jform',
'load_data' => $loadData));

		try
		{
			$form = new JForm('com_config.templates');
			$data = array();
			$this->preprocessForm($form, $data);

			// Load the data into the form
			$form->bind($data);
		}
		catch (Exception $e)
		{
			JFactory::getApplication()->enqueueMessage($e->getMessage());

			return false;
		}

		if (empty($form))
		{
			return false;
		}

		return $form;
	}

	/**
	 * Method to preprocess the form
	 *
	 * @param   JForm   $form   A form object.
	 * @param   mixed   $data   The data expected for the form.
	 * @param   string  $group  Plugin group to load
	 *
	 * @return  void
	 *
	 * @since   3.2
	 * @throws	Exception if there is an error in the form event.
	 */
	protected function preprocessForm(JForm $form, $data, $group =
'content')
	{
		$lang = JFactory::getLanguage();

		$template = JFactory::getApplication()->getTemplate();

		jimport('joomla.filesystem.path');

		// Load the core and/or local language file(s).
		$lang->load('tpl_' . $template, JPATH_BASE, null, false,
true)
		|| $lang->load('tpl_' . $template, JPATH_BASE .
'/templates/' . $template, null, false, true);

		// Look for com_config.xml, which contains fields to display
		$formFile = JPath::clean(JPATH_BASE . '/templates/' . $template
. '/com_config.xml');

		if (!file_exists($formFile))
		{
			// If com_config.xml not found, fall back to templateDetails.xml
			$formFile = JPath::clean(JPATH_BASE . '/templates/' .
$template . '/templateDetails.xml');
		}

		// Get the template form.
		if (file_exists($formFile) && !$form->loadFile($formFile,
false, '//config'))
		{
			throw new Exception(JText::_('JERROR_LOADFILE_FAILED'));
		}

		// Attempt to load the xml file.
		if (!$xml = simplexml_load_file($formFile))
		{
			throw new Exception(JText::_('JERROR_LOADFILE_FAILED'));
		}

		// Trigger the default form events.
		parent::preprocessForm($form, $data, $group);
	}
}
PKZn�[=�!,,view/cms/html.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Prototype admin view.
 *
 * @since  3.2
 */
abstract class ConfigViewCmsHtml extends JViewHtml
{
	/**
	 * The output of the template script.
	 *
	 * @var    string
	 * @since  3.2
	 */
	protected $_output = null;

	/**
	 * The name of the default template source file.
	 *
	 * @var    string
	 * @since  3.2
	 */
	protected $_template = null;

	/**
	 * The set of search directories for resources (templates)
	 *
	 * @var    array
	 * @since  3.2
	 */
	protected $_path = array('template' => array(),
'helper' => array());

	/**
	 * Layout extension
	 *
	 * @var    string
	 * @since  3.2
	 */
	protected $_layoutExt = 'php';

	/**
	 * Method to instantiate the view.
	 *
	 * @param   JModel            $model  The model object.
	 * @param   SplPriorityQueue  $paths  The paths queue.
	 *
	 * @since   3.2
	 */
	public function __construct(JModel $model, SplPriorityQueue $paths = null)
	{
		$app = JFactory::getApplication();
		$component = JApplicationHelper::getComponentName();
		$component = preg_replace('/[^A-Z0-9_\.-]/i', '',
$component);

		if (isset($paths))
		{
			$paths->insert(JPATH_THEMES . '/' . $app->getTemplate()
. '/html/' . $component . '/' . $this->getName(),
2);
		}

		parent::__construct($model, $paths);
	}

	/**
	 * Load a template file -- first look in the templates folder for an
override
	 *
	 * @param   string  $tpl  The name of the template source file;
automatically searches the template paths and compiles as needed.
	 *
	 * @return  string  The output of the the template script.
	 *
	 * @since   3.2
	 * @throws  Exception
	 */
	public function loadTemplate($tpl = null)
	{
		// Clear prior output
		$this->_output = null;

		$template = JFactory::getApplication()->getTemplate();
		$layout = $this->getLayout();

		// Create the template file name based on the layout
		$file = isset($tpl) ? $layout . '_' . $tpl : $layout;

		// Clean the file name
		$file = preg_replace('/[^A-Z0-9_\.-]/i', '', $file);
		$tpl = isset($tpl) ? preg_replace('/[^A-Z0-9_\.-]/i',
'', $tpl) : $tpl;

		// Load the language file for the template
		$lang = JFactory::getLanguage();
		$lang->load('tpl_' . $template, JPATH_BASE, null, false,
true)
		|| $lang->load('tpl_' . $template, JPATH_THEMES .
"/$template", null, false, true);

		// Prevents adding path twise
		if (empty($this->_path['template']))
		{
			// Adding template paths
			$this->paths->top();
			$defaultPath = $this->paths->current();
			$this->paths->next();
			$templatePath = $this->paths->current();
			$this->_path['template'] = array($defaultPath,
$templatePath);
		}

		// Load the template script
		jimport('joomla.filesystem.path');
		$filetofind = $this->_createFileName('template',
array('name' => $file));
		$this->_template = JPath::find($this->_path['template'],
$filetofind);

		// If alternate layout can't be found, fall back to default layout
		if ($this->_template == false)
		{
			$filetofind = $this->_createFileName('',
array('name' => 'default' . (isset($tpl) ?
'_' . $tpl : $tpl)));
			$this->_template = JPath::find($this->_path['template'],
$filetofind);
		}

		if ($this->_template != false)
		{
			// Unset so as not to introduce into template scope
			unset($tpl, $file);

			// Never allow a 'this' property
			if (isset($this->this))
			{
				unset($this->this);
			}

			// Start capturing output into a buffer
			ob_start();

			// Include the requested template filename in the local scope
			// (this will execute the view logic).
			include $this->_template;

			// Done with the requested template; get the buffer and
			// clear it.
			$this->_output = ob_get_contents();
			ob_end_clean();

			return $this->_output;
		}
		else
		{
			throw new
Exception(JText::sprintf('JLIB_APPLICATION_ERROR_LAYOUTFILE_NOT_FOUND',
$file), 500);
		}
	}

	/**
	 * Create the filename for a resource
	 *
	 * @param   string  $type   The resource type to create the filename for
	 * @param   array   $parts  An associative array of filename information
	 *
	 * @return  string  The filename
	 *
	 * @since   3.2
	 */
	protected function _createFileName($type, $parts = array())
	{
		switch ($type)
		{
			case 'template':
				$filename = strtolower($parts['name']) . '.' .
$this->_layoutExt;
				break;

			default:
				$filename = strtolower($parts['name']) . '.php';
				break;
		}

		return $filename;
	}

	/**
	 * Method to get the view name
	 *
	 * The model name by default parsed using the classname, or it can be set
	 * by passing a $config['name'] in the class constructor
	 *
	 * @return  string  The name of the model
	 *
	 * @since   3.2
	 * @throws  Exception
	 */
	public function getName()
	{
		if (empty($this->_name))
		{
			$classname = get_class($this);
			$viewpos = strpos($classname, 'View');

			if ($viewpos === false)
			{
				throw new
Exception(JText::_('JLIB_APPLICATION_ERROR_VIEW_GET_NAME'), 500);
			}

			$lastPart = substr($classname, $viewpos + 4);
			$pathParts = explode(' ',
JStringNormalise::fromCamelCase($lastPart));

			if (!empty($pathParts[1]))
			{
				$this->_name = strtolower($pathParts[0]);
			}
			else
			{
				$this->_name = strtolower($lastPart);
			}
		}

		return $this->_name;
	}
}
PKZn�[�6�3vvview/cms/json.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Prototype admin view.
 *
 * @since  3.2
 */
abstract class ConfigViewCmsJson extends ConfigViewCmsHtml
{
	public $state;

	public $data;

	/**
	 * Method to render the view.
	 *
	 * @return  string  The rendered view.
	 *
	 * @since   3.2
	 */
	public function render()
	{
		$this->data = $this->model->getData();

		return json_encode($this->data);
	}
}
PKZn�[Y-���view/config/html.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * View for the global configuration
 *
 * @since  3.2
 */
class ConfigViewConfigHtml extends ConfigViewCmsHtml
{
	public $form;

	public $data;

	/**
	 * Method to render the view.
	 *
	 * @return  string  The rendered view.
	 *
	 * @since   3.2
	 */
	public function render()
	{
		$user = JFactory::getUser();
		$this->userIsSuperAdmin = $user->authorise('core.admin');

		return parent::render();
	}
}
PKZn�[m�F�%%view/config/tmpl/default.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

// Load tooltips behavior
JHtml::_('behavior.formvalidator');
JHtml::_('bootstrap.tooltip');
JHtml::_('formbehavior.chosen', 'select');

JFactory::getDocument()->addScriptDeclaration("
	Joomla.submitbutton = function(task)
	{
		if (task == 'config.cancel' ||
document.formvalidator.isValid(document.getElementById('application-form')))
{
			Joomla.submitform(task,
document.getElementById('application-form'));
		}
	}
");
?>

<form action="<?php echo
JRoute::_('index.php?option=com_config'); ?>"
id="application-form" method="post"
name="adminForm" class="form-validate">

	<div class="row-fluid">
		<!-- Begin Content -->

		<div class="btn-toolbar" role="toolbar"
aria-label="<?php echo JText::_('JTOOLBAR');
?>">
			<div class="btn-group">
				<button type="button" class="btn btn-primary"
onclick="Joomla.submitbutton('config.save.config.apply')">
					<span class="icon-ok"></span> <?php echo
JText::_('JSAVE') ?>
				</button>
			</div>
			<div class="btn-group">
				<button type="button" class="btn"
onclick="Joomla.submitbutton('config.cancel')">
					<span class="icon-cancel"></span> <?php echo
JText::_('JCANCEL') ?>
				</button>
			</div>
		</div>

		<hr class="hr-condensed" />

		<div id="page-site" class="tab-pane active">
			<div class="row-fluid">
				<?php echo $this->loadTemplate('site'); ?>
				<?php echo $this->loadTemplate('metadata'); ?>
				<?php echo $this->loadTemplate('seo'); ?>
			</div>
		</div>

		<input type="hidden" name="task"
value="" />
		<?php echo JHtml::_('form.token'); ?>

		<!-- End Content -->
	</div>

</form>
PKZn�[ImO��view/config/tmpl/default.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="COM_CONFIG_CONFIG_VIEW_DEFAULT_TITLE"
option="COM_CONFIG_CONFIG_VIEW_DEFAULT_OPTION">
		<help
			key = "JHELP_MENUS_MENU_ITEM_DISPLAY_SITE_CONFIGURATION"
		/>
		<message>
			<![CDATA[COM_CONFIG_CONFIG_VIEW_DEFAULT_DESC]]>
		</message>
	</layout>
	<fields name="request">
		<fieldset name="request">
			<field 
				name="controller" 
				type="hidden"
				default="config.display.config"
			/>
		</fieldset>
	</fields>
</metadata>PKZn�[.�V��%view/config/tmpl/default_metadata.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;
?>
<fieldset class="form-horizontal">
	<legend><?php echo
JText::_('COM_CONFIG_METADATA_SETTINGS'); ?></legend>
	<?php
	foreach ($this->form->getFieldset('metadata') as $field) :
	?>
		<div class="control-group">
			<div class="control-label"><?php echo
$field->label; ?></div>
			<div class="controls"><?php echo $field->input;
?></div>
		</div>
	<?php
	endforeach;
	?>
</fieldset>
PKZn�[c�€�
view/config/tmpl/default_seo.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;
?>
<fieldset class="form-horizontal">
	<legend><?php echo JText::_('COM_CONFIG_SEO_SETTINGS');
?></legend>
	<?php
	foreach ($this->form->getFieldset('seo') as $field) :
	?>
		<div class="control-group">
			<div class="control-label"><?php echo
$field->label; ?></div>
			<div class="controls"><?php echo $field->input;
?></div>
		</div>
	<?php
	endforeach;
	?>
</fieldset>
PKZn�[N�V��!view/config/tmpl/default_site.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;
?>
<fieldset class="form-horizontal">
	<legend><?php echo
JText::_('COM_CONFIG_SITE_SETTINGS'); ?></legend>
	<?php
	foreach ($this->form->getFieldset('site') as $field) :
	?>
		<div class="control-group">
			<div class="control-label"><?php echo
$field->label; ?></div>
			<div class="controls"><?php echo $field->input;
?></div>
		</div>
	<?php
	endforeach;
	?>
</fieldset>
PKZn�[y�?�$$view/modules/html.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * View to edit a module.
 *
 * @package     Joomla.Site
 * @subpackage  com_config
 * @since       3.2
 */
class ConfigViewModulesHtml extends ConfigViewCmsHtml
{
	public $item;

	public $form;

	/**
	 * Display the view
	 *
	 * @return  string  The rendered view.
	 *
	 * @since   3.2
	 */
	public function render()
	{
		$lang = JFactory::getApplication()->getLanguage();
		$lang->load('', JPATH_ADMINISTRATOR, $lang->getTag());
		$lang->load('com_modules', JPATH_ADMINISTRATOR,
$lang->getTag());

		return parent::render();
	}
}
PKZn�[�\11view/modules/tmpl/default.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.formvalidator');
JHtml::_('behavior.keepalive');
JHtml::_('behavior.combobox');
JHtml::_('formbehavior.chosen', 'select');

jimport('joomla.filesystem.file');

$editorText  = false;
$moduleXml   = JPATH_SITE . '/modules/' .
$this->item['module'] . '/' .
$this->item['module'] . '.xml';

if (JFile::exists($moduleXml))
{
	$xml = simplexml_load_file($moduleXml);

	if (isset($xml->customContent))
	{
		$editorText = true;
	}
}

// If multi-language site, make language read-only
if (JLanguageMultilang::isEnabled())
{
	$this->form->setFieldAttribute('language',
'readonly', 'true');
}

JFactory::getDocument()->addScriptDeclaration("
	Joomla.submitbutton = function(task)
	{
		if (task == 'config.cancel.modules' ||
document.formvalidator.isValid(document.getElementById('modules-form')))
		{
			Joomla.submitform(task,
document.getElementById('modules-form'));
		}
	}
");
?>

<form
	action="<?php echo
JRoute::_('index.php?option=com_config'); ?>"
	method="post" name="adminForm"
id="modules-form"
	class="form-validate">

	<div class="row-fluid">

		<!-- Begin Content -->
		<div class="span12">

			<div class="btn-toolbar" role="toolbar"
aria-label="<?php echo JText::_('JTOOLBAR');
?>">
				<div class="btn-group">
					<button type="button" class="btn btn-primary"
						onclick="Joomla.submitbutton('config.save.modules.apply')">
						<span class="icon-apply"
aria-hidden="true"></span>
						<?php echo JText::_('JAPPLY'); ?>
					</button>
				</div>
				<div class="btn-group">
					<button type="button" class="btn"
						onclick="Joomla.submitbutton('config.save.modules.save')">
						<span class="icon-save"
aria-hidden="true"></span>
						<?php echo JText::_('JSAVE'); ?>
					</button>
				</div>
				<div class="btn-group">
					<button type="button" class="btn"
						onclick="Joomla.submitbutton('config.cancel.modules')">
						<span class="icon-cancel"
aria-hidden="true"></span>
						<?php echo JText::_('JCANCEL'); ?>
					</button>
				</div>
			</div>

			<hr class="hr-condensed" />

			<legend><?php echo
JText::_('COM_CONFIG_MODULES_SETTINGS_TITLE');
?></legend>

			<div>
				<?php echo JText::_('COM_CONFIG_MODULES_MODULE_NAME');
?>
				<span class="label label-default"><?php echo
$this->item['title']; ?></span>
				&nbsp;&nbsp;
				<?php echo JText::_('COM_CONFIG_MODULES_MODULE_TYPE');
?>
				<span class="label label-default"><?php echo
$this->item['module']; ?></span>
			</div>
			<hr />

			<div class="row-fluid">
				<div class="span12">
					<fieldset class="form-horizontal">
						<div class="control-group">
							<div class="control-label">
								<?php echo $this->form->getLabel('title'); ?>
							</div>
							<div class="controls">
								<?php echo $this->form->getInput('title'); ?>
							</div>
						</div>
						<div class="control-group">
							<div class="control-label">
								<?php echo $this->form->getLabel('showtitle');
?>
							</div>
							<div class="controls">
								<?php echo $this->form->getInput('showtitle');
?>
							</div>
						</div>
						<div class="control-group">
							<div class="control-label">
								<?php echo $this->form->getLabel('position');
?>
							</div>
							<div class="controls">
								<?php echo $this->loadTemplate('positions'); ?>
							</div>
						</div>

						<hr />

						<?php if
(JFactory::getUser()->authorise('core.edit.state',
'com_modules.module.' . $this->item['id'])) : ?>
						<div class="control-group">
							<div class="control-label">
								<?php echo $this->form->getLabel('published');
?>
							</div>
							<div class="controls">
								<?php echo $this->form->getInput('published');
?>
							</div>
						</div>
						<?php endif ?>

						<div class="control-group">
							<div class="control-label">
								<?php echo $this->form->getLabel('publish_up');
?>
							</div>
							<div class="controls">
								<?php echo $this->form->getInput('publish_up');
?>
							</div>
						</div>
						<div class="control-group">
							<div class="control-label">
								<?php echo
$this->form->getLabel('publish_down'); ?>
							</div>
							<div class="controls">
								<?php echo
$this->form->getInput('publish_down'); ?>
							</div>
						</div>

						<div class="control-group">
							<div class="control-label">
								<?php echo $this->form->getLabel('access');
?>
							</div>
							<div class="controls">
								<?php echo $this->form->getInput('access');
?>
							</div>
						</div>
						<div class="control-group">
							<div class="control-label">
								<?php echo $this->form->getLabel('ordering');
?>
							</div>
							<div class="controls">
								<?php echo $this->form->getInput('ordering');
?>
							</div>
						</div>

						<div class="control-group">
							<div class="control-label">
								<?php echo $this->form->getLabel('language');
?>
							</div>
							<div class="controls">
								<?php echo $this->form->getInput('language');
?>
							</div>
						</div>
						<div class="control-group">
							<div class="control-label">
								<?php echo $this->form->getLabel('note'); ?>
							</div>
							<div class="controls">
								<?php echo $this->form->getInput('note'); ?>
							</div>
						</div>

						<hr />

						<div id="options">
							<?php echo $this->loadTemplate('options'); ?>
						</div>

						<?php if ($editorText) : ?>
							<div class="tab-pane" id="custom">
								<?php echo $this->form->getInput('content');
?>
							</div>
						<?php endif; ?>
					</fieldset>
				</div>

				<input type="hidden" name="id"
value="<?php echo $this->item['id']; ?>" />
				<input type="hidden" name="return"
value="<?php echo
JFactory::getApplication()->input->get('return', null,
'base64'); ?>" />
				<input type="hidden" name="task"
value="" />
				<?php echo JHtml::_('form.token'); ?>

			</div>

		</div>
		<!-- End Content -->
	</div>

</form>
PKZn�[l����%view/modules/tmpl/default_options.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

$fieldSets = $this->form->getFieldsets('params');

echo JHtml::_('bootstrap.startAccordion',
'collapseTypes');
$i = 0;

foreach ($fieldSets as $name => $fieldSet) :

$label = !empty($fieldSet->label) ? $fieldSet->label :
'COM_MODULES_' . $name . '_FIELDSET_LABEL';
$class = isset($fieldSet->class) && !empty($fieldSet->class)
? $fieldSet->class : '';


if (isset($fieldSet->description) &&
trim($fieldSet->description)) :
echo '<p class="tip">' .
$this->escape(JText::_($fieldSet->description)) .
'</p>';
endif;
?>
<?php echo JHtml::_('bootstrap.addSlide',
'collapseTypes', JText::_($label), 'collapse' .
($i++)); ?>

<ul class="nav nav-tabs nav-stacked">
<?php foreach ($this->form->getFieldset($name) as $field) : ?>

	<li>
		<?php // If multi-language site, make menu-type selection read-only
?>
		<?php if (JLanguageMultilang::isEnabled() &&
$this->item['module'] === 'mod_menu' &&
$field->getAttribute('name') === 'menutype') : ?>
			<?php $field->readonly = true; ?>
		<?php endif; ?>
		<?php echo $field->renderField(); ?>
	</li>

<?php endforeach; ?>
</ul>

<?php echo JHtml::_('bootstrap.endSlide'); ?>
<?php endforeach; ?>
<?php echo JHtml::_('bootstrap.endAccordion'); ?>
PKZn�[O�^^'view/modules/tmpl/default_positions.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;
$positions = $this->model->getPositions();

// Add custom position to options
$customGroupText = JText::_('COM_MODULES_CUSTOM_POSITION');

// Build field
$attr = array(
	'id'          => 'jform_position',
	'list.select' => $this->item['position'],
	'list.attr'   => 'class="chzn-custom-value"
'
		. 'data-custom_group_text="' . $customGroupText .
'" '
		. 'data-no_results_text="' .
JText::_('COM_MODULES_ADD_CUSTOM_POSITION') . '" '
		. 'data-placeholder="' .
JText::_('COM_MODULES_TYPE_OR_SELECT_POSITION') . '"
'
);

echo JHtml::_('select.groupedlist', $positions,
'jform[position]', $attr);
PKZn�[O�*���view/templates/html.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * View to edit a template style.
 *
 * @since  3.2
 */
class ConfigViewTemplatesHtml extends ConfigViewCmsHtml
{
	public $item;

	public $form;

	/**
	 * Method to render the view.
	 *
	 * @return  string  The rendered view.
	 *
	 * @since   3.2
	 */
	public function render()
	{
		$user = JFactory::getUser();
		$this->userIsSuperAdmin = $user->authorise('core.admin');

		return parent::render();
	}
}
PKZn�[�IHP��view/templates/tmpl/default.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::_('behavior.formvalidator');
JHtml::_('behavior.keepalive');
$user = JFactory::getUser();

JFactory::getDocument()->addScriptDeclaration("
	Joomla.submitbutton = function(task)
	{
		if (task == 'config.cancel' ||
document.formvalidator.isValid(document.getElementById('templates-form')))
		{
			Joomla.submitform(task,
document.getElementById('templates-form'));
		}
	}
");
?>

<form action="<?php echo
JRoute::_('index.php?option=com_config'); ?>"
method="post" name="adminForm"
id="templates-form" class="form-validate">

	<div class="row-fluid">
		<!-- Begin Content -->

		<div class="btn-toolbar" role="toolbar"
aria-label="<?php echo JText::_('JTOOLBAR');
?>">
			<div class="btn-group">
				<button type="button" class="btn btn-primary"
onclick="Joomla.submitbutton('config.save.templates.apply')">
					<span class="icon-ok"></span> <?php echo
JText::_('JSAVE') ?>
				</button>
			</div>
			<div class="btn-group">
				<button type="button" class="btn"
onclick="Joomla.submitbutton('config.cancel')">
					<span class="icon-cancel"></span> <?php echo
JText::_('JCANCEL') ?>
				</button>
			</div>
		</div>

		<hr class="hr-condensed" />

		<div id="page-site" class="tab-pane active">
			<div class="row-fluid">
				<?php // Get the menu parameters that are automatically set but may
be modified.
				echo $this->loadTemplate('options'); ?>
			</div>
		</div>

		<input type="hidden" name="task"
value="" />
		<?php echo JHtml::_('form.token'); ?>

		<!-- End Content -->
	</div>

</form>
PKZn�[C?���view/templates/tmpl/default.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="COM_CONFIG_TEMPLATES_VIEW_DEFAULT_TITLE"
option="COM_CONFIG_TEMPLATES_VIEW_DEFAULT_OPTION">
		<help
			key = "JHELP_MENUS_MENU_ITEM_DISPLAY_TEMPLATE_OPTIONS"
		/>
		<message>
			<![CDATA[COM_CONFIG_TEMPLATES_VIEW_DEFAULT_DESC]]>
		</message>
	</layout>
	<fields name="request">
		<fieldset name="request" >
			<field 
				name="controller" 
				type="hidden"
				default="config.display.templates"
			/>
		</fieldset>
	</fields>
</metadata>PKZn�[&*�Ƈ�'view/templates/tmpl/default_options.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

// Load chosen.css
JHtml::_('formbehavior.chosen', 'select');

?>
<?php

	$fieldSets = $this->form->getFieldsets('params');
?>

<legend><?php echo
JText::_('COM_CONFIG_TEMPLATE_SETTINGS'); ?></legend>

<?php

	// Search for com_config field set
	if (!empty($fieldSets['com_config'])) : ?>

	<fieldset class="form-horizontal">
		<?php echo $this->form->renderFieldset('com_config');
?>
	</fieldset>

<?php else :

	// Fall-back to display all in params
	foreach ($fieldSets as $name => $fieldSet) :
	$label = !empty($fieldSet->label) ? $fieldSet->label :
'COM_CONFIG_' . $name . '_FIELDSET_LABEL';

	if (isset($fieldSet->description) &&
trim($fieldSet->description)) :
		echo '<p class="tip">' .
$this->escape(JText::_($fieldSet->description)) .
'</p>';
	endif;
	?>

<fieldset class="form-horizontal">
	<?php echo $this->form->renderFieldset($name); ?>
</fieldset>
	<?php endforeach;
	endif;
PKZw�[L䛻{	{	forms/config.xmlnu�[���<?xml
version="1.0" encoding="UTF-8"?>
<form>
	<fieldset
		name="metadata"
		label="COM_CONFIG_METADATA_SETTINGS">
		<field
			name="MetaDesc"
			type="textarea"
			label="COM_CONFIG_FIELD_METADESC_LABEL"
			filter="string"
			rows="3"
			cols="30"
			maxlength="300"
			charcounter="true"
		/>

		<field
			name="MetaRights"
			type="textarea"
			label="JFIELD_META_RIGHTS_LABEL"
			description="JFIELD_META_RIGHTS_DESC"
			filter="string"
			cols="60"
			rows="2"
		/>

	</fieldset>

	<fieldset
		name="seo"
		label="CONFIG_SEO_SETTINGS_LABEL">
		<field
			name="sef"
			type="radio"
			label="COM_CONFIG_FIELD_SEF_URL_LABEL"
			description="COM_CONFIG_FIELD_SEF_URL_DESC"
			default="1"
			layout="joomla.form.field.radio.switcher"
			filter="integer"
			>
			<option value="0">JNO</option>
			<option value="1">JYES</option>
		</field>

		<field
			name="sitename_pagetitles"
			type="list"
			label="COM_CONFIG_FIELD_SITENAME_PAGETITLES_LABEL"
			default="0"
			filter="integer"
			validate="options"
			>
			<option
value="2">COM_CONFIG_FIELD_VALUE_AFTER</option>
			<option
value="1">COM_CONFIG_FIELD_VALUE_BEFORE</option>
			<option value="0">JNO</option>
		</field>

	</fieldset>

	<fieldset
		name="site"
		label="CONFIG_SITE_SETTINGS_LABEL">

		<field
			name="sitename"
			type="text"
			label="COM_CONFIG_FIELD_SITE_NAME_LABEL"
			required="true"
			filter="string"
			size="50"
		/>

		<field
			name="offline"
			type="radio"
			label="COM_CONFIG_FIELD_SITE_OFFLINE_LABEL"
			default="0"
			layout="joomla.form.field.radio.switcher"
			filter="integer"
			>
			<option value="0">JNO</option>
			<option value="1">JYES</option>
		</field>

		<field
			name="access"
			type="accesslevel"
			label="COM_CONFIG_FIELD_DEFAULT_ACCESS_LEVEL_LABEL"
			description="COM_CONFIG_FIELD_DEFAULT_ACCESS_LEVEL_DESC"
			default="1"
			filter="UINT"
			validate="options"
		/>

		<field
			name="list_limit"
			type="list"
			label="COM_CONFIG_FIELD_DEFAULT_LIST_LIMIT_LABEL"
			default="20"
			filter="integer"
			validate="options"
			>
			<option value="5">J5</option>
			<option value="10">J10</option>
			<option value="15">J15</option>
			<option value="20">J20</option>
			<option value="25">J25</option>
			<option value="30">J30</option>
			<option value="50">J50</option>
			<option value="100">J100</option>
		</field>

	</fieldset>

	<fieldset>
		<field
			name="asset_id"
			type="hidden"
		/>
	</fieldset>
</form>
PKZw�[O�4JJforms/modules_advanced.xmlnu�[���<?xml
version="1.0" encoding="UTF-8"?>
<form>
	<fields name="params">
		<fieldset
			name="advanced">

			<field
				name="module_tag"
				type="moduletag"
				label="COM_MODULES_FIELD_MODULE_TAG_LABEL"
				default="div"
				validate="options"
			/>

			<field
				name="bootstrap_size"
				type="integer"
				label="COM_MODULES_FIELD_BOOTSTRAP_SIZE_LABEL"
				first="0"
				last="12"
				step="1"
			/>

			<field
				name="header_tag"
				type="headertag"
				label="COM_MODULES_FIELD_HEADER_TAG_LABEL"
				default="h3"
				validate="options"
			/>

			<field
				name="header_class"
				type="textarea"
				label="COM_MODULES_FIELD_HEADER_CLASS_LABEL"
				rows="3"
				validate="CssIdentifier"
			/>

			<field
				name="style"
				type="chromestyle"
				label="COM_MODULES_FIELD_MODULE_STYLE_LABEL"
			/>
		</fieldset>
	</fields>
</form>
PKZw�[�����forms/templates.xmlnu�[���<?xml
version="1.0" encoding="UTF-8"?>
<form>
	<fieldset>
		<field
			name="id"
			type="number"
			label="JGLOBAL_FIELD_ID_LABEL"
			default="0"
			readonly="true"
			class="readonly"
		/>

		<field
			name="template"
			type="text"
			label="COM_TEMPLATES_FIELD_TEMPLATE_LABEL"
			class="readonly"
			size="30"
			readonly="true"
		/>

		<field
			name="client_id"
			type="hidden"
			label="COM_TEMPLATES_FIELD_CLIENT_LABEL"
			class="readonly"
			default="0"
			readonly="true"
		/>

		<field
			name="title"
			type="text"
			label="COM_TEMPLATES_FIELD_TITLE_LABEL"
			size="50"
			required="true"
		/>

		<field name="assigned" type="hidden" />

	</fieldset>
</form>
PKZw�[�jȔ	�	forms/modules.xmlnu�[���<?xml
version="1.0" encoding="UTF-8"?>
<form>
	<fieldset>
		<field
			name="id"
			type="number"
			label="JGLOBAL_FIELD_ID_LABEL"
			default="0"
			readonly="true"
		/>

		<field
			name="title"
			type="text"
			label="JGLOBAL_TITLE"
			maxlength="100"
			required="true"
			size="35"
		/>

		<field
			name="note"
			type="text"
			label="COM_MODULES_FIELD_NOTE_LABEL"
			maxlength="255"
			size="35"
		/>

		<field
			name="module"
			type="hidden"
			label="COM_MODULES_FIELD_MODULE_LABEL"
			readonly="readonly"
			size="20"
		/>

		<field
			name="showtitle"
			type="radio"
			label="COM_MODULES_FIELD_SHOWTITLE_LABEL"
			layout="joomla.form.field.radio.switcher"
			default="1"
			size="1"
			>
			<option value="0">JHIDE</option>
			<option value="1">JSHOW</option>
		</field>

		<field
			name="published"
			type="list"
			label="JSTATUS"
			class="form-select-color-state"
			default="1"
			size="1"
			validate="options"
			>
			<option value="1">JPUBLISHED</option>
			<option value="0">JUNPUBLISHED</option>
			<option value="-2">JTRASHED</option>
		</field>

		<field
			name="publish_up"
			type="calendar"
			label="COM_MODULES_FIELD_PUBLISH_UP_LABEL"
			filter="user_utc"
			translateformat="true"
			showtime="true"
			size="22"
		/>

		<field
			name="publish_down"
			type="calendar"
			label="COM_MODULES_FIELD_PUBLISH_DOWN_LABEL"
			filter="user_utc"
			translateformat="true"
			showtime="true"
			size="22"
		/>

		<field
			name="client_id"
			type="hidden"
			label="COM_MODULES_FIELD_CLIENT_ID_LABEL"
			readonly="true"
			size="1"
		/>

		<field
			name="position"
			type="ModulesPositionedit"
			label="COM_MODULES_FIELD_POSITION_LABEL"
			addfieldprefix="Joomla\Component\Modules\Administrator\Field"
			default=""
			maxlength="50"
			client="site"
		/>

		<field
			name="access"
			type="accesslevel"
			label="JFIELD_ACCESS_LABEL"
			filter="UINT"
			validate="options"
		/>

		<field
			name="ordering"
			type="moduleorder"
			label="JFIELD_ORDERING_LABEL"
		/>

		<field
			name="content"
			type="editor"
			label="COM_MODULES_FIELD_CONTENT_LABEL"
			buttons="true"
			filter="\Joomla\CMS\Component\ComponentHelper::filterText"
			hide="readmore,pagebreak"
		/>

		<field
			name="language"
			type="contentlanguage"
			label="JFIELD_LANGUAGE_LABEL"
			>
			<option value="*">JALL</option>
		</field>

		<field name="assignment" type="hidden" />

		<field name="assigned" type="hidden" />
	</fieldset>
</form>
PKZw�[N
��tmpl/templates/default.xmlnu�[���<?xml
version="1.0" encoding="UTF-8"?>
<metadata>
	<layout title="COM_CONFIG_TEMPLATES_VIEW_DEFAULT_TITLE"
option="COM_CONFIG_TEMPLATES_VIEW_DEFAULT_OPTION">
		<help
			key = "Menu_Item:_Display_Template_Options"
		/>
		<message>
			<![CDATA[COM_CONFIG_TEMPLATES_VIEW_DEFAULT_DESC]]>
		</message>
	</layout>
	<fields name="request">
		<fieldset name="request" >
			<field
				name="controller"
				type="hidden"
				default=""
			/>
		</fieldset>
	</fields>
</metadata>
PKZw�[�aw��"tmpl/templates/default_options.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;

$fieldSets = $this->form->getFieldsets('params');
?>

<legend><?php echo
Text::_('COM_CONFIG_TEMPLATE_SETTINGS'); ?></legend>

<?php

// Search for com_config field set
if (!empty($fieldSets['com_config'])) {
    echo $this->form->renderFieldset('com_config');
} else {
    // Fall-back to display all in params
    foreach ($fieldSets as $name => $fieldSet) {
        $label = !empty($fieldSet->label) ? $fieldSet->label :
'COM_CONFIG_' . $name . '_FIELDSET_LABEL';

        if (isset($fieldSet->description) &&
trim($fieldSet->description)) {
            echo '<p class="tip">' .
$this->escape(Text::_($fieldSet->description)) .
'</p>';
        }

        echo $this->form->renderFieldset($name);
    }
}
PKZw�[�]bR��tmpl/templates/default.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

$user = $this->getCurrentUser();

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('keepalive')
    ->useScript('form.validate')
    ->useScript('com_config.templates');

?>
<?php if ($this->params->get('show_page_heading')) :
?>
    <div class="page-header">
        <h1>
            <?php if
($this->escape($this->params->get('page_heading'))) :
?>
                <?php echo
$this->escape($this->params->get('page_heading')); ?>
            <?php else : ?>
                <?php echo
$this->escape($this->params->get('page_title')); ?>
            <?php endif; ?>
        </h1>
    </div>
<?php endif; ?>
<form action="<?php echo
Route::_('index.php?option=com_config'); ?>"
method="post" name="adminForm"
id="templates-form" class="form-validate">

    <div id="page-site" class="tab-pane active">
        <div class="row">
            <div class="col-md-12">
                <?php echo $this->loadTemplate('options');
?>
            </div>
        </div>
    </div>

    <input type="hidden" name="task"
value="">
    <?php echo HTMLHelper::_('form.token'); ?>

    <div class="mb-2">
    <button type="button" class="btn btn-primary "
data-submit-task="templates.apply">
        <span class="icon-check text-white"
aria-hidden="true"></span>
        <?php echo Text::_('JSAVE') ?>
    </button>
    <button type="button" class="btn btn-danger"
data-submit-task="templates.cancel">
        <span class="icon-times text-white"
aria-hidden="true"></span>
        <?php echo Text::_('JCANCEL') ?>
    </button>
</div>

</form>
PKZw�[� �pp
tmpl/config/default_metadata.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;

?>
<fieldset>

    <legend><?php echo
Text::_('COM_CONFIG_METADATA_SETTINGS'); ?></legend>

    <?php foreach ($this->form->getFieldset('metadata')
as $field) : ?>
        <div class="mb-3">
            <?php echo $field->label; ?>
            <?php echo $field->input; ?>
            <?php if ($field->description) : ?>
                <div class="form-text hide-aware-inline-help
d-none" id="<?php echo $field->id ?>-desc">
                    <?php echo Text::_($field->description) ?>
                </div>
            <?php endif; ?>
        </div>
    <?php endforeach; ?>

</fieldset>
PKZw�[��g��tmpl/config/default.xmlnu�[���<?xml
version="1.0" encoding="UTF-8"?>
<metadata>
	<layout title="COM_CONFIG_CONFIG_VIEW_DEFAULT_TITLE"
option="COM_CONFIG_CONFIG_VIEW_DEFAULT_OPTION">
		<help
			key = "Menu_Item:_Site_Configuration_Options"
		/>
		<message>
			<![CDATA[COM_CONFIG_CONFIG_VIEW_DEFAULT_DESC]]>
		</message>
	</layout>
	<fields name="request">
		<fieldset name="request">
			<field
				name="controller"
				type="hidden"
				default=""
			/>
		</fieldset>
	</fields>
</metadata>
PK[w�[x2;fftmpl/config/default_seo.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;

?>
<fieldset>

    <legend><?php echo
Text::_('COM_CONFIG_SEO_SETTINGS'); ?></legend>

    <?php foreach ($this->form->getFieldset('seo') as
$field) : ?>
        <div class="mb-3">
            <?php echo $field->label; ?>
            <?php echo $field->input; ?>
            <?php if ($field->description) : ?>
                <div class="form-text hide-aware-inline-help
d-none" id="<?php echo $field->id ?>-desc">
                    <?php echo Text::_($field->description) ?>
                </div>
            <?php endif; ?>
        </div>
    <?php endforeach; ?>

</fieldset>
PK[w�[�=L�hhtmpl/config/default_site.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;

?>
<fieldset>

    <legend><?php echo
Text::_('COM_CONFIG_SITE_SETTINGS'); ?></legend>

    <?php foreach ($this->form->getFieldset('site') as
$field) : ?>
        <div class="mb-3">
            <?php echo $field->label; ?>
            <?php echo $field->input; ?>
            <?php if ($field->description) : ?>
                <div class="form-text hide-aware-inline-help
d-none" id="<?php echo $field->id ?>-desc">
                    <?php echo Text::_($field->description) ?>
                </div>
            <?php endif; ?>
        </div>
    <?php endforeach; ?>

</fieldset>
PK[w�[-��AAtmpl/config/default.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('keepalive')
    ->useScript('form.validate')
    ->useScript('com_config.config')
    ->useScript('inlinehelp');

?>
<?php if ($this->params->get('show_page_heading')) :
?>
    <div class="page-header">
        <h1>
            <?php if
($this->escape($this->params->get('page_heading'))) :
?>
                <?php echo
$this->escape($this->params->get('page_heading')); ?>
            <?php else : ?>
                <?php echo
$this->escape($this->params->get('page_title')); ?>
            <?php endif; ?>
        </h1>
    </div>
<?php endif; ?>
<form action="<?php echo
Route::_('index.php?option=com_config'); ?>"
id="application-form" method="post"
name="adminForm" class="form-validate">

    <div class="mb-2 d-flex">
        <button type="button" class="btn btn-sm
btn-outline-info button-inlinehelp ms-auto">
            <span class="fa fa-question-circle"
aria-hidden="true"></span>
            <?php echo Text::_('JINLINEHELP') ?>
        </button>
    </div>

    <?php echo $this->loadTemplate('site'); ?>
    <?php echo $this->loadTemplate('seo'); ?>
    <?php echo $this->loadTemplate('metadata'); ?>

    <input type="hidden" name="task"
value="">
    <?php echo HTMLHelper::_('form.token'); ?>

    <div class="mb-2">
    <button type="button" class="btn btn-primary"
data-submit-task="config.apply">
        <span class="icon-check"
aria-hidden="true"></span>
        <?php echo Text::_('JSAVE') ?>
    </button>
    <button type="button" class="btn btn-danger"
data-submit-task="config.cancel">
        <span class="icon-times"
aria-hidden="true"></span>
        <?php echo Text::_('JCANCEL') ?>
    </button>
    </div>

</form>
PK[w�[A���ff
tmpl/modules/default_options.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2014 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Language\Text;

$fieldSets = $this->form->getFieldsets('params');

echo HTMLHelper::_('bootstrap.startAccordion',
'collapseTypes');
$i = 0;

foreach ($fieldSets as $name => $fieldSet) :
    $label = !empty($fieldSet->label) ? $fieldSet->label :
'COM_MODULES_' . strtoupper($name) . '_FIELDSET_LABEL';
    $class = isset($fieldSet->class) &&
!empty($fieldSet->class) ? $fieldSet->class : '';


    if (isset($fieldSet->description) &&
trim($fieldSet->description)) :
        echo '<p class="tip">' .
$this->escape(Text::_($fieldSet->description)) .
'</p>';
    endif;
    ?>
    <?php echo HTMLHelper::_('bootstrap.addSlide',
'collapseTypes', Text::_($label), 'collapse' . ($i++));
?>

<ul class="nav flex-column">
    <?php foreach ($this->form->getFieldset($name) as $field) :
?>
    <li>
        <?php // If multi-language site, make menu-type selection
read-only ?>
        <?php if (Multilanguage::isEnabled() &&
$this->item['module'] === 'mod_menu' &&
$field->getAttribute('name') === 'menutype') : ?>
            <?php $field->readonly = true; ?>
        <?php endif; ?>
        <?php echo $field->renderField(); ?>
    </li>

    <?php endforeach; ?>
</ul>

    <?php echo HTMLHelper::_('bootstrap.endSlide'); ?>
<?php endforeach; ?>
<?php echo HTMLHelper::_('bootstrap.endAccordion'); ?>
PK[w�[��g���tmpl/modules/default.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2014 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

HTMLHelper::_('behavior.combobox');

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('keepalive')
    ->useScript('form.validate')
    ->useScript('com_config.modules');

$editorText  = false;
$moduleXml   = JPATH_SITE . '/modules/' .
$this->item['module'] . '/' .
$this->item['module'] . '.xml';

if (is_file($moduleXml)) {
    $xml = simplexml_load_file($moduleXml);

    if (isset($xml->customContent)) {
        $editorText = true;
    }
}

// If multi-language site, make language read-only
if (Multilanguage::isEnabled()) {
    $this->form->setFieldAttribute('language',
'readonly', 'true');
}
?>

<form action="<?php echo
Route::_('index.php?option=com_config'); ?>"
method="post" name="adminForm"
id="modules-form" class="form-validate">
    <div class="row">
        <div class="col-md-12">
            <legend><?php echo
Text::_('COM_CONFIG_MODULES_SETTINGS_TITLE');
?></legend>

            <div>
                <?php echo
Text::_('COM_CONFIG_MODULES_MODULE_NAME'); ?>
                <span class="badge bg-secondary"><?php
echo $this->item['title']; ?></span>
                &nbsp;&nbsp;
                <?php echo
Text::_('COM_CONFIG_MODULES_MODULE_TYPE'); ?>
                <span class="badge bg-secondary"><?php
echo $this->item['module']; ?></span>
            </div>
            <hr>

            <div class="row mb-4">
                <div class="col-md-12">

                    <div class="control-group">
                        <div class="control-label">
                            <?php echo
$this->form->getLabel('title'); ?>
                        </div>
                        <div class="controls">
                            <?php echo
$this->form->getInput('title'); ?>
                        </div>
                    </div>
                    <div class="control-group">
                        <div class="control-label">
                            <?php echo
$this->form->getLabel('showtitle'); ?>
                        </div>
                        <div class="controls">
                            <?php echo
$this->form->getInput('showtitle'); ?>
                        </div>
                    </div>
                    <div class="control-group">
                        <div class="control-label">
                            <?php echo
$this->form->getLabel('position'); ?>
                        </div>
                        <div class="controls">
                            <?php echo
$this->form->getInput('position'); ?>
                        </div>
                    </div>

                    <hr>

                    <?php if
($this->getCurrentUser()->authorise('core.edit.state',
'com_modules.module.' . $this->item['id'])) : ?>
                    <div class="control-group">
                        <div class="control-label">
                            <?php echo
$this->form->getLabel('published'); ?>
                        </div>
                        <div class="controls">
                            <?php echo
$this->form->getInput('published'); ?>
                        </div>
                    </div>
                    <?php endif ?>

                    <div class="control-group">
                        <div class="control-label">
                            <?php echo
$this->form->getLabel('publish_up'); ?>
                        </div>
                        <div class="controls">
                            <?php echo
$this->form->getInput('publish_up'); ?>
                        </div>
                    </div>
                    <div class="control-group">
                        <div class="control-label">
                            <?php echo
$this->form->getLabel('publish_down'); ?>
                        </div>
                        <div class="controls">
                            <?php echo
$this->form->getInput('publish_down'); ?>
                        </div>
                    </div>

                    <div class="control-group">
                        <div class="control-label">
                            <?php echo
$this->form->getLabel('access'); ?>
                        </div>
                        <div class="controls">
                            <?php echo
$this->form->getInput('access'); ?>
                        </div>
                    </div>
                    <div class="control-group">
                        <div class="control-label">
                            <?php echo
$this->form->getLabel('ordering'); ?>
                        </div>
                        <div class="controls">
                            <?php echo
$this->form->getInput('ordering'); ?>
                        </div>
                    </div>

                    <?php if (Multilanguage::isEnabled()) : ?>
                        <div class="control-group">
                            <div class="control-label">
                                <?php echo
$this->form->getLabel('language'); ?>
                            </div>
                            <div class="controls">
                                <?php echo
$this->form->getInput('language'); ?>
                            </div>
                        </div>
                    <?php endif; ?>

                    <div class="control-group">
                        <div class="control-label">
                            <?php echo
$this->form->getLabel('note'); ?>
                        </div>
                        <div class="controls">
                            <?php echo
$this->form->getInput('note'); ?>
                        </div>
                    </div>

                    <hr>

                    <div id="options">
                        <?php echo
$this->loadTemplate('options'); ?>
                    </div>

                    <?php if ($editorText) : ?>
                        <div class="mt-2"
id="custom">
                            <?php echo
$this->form->getInput('content'); ?>
                        </div>
                    <?php endif; ?>
                </div>

                <input type="hidden" name="id"
value="<?php echo $this->item['id']; ?>">
                <input type="hidden" name="return"
value="<?php echo
Factory::getApplication()->getInput()->get('return', null,
'base64'); ?>">
                <input type="hidden" name="task"
value="">
                <?php echo HTMLHelper::_('form.token'); ?>
            </div>
            <div class="mb-2">
            <button type="button" class="btn
btn-primary" data-submit-task="modules.apply">
                <span class="icon-check"
aria-hidden="true"></span>
                <?php echo Text::_('JAPPLY'); ?>
            </button>
            <button type="button" class="btn
btn-primary" data-submit-task="modules.save">
                <span class="icon-check"
aria-hidden="true"></span>
                <?php echo Text::_('JSAVE'); ?>
            </button>
            <button type="button" class="btn
btn-danger" data-submit-task="modules.cancel">
                <span class="icon-times"
aria-hidden="true"></span>
                <?php echo Text::_('JCANCEL'); ?>
            </button>
            </div>
        </div>
    </div>
</form>
PK[w�[UX�]��src/Service/Router.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2009 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

namespace Joomla\Component\Config\Site\Service;

use Joomla\CMS\Application\SiteApplication;
use Joomla\CMS\Component\Router\RouterView;
use Joomla\CMS\Component\Router\RouterViewConfiguration;
use Joomla\CMS\Component\Router\Rules\MenuRules;
use Joomla\CMS\Component\Router\Rules\NomenuRules;
use Joomla\CMS\Component\Router\Rules\StandardRules;
use Joomla\CMS\Menu\AbstractMenu;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Routing class from com_config
 *
 * @since  4.0.0
 */
class Router extends RouterView
{
    /**
     * Config Component router constructor
     *
     * @param   SiteApplication  $app   The application object
     * @param   AbstractMenu     $menu  The menu object to work with
     */
    public function __construct(SiteApplication $app, AbstractMenu $menu)
    {
        $this->registerView(new
RouterViewConfiguration('config'));
        $this->registerView(new
RouterViewConfiguration('templates'));

        parent::__construct($app, $menu);

        $this->attachRule(new MenuRules($this));
        $this->attachRule(new StandardRules($this));
        $this->attachRule(new NomenuRules($this));
    }
}
PK[w�[Ďਥ�src/Dispatcher/Dispatcher.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2017 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

namespace Joomla\Component\Config\Site\Dispatcher;

use Joomla\CMS\Access\Exception\NotAllowed;
use Joomla\CMS\Dispatcher\ComponentDispatcher;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * ComponentDispatcher class for com_config
 *
 * @since  4.0.0
 */
class Dispatcher extends ComponentDispatcher
{
    /**
     * Method to check component access permission
     *
     * @since   4.0.0
     *
     * @return  void
     *
     * @throws  \Exception|NotAllowed
     */
    protected function checkAccess()
    {
        parent::checkAccess();

        $task = $this->input->getCmd('task',
'display');
        $view = $this->input->get('view');
        $user = $this->app->getIdentity();

        if (substr($task, 0, 8) === 'modules.' || $view ===
'modules') {
            if (!$user->authorise('module.edit.frontend',
'com_modules.module.' . $this->input->get('id')))
{
                throw new
NotAllowed($this->app->getLanguage()->_('JERROR_ALERTNOAUTHOR'),
403);
            }
        } elseif (!$user->authorise('core.admin')) {
            throw new
NotAllowed($this->app->getLanguage()->_('JERROR_ALERTNOAUTHOR'),
403);
        }
    }
}
PK[w�[�pf�
�
src/Model/TemplatesModel.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

namespace Joomla\Component\Config\Site\Model;

use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
use Joomla\Filesystem\Path;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Template style model.
 *
 * @since  3.2
 */
class TemplatesModel extends FormModel
{
    /**
     * Method to auto-populate the model state.
     *
     * Note. Calling getState in this method will result in recursion.
     *
     * @return  null
     *
     * @since   3.2
     */
    protected function populateState()
    {
        parent::populateState();

        $this->setState('params',
ComponentHelper::getParams('com_templates'));
    }

    /**
     * Method to get the record form.
     *
     * @param   array    $data      An optional array of data for the form
to interrogate.
     * @param   boolean  $loadData  True if the form is to load its own
data (default case), false if not.
     *
     * @return  Form|bool    A Form object on success, false on failure
     *
     * @since   3.2
     */
    public function getForm($data = [], $loadData = true)
    {
        try {
            // Get the form.
            $form = $this->loadForm('com_config.templates',
'templates', ['load_data' => $loadData]);

            $data = [];
            $this->preprocessForm($form, $data);

            // Load the data into the form
            $form->bind($data);
        } catch (\Exception $e) {
           
Factory::getApplication()->enqueueMessage($e->getMessage());

            return false;
        }

        if (empty($form)) {
            return false;
        }

        return $form;
    }

    /**
     * Method to preprocess the form
     *
     * @param   Form    $form   A form object.
     * @param   mixed   $data   The data expected for the form.
     * @param   string  $group  Plugin group to load
     *
     * @return  void
     *
     * @since   3.2
     * @throws  \Exception if there is an error in the form event.
     */
    protected function preprocessForm(Form $form, $data, $group =
'content')
    {
        $lang = Factory::getLanguage();

        $template = Factory::getApplication()->getTemplate();

        // Load the core and/or local language file(s).
        $lang->load('tpl_' . $template, JPATH_BASE)
        || $lang->load('tpl_' . $template, JPATH_BASE .
'/templates/' . $template);

        // Look for com_config.xml, which contains fields to display
        $formFile = Path::clean(JPATH_BASE . '/templates/' .
$template . '/com_config.xml');

        if (!file_exists($formFile)) {
            // If com_config.xml not found, fall back to
templateDetails.xml
            $formFile = Path::clean(JPATH_BASE . '/templates/' .
$template . '/templateDetails.xml');
        }

        // Get the template form.
        if (file_exists($formFile) &&
!$form->loadFile($formFile, false, '//config')) {
            throw new
\Exception(Text::_('JERROR_LOADFILE_FAILED'));
        }

        // Attempt to load the xml file.
        if (!$xml = simplexml_load_file($formFile)) {
            throw new
\Exception(Text::_('JERROR_LOADFILE_FAILED'));
        }

        // Trigger the default form events.
        parent::preprocessForm($form, $data, $group);
    }
}
PK[w�[^�RRsrc/Model/ConfigModel.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

namespace Joomla\Component\Config\Site\Model;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Model for the global configuration
 *
 * @since  3.2
 */
class ConfigModel extends FormModel
{
    /**
     * Method to get a form object.
     *
     * @param   array    $data      Data for the form.
     * @param   boolean  $loadData  True if the form is to load its own
data (default case), false if not.
     *
     * @return  mixed   A Form object on success, false on failure
     *
     * @since   3.2
     */
    public function getForm($data = [], $loadData = true)
    {
        // Get the form.
        $form = $this->loadForm('com_config.config',
'config', ['control' => 'jform',
'load_data' => $loadData]);

        if (empty($form)) {
            return false;
        }

        return $form;
    }
}
PK[w�[��c�77src/Model/ModulesModel.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2014 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

namespace Joomla\Component\Config\Site\Model;

use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\Filesystem\Path;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Config Module model.
 *
 * @since  3.2
 */
class ModulesModel extends FormModel
{
    /**
     * Method to auto-populate the model state.
     *
     * Note. Calling getState in this method will result in recursion.
     *
     * @return  void
     *
     * @since   3.2
     */
    protected function populateState()
    {
        $app = Factory::getApplication();

        // Load the User state.
        $pk = $app->getInput()->getInt('id');

        $this->setState('module.id', $pk);
    }

    /**
     * Method to get the record form.
     *
     * @param   array    $data      Data for the form.
     * @param   boolean  $loadData  True if the form is to load its own
data (default case), false if not.
     *
     * @return  Form  A Form object on success, false on failure
     *
     * @since   3.2
     */
    public function getForm($data = [], $loadData = true)
    {
        // Get the form.
        $form = $this->loadForm('com_config.modules',
'modules', ['control' => 'jform',
'load_data' => $loadData]);

        if (empty($form)) {
            return false;
        }

        return $form;
    }

    /**
     * Method to preprocess the form
     *
     * @param   Form    $form   A form object.
     * @param   mixed   $data   The data expected for the form.
     * @param   string  $group  The name of the plugin group to import
(defaults to "content").
     *
     * @return  void
     *
     * @since   3.2
     * @throws  \Exception if there is an error loading the form.
     */
    protected function preprocessForm(Form $form, $data, $group =
'content')
    {
        $lang     = Factory::getLanguage();
        $module   = $this->getState()->get('module.name');
        $basePath = JPATH_BASE;

        $formFile = Path::clean($basePath . '/modules/' . $module
. '/' . $module . '.xml');

        // Load the core and/or local language file(s).
        $lang->load($module, $basePath)
            || $lang->load($module, $basePath . '/modules/' .
$module);

        if (file_exists($formFile)) {
            // Get the module form.
            if (!$form->loadFile($formFile, false,
'//config')) {
                throw new
\Exception(Text::_('JERROR_LOADFILE_FAILED'));
            }

            // Attempt to load the xml file.
            if (!$xml = simplexml_load_file($formFile)) {
                throw new
\Exception(Text::_('JERROR_LOADFILE_FAILED'));
            }
        }

        // Load the default advanced params
        Form::addFormPath(JPATH_BASE .
'/components/com_config/model/form');
        $form->loadFile('modules_advanced', false);

        // Trigger the default form events.
        parent::preprocessForm($form, $data, $group);
    }

    /**
     * Method to get list of module positions in current template
     *
     * @return  array
     *
     * @since   3.2
     */
    public function getPositions()
    {
        $lang         = Factory::getLanguage();
        $templateName = Factory::getApplication()->getTemplate();

        // Load templateDetails.xml file
        $path                     = Path::clean(JPATH_BASE .
'/templates/' . $templateName .
'/templateDetails.xml');
        $currentTemplatePositions = [];

        if (file_exists($path)) {
            $xml = simplexml_load_file($path);

            if (isset($xml->positions[0])) {
                // Load language files
                $lang->load('tpl_' . $templateName .
'.sys', JPATH_BASE)
                || $lang->load('tpl_' . $templateName .
'.sys', JPATH_BASE . '/templates/' . $templateName);

                foreach ($xml->positions[0] as $position) {
                    $value = (string) $position;
                    $text  = preg_replace('/[^a-zA-Z0-9_\-]/',
'_', 'TPL_' . strtoupper($templateName) .
'_POSITION_' . strtoupper($value));

                    // Construct list of positions
                    $currentTemplatePositions[] =
self::createOption($value, Text::_($text) . ' [' . $value .
']');
                }
            }
        }

        $templateGroups = [];

        // Add an empty value to be able to deselect a module position
        $option             = self::createOption();
        $templateGroups[''] =
self::createOptionGroup('', [$option]);

        $templateGroups[$templateName] =
self::createOptionGroup($templateName, $currentTemplatePositions);

        // Add custom position to options
        $customGroupText =
Text::_('COM_MODULES_CUSTOM_POSITION');

        $editPositions                    = true;
        $customPositions                  = self::getActivePositions(0,
$editPositions);
        $templateGroups[$customGroupText] =
self::createOptionGroup($customGroupText, $customPositions);

        return $templateGroups;
    }

    /**
     * Get a list of modules positions
     *
     * @param   integer  $clientId       Client ID
     * @param   boolean  $editPositions  Allow to edit the positions
     *
     * @return  array  A list of positions
     *
     * @since   3.6.3
     */
    public static function getActivePositions($clientId, $editPositions =
false)
    {
        $db    = Factory::getDbo();
        $query = $db->getQuery(true)
            ->select('DISTINCT position')
            ->from($db->quoteName('#__modules'))
            ->where($db->quoteName('client_id') . ' =
' . (int) $clientId)
            ->order($db->quoteName('position'));

        $db->setQuery($query);

        try {
            $positions = $db->loadColumn();
            $positions = \is_array($positions) ? $positions : [];
        } catch (\RuntimeException $e) {
           
Factory::getApplication()->enqueueMessage($e->getMessage(),
'error');

            return;
        }

        // Build the list
        $options = [];

        foreach ($positions as $position) {
            if (!$position && !$editPositions) {
                $options[] = HTMLHelper::_('select.option',
'none', ':: ' . Text::_('JNONE') . '
::');
            } else {
                $options[] = HTMLHelper::_('select.option',
$position, $position);
            }
        }

        return $options;
    }

    /**
     * Create and return a new Option
     *
     * @param   string  $value  The option value [optional]
     * @param   string  $text   The option text [optional]
     *
     * @return  object  The option as an object (stdClass instance)
     *
     * @since   3.6.3
     */
    private static function createOption($value = '', $text =
'')
    {
        if (empty($text)) {
            $text = $value;
        }

        $option        = new \stdClass();
        $option->value = $value;
        $option->text  = $text;

        return $option;
    }

    /**
     * Create and return a new Option Group
     *
     * @param   string  $label    Value and label for group [optional]
     * @param   array   $options  Array of options to insert into group
[optional]
     *
     * @return  array  Return the new group as an array
     *
     * @since   3.6.3
     */
    private static function createOptionGroup($label = '',
$options = [])
    {
        $group          = [];
        $group['value'] = $label;
        $group['text']  = $label;
        $group['items'] = $options;

        return $group;
    }
}
PK[w�[��� �
src/Model/FormModel.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

namespace Joomla\Component\Config\Site\Model;

use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Model\FormModel as BaseForm;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\Utilities\ArrayHelper;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Prototype form model.
 *
 * @see    JForm
 * @see    \Joomla\CMS\Form\FormField
 * @see    \Joomla\CMS\Form\FormRule
 * @since  3.2
 */
abstract class FormModel extends BaseForm
{
    /**
     * Array of form objects.
     *
     * @var    array
     * @since  3.2
     */
    protected $forms = [];

    /**
     * Method to checkin a row.
     *
     * @param   integer  $pk  The numeric id of the primary key.
     *
     * @return  boolean  False on failure or error, true otherwise.
     *
     * @since   3.2
     * @throws  \RuntimeException
     */
    public function checkin($pk = null)
    {
        // Only attempt to check the row in if it exists.
        if ($pk) {
            $user = $this->getCurrentUser();

            // Get an instance of the row to checkin.
            $table = $this->getTable();

            if (!$table->load($pk)) {
                throw new \RuntimeException($table->getError());
            }

            // Check if this is the user has previously checked out the
row.
            if (!\is_null($table->checked_out) &&
$table->checked_out != $user->get('id') &&
!$user->authorise('core.admin', 'com_checkin')) {
                throw new \RuntimeException($table->getError());
            }

            // Attempt to check the row in.
            if (!$table->checkIn($pk)) {
                throw new \RuntimeException($table->getError());
            }
        }

        return true;
    }

    /**
     * Method to check-out a row for editing.
     *
     * @param   integer  $pk  The numeric id of the primary key.
     *
     * @return  boolean  False on failure or error, true otherwise.
     *
     * @since   3.2
     */
    public function checkout($pk = null)
    {
        // Only attempt to check the row in if it exists.
        if ($pk) {
            $user = $this->getCurrentUser();

            // Get an instance of the row to checkout.
            $table = $this->getTable();

            if (!$table->load($pk)) {
                throw new \RuntimeException($table->getError());
            }

            // Check if this is the user having previously checked out the
row.
            if (!\is_null($table->checked_out) &&
$table->checked_out != $user->get('id')) {
                throw new
\RuntimeException(Text::_('JLIB_APPLICATION_ERROR_CHECKOUT_USER_MISMATCH'));
            }

            // Attempt to check the row out.
            if (!$table->checkOut($user->get('id'), $pk)) {
                throw new \RuntimeException($table->getError());
            }
        }

        return true;
    }

    /**
     * Method to get a form object.
     *
     * @param   string   $name     The name of the form.
     * @param   string   $source   The form source. Can be XML string if
file flag is set to false.
     * @param   array    $options  Optional array of options for the form
creation.
     * @param   boolean  $clear    Optional argument to force load a new
form.
     * @param   string   $xpath    An optional xpath to search for the
fields.
     *
     * @return  mixed  JForm object on success, False on error.
     *
     * @see     JForm
     * @since   3.2
     */
    protected function loadForm($name, $source = null, $options = [],
$clear = false, $xpath = false)
    {
        // Handle the optional arguments.
        $options['control'] = ArrayHelper::getValue($options,
'control', false);

        // Create a signature hash.
        $hash = sha1($source . serialize($options));

        // Check if we can use a previously loaded form.
        if (isset($this->_forms[$hash]) && !$clear) {
            return $this->_forms[$hash];
        }

        //  Register the paths for the form.
        Form::addFormPath(JPATH_SITE .
'/components/com_config/forms');
        Form::addFormPath(JPATH_ADMINISTRATOR .
'/components/com_config/forms');

        try {
            // Get the form.
            $form = Form::getInstance($name, $source, $options, false,
$xpath);

            if (isset($options['load_data']) &&
$options['load_data']) {
                // Get the data for the form.
                $data = $this->loadFormData();
            } else {
                $data = [];
            }

            // Allow for additional modification of the form, and events to
be triggered.
            // We pass the data because plugins may require it.
            $this->preprocessForm($form, $data);

            // Load the data into the form after the plugins have operated.
            $form->bind($data);
        } catch (\Exception $e) {
           
Factory::getApplication()->enqueueMessage($e->getMessage());

            return false;
        }

        // Store the form for later.
        $this->_forms[$hash] = $form;

        return $form;
    }

    /**
     * Method to get the data that should be injected in the form.
     *
     * @return  array    The default data is an empty array.
     *
     * @since   3.2
     */
    protected function loadFormData()
    {
        return [];
    }

    /**
     * Method to allow derived classes to preprocess the data.
     *
     * @param   string  $context  The context identifier.
     * @param   mixed   &$data    The data to be processed. It gets
altered directly.
     * @param   string  $group    The name of the plugin group to import
(defaults to "content").
     *
     * @return  void
     *
     * @since   3.2
     */
    protected function preprocessData($context, &$data, $group =
'content')
    {
        // Get the dispatcher and load the users plugins.
        PluginHelper::importPlugin('content');

        // Trigger the data preparation event.
       
Factory::getApplication()->triggerEvent('onContentPrepareData',
[$context, $data]);
    }

    /**
     * Method to allow derived classes to preprocess the form.
     *
     * @param   Form    $form   A Form object.
     * @param   mixed   $data   The data expected for the form.
     * @param   string  $group  The name of the plugin group to import
(defaults to "content").
     *
     * @return  void
     *
     * @see     \Joomla\CMS\Form\FormField
     * @since   3.2
     * @throws  \Exception if there is an error in the form event.
     */
    protected function preprocessForm(Form $form, $data, $group =
'content')
    {
        // Import the appropriate plugin group.
        PluginHelper::importPlugin($group);

        // Trigger the form preparation event.
       
Factory::getApplication()->triggerEvent('onContentPrepareForm',
[$form, $data]);
    }

    /**
     * Method to validate the form data.
     *
     * @param   Form    $form   The form to validate against.
     * @param   array   $data   The data to validate.
     * @param   string  $group  The name of the field group to validate.
     *
     * @return  mixed  Array of filtered data if valid, false otherwise.
     *
     * @see     \Joomla\CMS\Form\FormRule
     * @see     \Joomla\CMS\Filter\InputFilter
     * @since   3.2
     */
    public function validate($form, $data, $group = null)
    {
        // Filter and validate the form data.
        $data   = $form->filter($data);
        $return = $form->validate($data, $group);

        // Check for an error.
        if ($return instanceof \Exception) {
           
Factory::getApplication()->enqueueMessage($return->getMessage(),
'error');

            return false;
        }

        // Check the validation results.
        if ($return === false) {
            // Get the validation messages from the form.
            foreach ($form->getErrors() as $message) {
                if ($message instanceof \Exception) {
                    $message = $message->getMessage();
                }

                Factory::getApplication()->enqueueMessage($message,
'error');
            }

            return false;
        }

        return $data;
    }
}
PK\w�[�R�''$src/Controller/ModulesController.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2017 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

namespace Joomla\Component\Config\Site\Controller;

use Joomla\CMS\Application\AdministratorApplication;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Client\ClientHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
use Joomla\Component\Modules\Administrator\Controller\ModuleController;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Component Controller
 *
 * @since  1.5
 */
class ModulesController extends BaseController
{
    /**
     * @param   array                         $config   An optional
associative array of configuration settings.
     *                                                  Recognized key
values include 'name', 'default_task',
'model_path', and
     *                                                 
'view_path' (this list is not meant to be comprehensive).
     * @param   MVCFactoryInterface|null      $factory  The factory.
     * @param   CMSApplication|null           $app      The Application for
the dispatcher
     * @param   \Joomla\CMS\Input\Input|null  $input    The Input object
for the request
     *
     * @since   1.6
     */
    public function __construct($config = [], MVCFactoryInterface $factory
= null, $app = null, $input = null)
    {
        parent::__construct($config, $factory, $app, $input);

        $this->registerTask('apply', 'save');
    }

    /**
     * Method to handle cancel
     *
     * @return  void
     *
     * @since   3.2
     */
    public function cancel()
    {
        // Redirect back to previous page
        $this->setRedirect($this->getReturnUrl());
    }

    /**
     * Method to save module editing.
     *
     * @return  void
     *
     * @since   3.2
     */
    public function save()
    {
        // Check for request forgeries.
        $this->checkToken();

        // Check if the user is authorized to do this.
        $user = $this->app->getIdentity();

        if (!$user->authorise('module.edit.frontend',
'com_modules.module.' . $this->input->get('id')))
{
           
$this->app->enqueueMessage(Text::_('JERROR_ALERTNOAUTHOR'),
'error');
            $this->app->redirect('index.php');
        }

        // Set FTP credentials, if given.
        ClientHelper::setCredentialsFromRequest('ftp');

        // Get submitted module id
        $moduleId = '&id=' .
$this->input->getInt('id');

        // Get returnUri
        $returnUri = $this->input->post->get('return',
null, 'base64');
        $redirect  = '';

        if (!empty($returnUri)) {
            $redirect = '&return=' . $returnUri;
        }

        /** @var AdministratorApplication $app */
        $app =
Factory::getContainer()->get(AdministratorApplication::class);

        // Reset Uri cache.
        Uri::reset();

        // Get a document object
        $document = $this->app->getDocument();

        // Load application dependencies.
        $app->loadLanguage($this->app->getLanguage());
        $app->loadDocument($document);
        $app->loadIdentity($user);

        /** @var \Joomla\CMS\Dispatcher\ComponentDispatcher $dispatcher */
        $dispatcher =
$app->bootComponent('com_modules')->getDispatcher($app);

        /** @var ModuleController $controllerClass */
        $controllerClass =
$dispatcher->getController('Module');

        // Set backend required params
        $document->setType('json');

        // Execute backend controller
        Form::addFormPath(JPATH_ADMINISTRATOR .
'/components/com_modules/forms');
        $return = $controllerClass->save();

        // Reset params back after requesting from service
        $document->setType('html');

        // Check the return value.
        if ($return === false) {
            // Save the data in the session.
            $data = $this->input->post->get('jform', [],
'array');

           
$this->app->setUserState('com_config.modules.global.data',
$data);

            // Save failed, go back to the screen and display a notice.
           
$this->app->enqueueMessage(Text::_('JERROR_SAVE_FAILED'));
           
$this->app->redirect(Route::_('index.php?option=com_config&view=modules'
. $moduleId . $redirect, false));
        }

        // Redirect back to com_config display
       
$this->app->enqueueMessage(Text::_('COM_CONFIG_MODULES_SAVE_SUCCESS'),
'success');

        // Set the redirect based on the task.
        switch ($this->input->getCmd('task')) {
            case 'apply':
               
$this->app->redirect(Route::_('index.php?option=com_config&view=modules'
. $moduleId . $redirect, false));
                break;

            case 'save':
            default:
                $this->setRedirect($this->getReturnUrl());
                break;
        }
    }

    /**
     * Method to get redirect URL after saving or cancel editing a module
from frontend
     *
     * @return  string
     *
     * @since   5.1.0
     */
    private function getReturnUrl(): string
    {
        if ($return = $this->input->post->get('return',
'', 'BASE64')) {
            $return = base64_decode(urldecode($return));

            // Only redirect to if it is an internal URL
            if (Uri::isInternal($return)) {
                return $return;
            }
        }

        return Uri::base();
    }
}
PK\w�[F;$src/Controller/DisplayController.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

namespace Joomla\Component\Config\Site\Controller;

use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Uri\Uri;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Component Controller
 *
 * @since  1.5
 */
class DisplayController extends BaseController
{
    /**
     * Method to handle cancel
     *
     * @return  void
     *
     * @since   3.2
     */
    public function cancel()
    {
        // Redirect back to home(base) page
        $this->setRedirect(Uri::base());
    }
}
PK\w�[
_�cff#src/Controller/ConfigController.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2017 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

namespace Joomla\Component\Config\Site\Controller;

use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Client\ClientHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Component Controller
 *
 * @since  1.5
 */
class ConfigController extends BaseController
{
    /**
     * @param   array                         $config   An optional
associative array of configuration settings.
     *                                                  Recognized key
values include 'name', 'default_task',
'model_path', and
     *                                                 
'view_path' (this list is not meant to be comprehensive).
     * @param   MVCFactoryInterface|null      $factory  The factory.
     * @param   CMSApplication|null           $app      The JApplication
for the dispatcher
     * @param   \Joomla\CMS\Input\Input|null  $input    The Input object
for the request
     *
     * @since   1.6
     */
    public function __construct($config = [], MVCFactoryInterface $factory
= null, $app = null, $input = null)
    {
        parent::__construct($config, $factory, $app, $input);

        $this->registerTask('apply', 'save');
    }

    /**
     * Method to handle cancel
     *
     * @return  void
     *
     * @since   3.2
     */
    public function cancel()
    {
        // Redirect back to home(base) page
        $this->setRedirect(Uri::base());
    }

    /**
     * Method to save global configuration.
     *
     * @return  boolean  True on success.
     *
     * @since   3.2
     */
    public function save()
    {
        // Check for request forgeries.
        $this->checkToken();

        // Check if the user is authorized to do this.
        if
(!$this->app->getIdentity()->authorise('core.admin')) {
           
$this->app->enqueueMessage(Text::_('JERROR_ALERTNOAUTHOR'));
            $this->app->redirect('index.php');
        }

        // Set FTP credentials, if given.
        ClientHelper::setCredentialsFromRequest('ftp');

        $model = $this->getModel();

        $form  = $model->getForm();
        $data  =
$this->app->getInput()->post->get('jform', [],
'array');

        // Validate the posted data.
        $return = $model->validate($form, $data);

        // Check for validation errors.
        if ($return === false) {
            /*
             * The validate method enqueued all messages for us, so we just
need to redirect back.
             */

            // Save the data in the session.
           
$this->app->setUserState('com_config.config.global.data',
$data);

            // Redirect back to the edit screen.
           
$this->app->redirect(Route::_('index.php?option=com_config&view=config',
false));
        }

        // Attempt to save the configuration.
        $data = $return;

        // Access backend com_config
        $saveClass =
$this->factory->createController('Application',
'Administrator', [], $this->app, $this->input);

        // Get a document object
        $document = $this->app->getDocument();

        // Set backend required params
        $document->setType('json');

        // Execute backend controller
        $return = $saveClass->save();

        // Reset params back after requesting from service
        $document->setType('html');

        // Check the return value.
        if ($return === false) {
            /*
             * The save method enqueued all messages for us, so we just
need to redirect back.
             */

            // Save the data in the session.
           
$this->app->setUserState('com_config.config.global.data',
$data);

            // Save failed, go back to the screen and display a notice.
           
$this->app->redirect(Route::_('index.php?option=com_config&view=config',
false));
        }

        // Redirect back to com_config display
       
$this->app->enqueueMessage(Text::_('COM_CONFIG_SAVE_SUCCESS'));
       
$this->app->redirect(Route::_('index.php?option=com_config&view=config',
false));

        return true;
    }
}
PK\w�[a��ש�&src/Controller/TemplatesController.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2017 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

namespace Joomla\Component\Config\Site\Controller;

use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Client\ClientHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Component Controller
 *
 * @since  1.5
 */
class TemplatesController extends BaseController
{
    /**
     * @param   array                         $config   An optional
associative array of configuration settings.
     *                                                  Recognized key
values include 'name', 'default_task',
'model_path', and
     *                                                 
'view_path' (this list is not meant to be comprehensive).
     * @param   MVCFactoryInterface|null      $factory  The factory.
     * @param   CMSApplication|null           $app      The Application for
the dispatcher
     * @param   \Joomla\CMS\Input\Input|null  $input    The Input object
for the request
     *
     * @since   1.6
     */
    public function __construct($config = [], MVCFactoryInterface $factory
= null, $app = null, $input = null)
    {
        parent::__construct($config, $factory, $app, $input);

        // Apply, Save & New, and Save As copy should be standard on
forms.
        $this->registerTask('apply', 'save');
    }

    /**
     * Method to handle cancel
     *
     * @return  void
     *
     * @since   3.2
     */
    public function cancel()
    {
        // Redirect back to home(base) page
        $this->setRedirect(Uri::base());
    }

    /**
     * Method to save global configuration.
     *
     * @return  boolean  True on success.
     *
     * @since   3.2
     */
    public function save()
    {
        // Check for request forgeries.
        $this->checkToken();

        // Check if the user is authorized to do this.
        if
(!$this->app->getIdentity()->authorise('core.admin')) {
            $this->setRedirect('index.php',
Text::_('JERROR_ALERTNOAUTHOR'));

            return false;
        }

        // Set FTP credentials, if given.
        ClientHelper::setCredentialsFromRequest('ftp');

        $app = $this->app;

        // Access backend com_templates
        $controllerClass =
$app->bootComponent('com_templates')
            ->getMVCFactory()->createController('Style',
'Administrator', [], $app, $app->getInput());

        // Get a document object
        $document = $app->getDocument();

        // Set backend required params
        $document->setType('json');
        $this->input->set('id',
$app->getTemplate(true)->id);

        // Execute backend controller
        $return = $controllerClass->save();

        // Reset params back after requesting from service
        $document->setType('html');

        // Check the return value.
        if ($return === false) {
            // Save failed, go back to the screen and display a notice.
           
$this->setMessage(Text::sprintf('JERROR_SAVE_FAILED'),
'error');
           
$this->setRedirect(Route::_('index.php?option=com_config&view=templates',
false));

            return false;
        }

        // Set the success message.
        $this->setMessage(Text::_('COM_CONFIG_SAVE_SUCCESS'));

        // Redirect back to com_config display
       
$this->setRedirect(Route::_('index.php?option=com_config&view=templates',
false));

        return true;
    }
}
PK\w�[o(]�	�	src/View/Modules/HtmlView.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2017 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

namespace Joomla\Component\Config\Site\View\Modules;

use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * View to edit a module.
 *
 * @since       3.2
 */
class HtmlView extends BaseHtmlView
{
    /**
     * The module to be rendered
     *
     * @var   array
     *
     * @since 3.2
     */
    public $item;

    /**
     * The form object
     *
     * @var   Form
     *
     * @since 3.2
     */
    public $form;

    /**
     * Execute and display a template script.
     *
     * @param   string  $tpl  The name of the template file to parse;
automatically searches through the template paths.
     *
     * @return  void
     *
     * @since   3.2
     */
    public function display($tpl = null)
    {
        $lang = Factory::getApplication()->getLanguage();
        $lang->load('', JPATH_ADMINISTRATOR,
$lang->getTag());
        $lang->load('com_modules', JPATH_ADMINISTRATOR,
$lang->getTag());

        // @todo Move and clean up
        $module = (new
\Joomla\Component\Modules\Administrator\Model\ModuleModel())->getItem(Factory::getApplication()->getInput()->getInt('id'));

        $moduleData = $module->getProperties();
        unset($moduleData['xml']);

        /** @var \Joomla\Component\Config\Site\Model\ModulesModel $model */
        $model = $this->getModel();

        // Need to add module name to the state of model
        $model->getState()->set('module.name',
$moduleData['module']);

        /** @var Form form */
        $this->form      = $this->get('form');
        $this->positions = $this->get('positions');
        $this->item      = $moduleData;

        if ($this->form) {
            $this->form->bind($moduleData);
        }

        $this->_prepareDocument();

        parent::display($tpl);
    }

    /**
     * Prepares the document.
     *
     * @return  void
     *
     * @since   4.0.0
     */
    protected function _prepareDocument()
    {
        // There is no menu item for this so we have to use the title from
the component
       
$this->setDocumentTitle(Text::_('COM_CONFIG_MODULES_SETTINGS_TITLE'));
    }
}
PK\w�[�$M��src/View/Templates/HtmlView.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2017 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

namespace Joomla\Component\Config\Site\View\Templates;

use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\MVC\Factory\MVCFactory;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\Component\Config\Administrator\Controller\RequestController;
use Joomla\Component\Templates\Administrator\View\Style\JsonView;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * View to edit a template style.
 *
 * @since  3.2
 */
class HtmlView extends BaseHtmlView
{
    /**
     * The data to be displayed in the form
     *
     * @var   array
     *
     * @since 3.2
     */
    public $item;

    /**
     * The form object
     *
     * @var   Form
     *
     * @since 3.2
     */
    public $form;

    /**
     * Is the current user a super administrator?
     *
     * @var   boolean
     *
     * @since 3.2
     */
    protected $userIsSuperAdmin;

    /**
     * The page class suffix
     *
     * @var    string
     *
     * @since  4.0.0
     */
    protected $pageclass_sfx = '';

    /**
     * The page parameters
     *
     * @var    \Joomla\Registry\Registry|null
     *
     * @since  4.0.0
     */
    protected $params = null;

    /**
     * Method to render the view.
     *
     * @return  void
     *
     * @since   3.2
     */
    public function display($tpl = null)
    {
        $user                   = $this->getCurrentUser();
        $this->userIsSuperAdmin =
$user->authorise('core.admin');

        $app   = Factory::getApplication();

        $app->getInput()->set('id',
$app->getTemplate(true)->id);

        /** @var MVCFactory $factory */
        $factory =
$app->bootComponent('com_templates')->getMVCFactory();

        /** @var JsonView $view */
        $view = $factory->createView('Style',
'Administrator', 'Json');
        $view->setModel($factory->createModel('Style',
'Administrator'), true);
        $view->setLanguage($app->getLanguage());

        $view->document = $this->getDocument();

        $json = $view->display();

        // Execute backend controller
        $serviceData = json_decode($json, true);

        // Access backend com_config
        $requestController = new RequestController();

        // Execute backend controller
        $configData = json_decode($requestController->getJson(), true);

        $data = array_merge($configData, $serviceData);

        /** @var Form $form */
        $form = $this->getForm();

        if ($form) {
            $form->bind($data);
        }

        $this->form = $form;

        $this->data = $serviceData;

        $this->_prepareDocument();

        parent::display($tpl);
    }

    /**
     * Prepares the document.
     *
     * @return  void
     *
     * @since   4.0.0
     */
    protected function _prepareDocument()
    {
        $params = Factory::getApplication()->getParams();

        // Because the application sets a default page title, we need to
get it
        // right from the menu item itself
        $this->setDocumentTitle($params->get('page_title',
''));

        if ($params->get('menu-meta_description')) {
           
$this->getDocument()->setDescription($params->get('menu-meta_description'));
        }

        if ($params->get('robots')) {
            $this->getDocument()->setMetaData('robots',
$params->get('robots'));
        }

        // Escape strings for HTML output
        $this->pageclass_sfx =
htmlspecialchars($params->get('pageclass_sfx', ''));
        $this->params        = &$params;
    }
}
PK\w�[6����src/View/Config/HtmlView.phpnu�[���<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   (C) 2017 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

namespace Joomla\Component\Config\Site\View\Config;

use Joomla\CMS\Factory;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\Component\Config\Administrator\Controller\RequestController;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * View for the global configuration
 *
 * @since  3.2
 */
class HtmlView extends BaseHtmlView
{
    /**
     * The form object
     *
     * @var   \Joomla\CMS\Form\Form
     *
     * @since 3.2
     */
    public $form;

    /**
     * The data to be displayed in the form
     *
     * @var   array
     *
     * @since 3.2
     */
    public $data;

    /**
     * Is the current user a super administrator?
     *
     * @var   boolean
     *
     * @since 3.2
     */
    protected $userIsSuperAdmin;

    /**
     * The page class suffix
     *
     * @var    string
     *
     * @since  4.0.0
     */
    protected $pageclass_sfx = '';

    /**
     * The page parameters
     *
     * @var    \Joomla\Registry\Registry|null
     *
     * @since  4.0.0
     */
    protected $params = null;

    /**
     * Execute and display a template script.
     *
     * @param   string  $tpl  The name of the template file to parse;
automatically searches through the template paths.
     *
     * @return  void
     *
     * @since   3.2
     */
    public function display($tpl = null)
    {
        $user                   = $this->getCurrentUser();
        $this->userIsSuperAdmin =
$user->authorise('core.admin');

        // Access backend com_config
        $requestController = new RequestController();

        // Execute backend controller
        $serviceData = json_decode($requestController->getJson(), true);

        $form = $this->getForm();

        if ($form) {
            $form->bind($serviceData);
        }

        $this->form = $form;
        $this->data = $serviceData;

        $this->_prepareDocument();

        parent::display($tpl);
    }

    /**
     * Prepares the document.
     *
     * @return  void
     *
     * @since   4.0.0
     */
    protected function _prepareDocument()
    {
        $params = Factory::getApplication()->getParams();

        // Because the application sets a default page title, we need to
get it
        // right from the menu item itself

        $this->setDocumentTitle($params->get('page_title',
''));

        if ($params->get('menu-meta_description')) {
           
$this->getDocument()->setDescription($params->get('menu-meta_description'));
        }

        if ($params->get('robots')) {
            $this->getDocument()->setMetaData('robots',
$params->get('robots'));
        }

        // Escape strings for HTML output
        $this->pageclass_sfx =
htmlspecialchars($params->get('pageclass_sfx', ''));
        $this->params        = &$params;
    }
}
PKUn�[M��IJ�
config.phpnu�[���PKVn�[\�D���controller/cancel.phpnu�[���PKVn�[�M���controller/canceladmin.phpnu�[���PKXn�[�YlqHH'controller/cmsbase.phpnu�[���PKXn�[}_y�*	*	�controller/config/display.phpnu�[���PKXn�[~����,controller/config/save.phpnu�[���PKXn�[E0TY�
�
&controller/display.phpnu�[���PKXn�[Q<RF
F
$1controller/helper.phpnu�[���PKXn�[�����;controller/modules/cancel.phpnu�[���PKXn�[�@/�ll�Bcontroller/modules/display.phpnu�[���PKXn�[9mX���XOcontroller/modules/save.phpnu�[���PKXn�[�&��O
O
 =\controller/templates/display.phpnu�[���PKXn�[��x�	�	�fcontroller/templates/save.phpnu�[���PKXn�[�j==
�pmodel/cms.phpnu�[���PKXn�[-*��[�model/config.phpnu�[���PKXn�[��E�
�
A�model/form/config.xmlnu�[���PKXn�[��7��7�model/form/modules.xmlnu�[���PKXn�[$�y�((A�model/form/modules_advanced.xmlnu�[���PKXn�[�iv~~��model/form/templates.xmlnu�[���PKXn�[�-�Q"Q"~�model/form.phpnu�[���PKXn�[器�
�model/modules.phpnu�[���PKXn�["'��WWm�model/templates.phpnu�[���PKZn�[=�!,,�view/cms/html.phpnu�[���PKZn�[�6�3vvtview/cms/json.phpnu�[���PKZn�[Y-���+view/config/html.phpnu�[���PKZn�[m�F�%%view/config/tmpl/default.phpnu�[���PKZn�[ImO���view/config/tmpl/default.xmlnu�[���PKZn�[.�V��%�view/config/tmpl/default_metadata.phpnu�[���PKZn�[c�€�
�view/config/tmpl/default_seo.phpnu�[���PKZn�[N�V��!o
view/config/tmpl/default_site.phpnu�[���PKZn�[y�?�$$B#view/modules/html.phpnu�[���PKZn�[�\11�&view/modules/tmpl/default.phpnu�[���PKZn�[l����%)?view/modules/tmpl/default_options.phpnu�[���PKZn�[O�^^')Eview/modules/tmpl/default_positions.phpnu�[���PKZn�[O�*����Hview/templates/html.phpnu�[���PKZn�[�IHP���Kview/templates/tmpl/default.phpnu�[���PKZn�[C?���Sview/templates/tmpl/default.xmlnu�[���PKZn�[&*�Ƈ�'PUview/templates/tmpl/default_options.phpnu�[���PKZw�[L䛻{	{	.Zforms/config.xmlnu�[���PKZw�[O�4JJ�cforms/modules_advanced.xmlnu�[���PKZw�[�����}gforms/templates.xmlnu�[���PKZw�[�jȔ	�	ajforms/modules.xmlnu�[���PKZw�[N
��6ttmpl/templates/default.xmlnu�[���PKZw�[�aw��"Vvtmpl/templates/default_options.phpnu�[���PKZw�[�]bR���ztmpl/templates/default.phpnu�[���PKZw�[�
�pp
h�tmpl/config/default_metadata.phpnu�[���PKZw�[��g��(�tmpl/config/default.xmlnu�[���PK[w�[x2;ff=�tmpl/config/default_seo.phpnu�[���PK[w�[�=L�hh�tmpl/config/default_site.phpnu�[���PK[w�[-��AA��tmpl/config/default.phpnu�[���PK[w�[A���ff
*�tmpl/modules/default_options.phpnu�[���PK[w�[��g����tmpl/modules/default.phpnu�[���PK[w�[UX�]���src/Service/Router.phpnu�[���PK[w�[Ďਥ���src/Dispatcher/Dispatcher.phpnu�[���PK[w�[�pf�
�
��src/Model/TemplatesModel.phpnu�[���PK[w�[^�RR�src/Model/ConfigModel.phpnu�[���PK[w�[��c�77��src/Model/ModulesModel.phpnu�[���PK[w�[���
�
4�src/Model/FormModel.phpnu�[���PK\w�[�R�''$Vsrc/Controller/ModulesController.phpnu�[���PK\w�[F;$�1src/Controller/DisplayController.phpnu�[���PK\w�[
_�cff#95src/Controller/ConfigController.phpnu�[���PK\w�[a��ש�&�Fsrc/Controller/TemplatesController.phpnu�[���PK\w�[o(]�	�	�Usrc/View/Modules/HtmlView.phpnu�[���PK\w�[�$M���_src/View/Templates/HtmlView.phpnu�[���PK\w�[6�����nsrc/View/Config/HtmlView.phpnu�[���PKAA�@{