File tree Expand file tree Collapse file tree 5 files changed +88
-22
lines changed Expand file tree Collapse file tree 5 files changed +88
-22
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1111 <description >MOD_STATS_XML_DESCRIPTION</description >
1212 <namespace path =" src" >Joomla\Module\Stats</namespace >
1313 <files >
14- <filename module =" mod_stats" >mod_stats.php</ filename >
14+ <folder module =" mod_stats" >services</ folder >
1515 <folder >src</folder >
1616 <folder >tmpl</folder >
1717 </files >
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /**
4+ * @package Joomla.Administrator
5+ * @subpackage mod_stats
6+ *
7+ * @copyright (C) 2024 Open Source Matters, Inc. <https://www.joomla.org>
8+ * @license GNU General Public License version 2 or later; see LICENSE.txt
9+ */
10+
11+ \defined ('_JEXEC ' ) or die;
12+
13+ use Joomla \CMS \Extension \Service \Provider \HelperFactory ;
14+ use Joomla \CMS \Extension \Service \Provider \Module ;
15+ use Joomla \CMS \Extension \Service \Provider \ModuleDispatcherFactory ;
16+ use Joomla \DI \Container ;
17+ use Joomla \DI \ServiceProviderInterface ;
18+
19+ /**
20+ * The statistics module service provider.
21+ *
22+ * @since __DEPLOY_VERSION__
23+ */
24+ return new class () implements ServiceProviderInterface {
25+ /**
26+ * Registers the service provider with a DI container.
27+ *
28+ * @param Container $container The DI container.
29+ *
30+ * @return void
31+ *
32+ * @since __DEPLOY_VERSION__
33+ */
34+ public function register (Container $ container )
35+ {
36+ $ container ->registerServiceProvider (new ModuleDispatcherFactory ('\\Joomla \\Module \\Stats ' ));
37+ $ container ->registerServiceProvider (new HelperFactory ('\\Joomla \\Module \\Stats \\Site \\Helper ' ));
38+
39+ $ container ->registerServiceProvider (new Module ());
40+ }
41+ };
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /**
4+ * @package Joomla.Site
5+ * @subpackage mod_stats
6+ *
7+ * @copyright (C) 2024 Open Source Matters, Inc. <https://www.joomla.org>
8+ * @license GNU General Public License version 2 or later; see LICENSE.txt
9+ */
10+
11+ namespace Joomla \Module \Stats \Site \Dispatcher ;
12+
13+ use Joomla \CMS \Dispatcher \AbstractModuleDispatcher ;
14+ use Joomla \CMS \Helper \HelperFactoryAwareInterface ;
15+ use Joomla \CMS \Helper \HelperFactoryAwareTrait ;
16+
17+ // phpcs:disable PSR1.Files.SideEffects
18+ \defined ('_JEXEC ' ) or die;
19+ // phpcs:enable PSR1.Files.SideEffects
20+
21+ /**
22+ * Dispatcher class for mod_stats
23+ *
24+ * @since __DEPLOY_VERSION__
25+ */
26+ class Dispatcher extends AbstractModuleDispatcher implements HelperFactoryAwareInterface
27+ {
28+ use HelperFactoryAwareTrait;
29+
30+ /**
31+ * Returns the layout data.
32+ *
33+ * @return array
34+ *
35+ * @since __DEPLOY_VERSION__
36+ */
37+ protected function getLayoutData ()
38+ {
39+ $ data = parent ::getLayoutData ();
40+
41+ $ data ['list ' ] = $ this ->getHelperFactory ()->getHelper ('StatsHelper ' )->getList ($ data ['params ' ]);
42+
43+ return $ data ;
44+ }
45+ }
Original file line number Diff line number Diff line change 88 * @license GNU General Public License version 2 or later; see LICENSE.txt
99 */
1010
11- defined ('_JEXEC ' ) or die;
11+ \ defined ('_JEXEC ' ) or die;
1212?>
1313<ul class="mod-stats list-group">
1414<?php foreach ($ list as $ item ) : ?>
You can’t perform that action at this time.
0 commit comments