-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '5.1-dev' into 5.1/modules/site/feed
- Loading branch information
Showing
36 changed files
with
1,041 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
/** | ||
* @package Joomla.Administrator | ||
* @subpackage mod_custom | ||
* | ||
* @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\Module; | ||
use Joomla\CMS\Extension\Service\Provider\ModuleDispatcherFactory; | ||
use Joomla\DI\Container; | ||
use Joomla\DI\ServiceProviderInterface; | ||
|
||
/** | ||
* The custom module service provider. | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
return new class () implements ServiceProviderInterface { | ||
/** | ||
* Registers the service provider with a DI container. | ||
* | ||
* @param Container $container The DI container. | ||
* | ||
* @return void | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function register(Container $container) | ||
{ | ||
$container->registerServiceProvider(new ModuleDispatcherFactory('\\Joomla\\Module\\Custom')); | ||
|
||
$container->registerServiceProvider(new Module()); | ||
} | ||
}; |
49 changes: 49 additions & 0 deletions
49
administrator/modules/mod_custom/src/Dispatcher/Dispatcher.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
/** | ||
* @package Joomla.Administrator | ||
* @subpackage mod_custom | ||
* | ||
* @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\Custom\Administrator\Dispatcher; | ||
|
||
use Joomla\CMS\Dispatcher\AbstractModuleDispatcher; | ||
use Joomla\CMS\HTML\HTMLHelper; | ||
use Joomla\CMS\Plugin\PluginHelper; | ||
|
||
// phpcs:disable PSR1.Files.SideEffects | ||
\defined('_JEXEC') or die; | ||
// phpcs:enable PSR1.Files.SideEffects | ||
|
||
/** | ||
* Dispatcher class for mod_custom | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
class Dispatcher extends AbstractModuleDispatcher | ||
{ | ||
/** | ||
* Returns the layout data. | ||
* | ||
* @return array | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
protected function getLayoutData() | ||
{ | ||
$data = parent::getLayoutData(); | ||
|
||
if ($data['params']->def('prepare_content', 1)) { | ||
PluginHelper::importPlugin('content'); | ||
$this->module->content = HTMLHelper::_('content.prepare', $this->module->content, '', 'mod_custom.content'); | ||
} | ||
|
||
// Replace 'images/' to '../images/' when using an image from /images in backend. | ||
$this->module->content = preg_replace('*src\=\"(?!administrator\/)images/*', 'src="../images/', $this->module->content); | ||
|
||
return $data; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
/** | ||
* @package Joomla.Administrator | ||
* @subpackage mod_messages | ||
* | ||
* @copyright (C) 2024 Open Source Matters, Inc. <https://www.joomla.org> | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
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; | ||
|
||
// phpcs:disable PSR1.Files.SideEffects | ||
\defined('_JEXEC') or die; | ||
// phpcs:enable PSR1.Files.SideEffects | ||
|
||
/** | ||
* The messages module service provider. | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
return new class () implements ServiceProviderInterface { | ||
/** | ||
* Registers the service provider with a DI container. | ||
* | ||
* @param Container $container The DI container. | ||
* | ||
* @return void | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function register(Container $container) | ||
{ | ||
$container->registerServiceProvider(new ModuleDispatcherFactory('\\Joomla\\Module\\Messages')); | ||
$container->registerServiceProvider(new HelperFactory('\\Joomla\\Module\\Messages\\Administrator\\Helper')); | ||
|
||
$container->registerServiceProvider(new Module()); | ||
} | ||
}; |
65 changes: 65 additions & 0 deletions
65
administrator/modules/mod_messages/src/Dispatcher/Dispatcher.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
/** | ||
* @package Joomla.Administrator | ||
* @subpackage mod_messages | ||
* | ||
* @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\Messages\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_messages | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
class Dispatcher extends AbstractModuleDispatcher implements HelperFactoryAwareInterface | ||
{ | ||
use HelperFactoryAwareTrait; | ||
|
||
/** | ||
* Runs the dispatcher. | ||
* | ||
* @return void | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function dispatch() | ||
{ | ||
// Check permissions. | ||
if ( | ||
!$this->getApplication()->getIdentity()->authorise('core.login.admin') | ||
|| !$this->getApplication()->getIdentity()->authorise('core.manage', 'com_messages') | ||
) { | ||
return; | ||
} | ||
|
||
parent::dispatch(); | ||
} | ||
|
||
/** | ||
* Returns the layout data. | ||
* | ||
* @return array | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
protected function getLayoutData() | ||
{ | ||
$data = parent::getLayoutData(); | ||
|
||
$data['countUnread'] = $this->getHelperFactory()->getHelper('MessagesHelper')->getUnreadMessagesCount($data['params'], $this->getApplication()); | ||
|
||
return $data; | ||
} | ||
} |
Oops, something went wrong.