- md5
- 9426aa73cee0a9e59ecc7582011d2291
- sha1
- 17c2748b5d18a39b245f8088856cdc6bd14f8664
- sha256
- 32ab061b03105d2ed5900d2ebe4d6fe47d44ba5133b7e76e0eae8fc87c709d9f
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
<?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;
\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-beta6 to 4.0.0-beta7. See them all, or every version of this file.