Файловый менеджер - Редактировать - /home/lmsyaran/public_html/pusher/com_config.zip
Назад
PK %d�[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(); PK %d�[\�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()); } } PK %d�[�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(); } } } PK %d�[�YlqH H controller/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; } } PK %d�[}_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; } } PK %d�[~��� � 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; } } PK %d�[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; } } PK %d�[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; } } PK &d�[��� � 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(); } } PK &d�[�@/�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; } } PK &d�[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; } } } PK &d�[�&��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; } } PK &d�[��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; } } PK &d�[ �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); } } PK &d�[-*� � 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; } } PK &d�[��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> PK &d�[��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> PK &d�[$�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> PK &d�[�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> PK &d�[�-�Q"