Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert mod_articles_category to new structure #39527

Merged
merged 41 commits into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
eadb213
Convert mod_articles_category to new structure
carlitorweb Dec 30, 2022
f275839
Merge branch '4.3-dev' into convert_mod_articles_category
carlitorweb Dec 30, 2022
412cd10
Merge branch '4.3-dev' into convert_mod_articles_category
carlitorweb Dec 31, 2022
079949f
moved this->getDatabase to where is used
carlitorweb Jan 1, 2023
ff392c6
Merge branch 'convert_mod_articles_category' of https://github.com/ca…
carlitorweb Jan 1, 2023
c2fcabe
Merge branch '4.3-dev' into convert_mod_articles_category
chmst Jan 8, 2023
9c327c1
Merge branch '4.3-dev' into convert_mod_articles_category
carlitorweb Jan 11, 2023
f657b98
Reviewers fixes
carlitorweb Jan 11, 2023
566f011
Merge branch '4.3-dev' into convert_mod_articles_category
carlitorweb Mar 11, 2023
c3013a3
Merge branch '4.4-dev' into convert_mod_articles_category
carlitorweb Mar 11, 2023
5ce557e
Merge remote-tracking branch 'upstream/4.3-dev' into convert_mod_arti…
carlitorweb Mar 12, 2023
aac65ba
Merge branch '4.4-dev' into convert_mod_articles_category
laoneo Mar 20, 2023
4e11cbc
Merge branch '4.4-dev' into convert_mod_articles_category
laoneo Mar 21, 2023
3132505
Merge branch '4.4-dev' into convert_mod_articles_category
carlitorweb Mar 27, 2023
d5225c8
cs fixes
carlitorweb Mar 27, 2023
9ee7444
Merge remote-tracking branch 'origin/convert_mod_articles_category' i…
carlitorweb Mar 28, 2023
bec5265
new_with_braces, class_definition cs
carlitorweb Mar 28, 2023
a94dfd7
revert clear cleanIntrotext name & docsBLock in getList function
carlitorweb Mar 28, 2023
3359ffb
revert cache
carlitorweb Mar 28, 2023
d0fa0de
cs fixes, again!
carlitorweb Mar 28, 2023
9d46bc6
cs
carlitorweb Mar 29, 2023
eeb0b18
cs
carlitorweb Mar 29, 2023
4f6760d
cs
carlitorweb Mar 29, 2023
796712f
Merge branch '4.4-dev' into convert_mod_articles_category
carlitorweb Mar 29, 2023
b7c4f11
cy automated test
carlitorweb Mar 29, 2023
62fdec5
removed input from constructor
carlitorweb Mar 29, 2023
de4269d
accepting 150 characters
carlitorweb Mar 29, 2023
3850cd8
Merge branch '4.4-dev' into convert_mod_articles_category
carlitorweb Mar 29, 2023
7c20d1c
unnecessary param in the test
carlitorweb Mar 29, 2023
65dfae8
Merge branch '4.4-dev' into convert_mod_articles_category
laoneo Mar 30, 2023
1a367f9
revert @since version for helper class
carlitorweb Mar 30, 2023
5ad58d4
revert type hinting from functions
carlitorweb Mar 30, 2023
2ccd954
revert docsBlocks
carlitorweb Mar 30, 2023
8fa21c7
revert docsBlocks
carlitorweb Mar 30, 2023
dafe851
revert Helper
carlitorweb Apr 2, 2023
7b6c975
group items used
carlitorweb Apr 2, 2023
438e7c3
Merge remote-tracking branch 'origin/convert_mod_articles_category' i…
carlitorweb Apr 2, 2023
e47eff0
revert multiline
laoneo Apr 3, 2023
4c2e762
reviews fixes
carlitorweb Apr 3, 2023
12c5068
Merge remote-tracking branch 'origin/convert_mod_articles_category' i…
carlitorweb Apr 3, 2023
3874980
Merge branch '4.4-dev' into convert_mod_articles_category
laoneo Apr 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 0 additions & 82 deletions modules/mod_articles_category/mod_articles_category.php

This file was deleted.

2 changes: 1 addition & 1 deletion modules/mod_articles_category/mod_articles_category.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<description>MOD_ARTICLES_CATEGORY_XML_DESCRIPTION</description>
<namespace path="src">Joomla\Module\ArticlesCategory</namespace>
<files>
<filename module="mod_articles_category">mod_articles_category.php</filename>
<folder module="mod_articles_category">services</folder>
<folder>src</folder>
<folder>tmpl</folder>
</files>
Expand Down
41 changes: 41 additions & 0 deletions modules/mod_articles_category/services/provider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

/**
* @package Joomla.Site
* @subpackage mod_articles_category
*
* @copyright (C) 2022 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;

/**
* The articles category 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\\ArticlesCategory'));
$container->registerServiceProvider(new HelperFactory('\\Joomla\\Module\\ArticlesCategory\\Site\\Helper'));

$container->registerServiceProvider(new Module());
}
};
48 changes: 48 additions & 0 deletions modules/mod_articles_category/src/Dispatcher/Dispatcher.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

/**
* @package Joomla.Site
* @subpackage mod_articles_category
*
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\Module\ArticlesCategory\Site\Dispatcher;

use Joomla\CMS\Dispatcher\AbstractModuleDispatcher;
use Joomla\CMS\Helper\HelperFactoryAwareInterface;
use Joomla\CMS\Helper\HelperFactoryAwareTrait;

// phpcs:disable PSR1.Files.SideEffects
\defined('JPATH_PLATFORM') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* Dispatcher class for mod_articles_category
*
* @since __DEPLOY_VERSION__
*/
class Dispatcher extends AbstractModuleDispatcher implements HelperFactoryAwareInterface
{
use HelperFactoryAwareTrait;

/**
* Returns the layout data.
*
* @return array
*
* @since __DEPLOY_VERSION__
*/
protected function getLayoutData(): array
{
$data = parent::getLayoutData();
$params = $data['params'];

$data['list'] = $this->getHelperFactory()->getHelper('ArticlesCategoryHelper')->getArticles($params, $data['app']);

$data['grouped'] = $params->get('article_grouping', 'none') !== 'none';

return $data;
}
}
Loading