- md5
- 3fcf83bce0432cb3e5223111b6f950d7
- sha1
- 626360587a6f562c981de901ade6e8c731af6d6d
- sha256
- e6370ac8706956defeb6ca1c1bc1f507c651d02ea5fcd367ad593b9ce35dc7d4
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
<?php
/**
* @package Joomla.Administrator
* @subpackage Joomla.Libraries
*
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die('Restricted access');
/**
* 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->isAdmin())
{
$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->isAdmin())
{
$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');
// 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')
{
return $view->render();
}
// Render view.
echo $view->render();
}
return true;
}
}
The same content is in 8 releases, Joomla 3.4.0-beta1 to 3.4.1. See them all, or every version of this file.