- md5
- d1c78810710fae5745e5e813c7ebda63
- sha1
- e72c201f1e7e9ab9303afbed3976f7ce62cdcbae
- sha256
- 8d70473d15b3c0d4157766edb6d856e67d0725a4fe6003e452555d2db49a2b9f
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
<?php
/**
* @package Joomla.Administrator
* @subpackage mod_latestactions
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Module\LatestActions\Administrator\Helper;
\defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\Component\Actionlogs\Administrator\Helper\ActionlogsHelper;
use Joomla\Component\Actionlogs\Administrator\Model\ActionlogsModel;
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 ActionlogsModel $model */
$model = new ActionlogsModel(['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.0.0-beta to 4.0.0-beta5. See them all, or every version of this file.