- md5
- afd80b3db19cf122b4eb391855f92c47
- sha1
- cc1be2a4fed0a1ee4db7a92b2cdd3c7e166bf805
- sha256
- 258f7d52aa37b3b14af281670276a1bb2162ef848584bb706efd1c7e583c1065
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
<?php
/**
* @package Joomla.Site
* @subpackage mod_articles
*
* @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\Articles\Site\Dispatcher;
use Joomla\CMS\Dispatcher\AbstractModuleDispatcher;
use Joomla\CMS\Helper\HelperFactoryAwareInterface;
use Joomla\CMS\Helper\HelperFactoryAwareTrait;
use Joomla\CMS\Helper\ModuleHelper;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Dispatcher class for mod_articles
*
* @since 5.2.0
*/
class Dispatcher extends AbstractModuleDispatcher implements HelperFactoryAwareInterface
{
use HelperFactoryAwareTrait;
/**
* Returns the layout data.
*
* @return array
*
* @since 5.2.0
*/
protected function getLayoutData(): array
{
$data = parent::getLayoutData();
$params = $data['params'];
// Prep for Normal or Dynamic Modes
$mode = $params->get('mode', 'normal');
$idBase = null;
switch ($mode) {
case 'dynamic':
$option = $data['input']->get('option');
$view = $data['input']->get('view');
if ($option === 'com_content') {
switch ($view) {
case 'category':
case 'categories':
$idBase = $data['input']->getInt('id');
break;
case 'article':
if ($params->get('show_on_article_page', 1)) {
$idBase = $data['input']->getInt('catid');
}
break;
}
}
break;
default:
$idBase = $params->get('catid');
break;
}
$cacheParams = new \stdClass();
$cacheParams->cachemode = 'id';
$cacheParams->class = $this->getHelperFactory()->getHelper('ArticlesHelper');
$cacheParams->method = 'getArticles';
$cacheParams->methodparams = [$params, $data['app']];
$cacheParams->modeparams = md5(serialize([$idBase, $this->module->module, $this->module->id]));
$data['list'] = ModuleHelper::moduleCache($this->module, $params, $cacheParams);
$data['grouped'] = $params->get('article_grouping', 'none') !== 'none';
return $data;
}
}
The same content is in 111 releases, Joomla 5.2.0-rc1 to 6.2.1-rc1. See them all, or every version of this file.