primo commit

This commit is contained in:
2024-12-17 17:34:10 +01:00
commit e650f8df99
16435 changed files with 2451012 additions and 0 deletions

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension type="module" client="administrator" method="upgrade">
<name>mod_version</name>
<author>Joomla! Project</author>
<creationDate>2012-01</creationDate>
<copyright>(C) 2012 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>3.0.0</version>
<description>MOD_VERSION_XML_DESCRIPTION</description>
<namespace path="src">Joomla\Module\Version</namespace>
<files>
<folder module="mod_version">services</folder>
<folder>src</folder>
<folder>tmpl</folder>
</files>
<languages>
<language tag="en-GB">language/en-GB/mod_version.ini</language>
<language tag="en-GB">language/en-GB/mod_version.sys.ini</language>
</languages>
<help key="Admin_Modules:_Joomla_Version_Information" />
<config>
<fields name="params">
<fieldset name="advanced">
<field
name="layout"
type="modulelayout"
label="JFIELD_ALT_LAYOUT_LABEL"
class="form-select"
validate="moduleLayout"
/>
<field
name="moduleclass_sfx"
type="textarea"
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
rows="3"
validate="CssIdentifier"
/>
</fieldset>
</fields>
</config>
</extension>

View File

@ -0,0 +1,36 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage mod_version
*
* @copyright (C) 2024 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Extension\Service\Provider\HelperFactory;
use Joomla\CMS\Extension\Service\Provider\Module;
use Joomla\CMS\Extension\Service\Provider\ModuleDispatcherFactory;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
return new class () implements ServiceProviderInterface {
/**
* Registers the service provider with a DI container.
*
* @param Container $container The DI container.
*
* @return void
*
* @since 5.1.0
*/
public function register(Container $container)
{
$container->registerServiceProvider(new ModuleDispatcherFactory('\\Joomla\\Module\\Version'));
$container->registerServiceProvider(new HelperFactory('\\Joomla\\Module\\Version\\Administrator\\Helper'));
$container->registerServiceProvider(new Module());
}
};

View File

@ -0,0 +1,45 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage mod_version
*
* @copyright (C) 2024 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Module\Version\Administrator\Dispatcher;
use Joomla\CMS\Dispatcher\AbstractModuleDispatcher;
use Joomla\CMS\Helper\HelperFactoryAwareInterface;
use Joomla\CMS\Helper\HelperFactoryAwareTrait;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Dispatcher class for mod_version
*
* @since 5.1.0
*/
class Dispatcher extends AbstractModuleDispatcher implements HelperFactoryAwareInterface
{
use HelperFactoryAwareTrait;
/**
* Returns the layout data.
*
* @return array
*
* @since 5.1.0
*/
protected function getLayoutData()
{
$data = parent::getLayoutData();
$data['version'] = $this->getHelperFactory()->getHelper('VersionHelper')->getVersionString();
return $data;
}
}

View File

@ -0,0 +1,55 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage mod_version
*
* @copyright (C) 2012 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Module\Version\Administrator\Helper;
use Joomla\CMS\Version;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Helper for mod_version
*
* @since 1.6
*/
class VersionHelper
{
/**
* Get the Joomla version number.
*
* @return string String containing the current Joomla version.
*
* @since 5.1.0
*/
public function getVersionString()
{
$version = new Version();
return '&#x200E;' . $version->getShortVersion();
}
/**
* Get the Joomla version number.
*
* @return string String containing the current Joomla version.
*
* @deprecated 5.1.0 will be removed in 7.0
* Use the non-static method getVersionString
* Example: Factory::getApplication()->bootModule('mod_version', 'administrator')
* ->getHelper('VersionHelper')
* ->getVersionString()
*/
public static function getVersion()
{
return (new self())->getVersionString();
}
}

View File

@ -0,0 +1,22 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage mod_version
*
* @copyright (C) 2012 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
?>
<div class="header-item-content joomlaversion">
<div class="header-item-text no-link">
<span class="icon-joomla" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::sprintf('MOD_VERSION_CURRENT_VERSION_TEXT', $version); ?></span>
<span aria-hidden="true"><?php echo $version; ?></span>
</div>
</div>