- md5
- b20c6259b1ff03d7926a3a30d80fe52f
- sha1
- 979b9381e17ffa46880085accc3db1f2521629ae
- sha256
- 9646d17f8888aa820f402ce58ba3de8ec9c01c34b5f3f73dad04da5952645245
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
<?php
/**
* @package Joomla.Site
* @subpackage com_config
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Config\Site\View\Modules;
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
/**
* View to edit a module.
*
* @package Joomla.Site
* @subpackage com_config
* @since 3.2
*/
class HtmlView extends BaseHtmlView
{
/**
* The module to be rendered
*
* @var array
* @since 3.2
*/
public $item;
/**
* The form object
*
* @var \JForm
* @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 mixed A string if successful, otherwise an Error object.
*
* @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()->input->getInt('id'));
$moduleData = $module->getProperties();
unset($moduleData['xml']);
/** @var Modules $model */
$model = $this->getModel();
// Need to add module name to the state of model
$model->getState()->set('module.name', $moduleData['module']);
/** @var \JForm form */
$this->form = $this->get('form');
$this->positions = $this->get('positions');
$this->item = $moduleData;
if ($this->form)
{
$this->form->bind($moduleData);
}
return parent::display($tpl);
}
}
The same content is in 2 releases, Joomla 4.0.0-alpha5 to 4.0.0-alpha6. See them all, or every version of this file.