- md5
- df42a77304591d453004906dc26a7549
- sha1
- d8b21fdd0d8faf6255222ef8dc1d81c9503bdc91
- sha256
- 4a9fdf8bb2776c3980c4f80343e9a88d2b28eb0022f9bb421e3973eb5afd6967
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
<?php
/**
* @package Joomla.Administrator
* @subpackage mod_latestactions
*
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Module\LatestActions\Administrator\Helper;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\Component\Actionlogs\Administrator\Helper\ActionlogsHelper;
use Joomla\Registry\Registry;
/**
* Helper for mod_latestactions
*
* @since 3.9.0
*/
abstract class LatestActionsHelper
{
/**
* Get a list of articles.
*
* @param Registry &$params The module parameters.
*
* @return mixed An array of action logs, or false on error.
*
* @since 3.9.1
*
* @throws \Exception
*/
public static function getList(&$params)
{
/** @var \Joomla\Component\Actionlogs\Administrator\Model\ActionlogsModel $model */
$model = Factory::getApplication()->bootComponent('com_actionlogs')->getMVCFactory()
->createModel('Actionlogs', 'Administrator', ['ignore_request' => true]);
// Set the Start and Limit
$model->setState('list.start', 0);
$model->setState('list.limit', $params->get('count', 5));
$model->setState('list.ordering', 'a.id');
$model->setState('list.direction', 'DESC');
$rows = $model->getItems();
// Load all actionlog plugins language files
ActionlogsHelper::loadActionLogPluginsLanguage();
foreach ($rows as $row) {
$row->message = ActionlogsHelper::getHumanReadableLogMessage($row);
}
return $rows;
}
/**
* Get the alternate title for the module
*
* @param Registry $params The module parameters.
*
* @return string The alternate title for the module.
*
* @since 3.9.1
*/
public static function getTitle($params)
{
return Text::plural('MOD_LATESTACTIONS_TITLE', $params->get('count', 5));
}
}
The same content is in 5 releases, Joomla 4.2.0-beta3 to 4.2.1-rc2. See them all, or every version of this file.