first commit
This commit is contained in:
commit
1218dd1517
12716 files changed
+989233
No files matched your search
@@ -0,0 +1,370 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Belog\Controller;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Backend\View\BackendTemplateView;
|
||||
use TYPO3\CMS\Belog\Domain\Model\Constraint;
|
||||
use TYPO3\CMS\Belog\Domain\Model\LogEntry;
|
||||
use TYPO3\CMS\Core\Messaging\AbstractMessage;
|
||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
|
||||
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
|
||||
|
||||
/**
|
||||
* Abstract class to show log entries from sys_log
|
||||
* @internal This class is a TYPO3 Backend implementation and is not considered part of the Public TYPO3 API.
|
||||
*/
|
||||
class BackendLogController extends ActionController
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private const TIMEFRAME_THISWEEK = 0;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private const TIMEFRAME_LASTWEEK = 1;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private const TIMEFRAME_LASTSEVENDAYS = 2;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private const TIMEFRAME_THISMONTH = 10;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private const TIMEFRAME_LASTMONTH = 11;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private const TIMEFRAME_LAST31DAYS = 12;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private const TIMEFRAME_CUSTOM = 30;
|
||||
|
||||
/**
|
||||
* @var \TYPO3\CMS\Belog\Domain\Repository\LogEntryRepository
|
||||
*/
|
||||
protected $logEntryRepository;
|
||||
|
||||
/**
|
||||
* @var BackendTemplateView
|
||||
*/
|
||||
protected $view;
|
||||
|
||||
/**
|
||||
* @param \TYPO3\CMS\Belog\Domain\Repository\LogEntryRepository $logEntryRepository
|
||||
*/
|
||||
public function injectLogEntryRepository(\TYPO3\CMS\Belog\Domain\Repository\LogEntryRepository $logEntryRepository)
|
||||
{
|
||||
$this->logEntryRepository = $logEntryRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize list action
|
||||
*/
|
||||
public function initializeListAction()
|
||||
{
|
||||
if (!isset($this->settings['dateFormat'])) {
|
||||
$this->settings['dateFormat'] = $GLOBALS['TYPO3_CONF_VARS']['SYS']['USdateFormat'] ? 'm-d-Y' : 'd-m-Y';
|
||||
}
|
||||
if (!isset($this->settings['timeFormat'])) {
|
||||
$this->settings['timeFormat'] = $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'];
|
||||
}
|
||||
$constraintConfiguration = $this->arguments->getArgument('constraint')->getPropertyMappingConfiguration();
|
||||
$constraintConfiguration->allowAllProperties();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show general information and the installed modules
|
||||
*
|
||||
* @param Constraint $constraint
|
||||
* @param int $pageId
|
||||
* @param string $layout
|
||||
*/
|
||||
public function listAction(Constraint $constraint = null, int $pageId = null, string $layout = 'Default')
|
||||
{
|
||||
// Constraint object handling:
|
||||
// If there is none from GET, try to get it from BE user data, else create new
|
||||
if ($constraint === null) {
|
||||
$constraint = $this->getConstraintFromBeUserData();
|
||||
} else {
|
||||
$this->persistConstraintInBeUserData($constraint);
|
||||
}
|
||||
$constraint->setPageId($pageId);
|
||||
$this->resetConstraintsOnMemoryExhaustionError();
|
||||
$this->setStartAndEndTimeFromTimeSelector($constraint);
|
||||
$this->forceWorkspaceSelectionIfInWorkspace($constraint);
|
||||
$logEntries = $this->logEntryRepository->findByConstraint($constraint);
|
||||
$groupedLogEntries = $this->groupLogEntriesByPageAndDay($logEntries, $constraint->getGroupByPage());
|
||||
$this->view->assignMultiple([
|
||||
'pageId' => $pageId,
|
||||
'layout' => $layout,
|
||||
'groupedLogEntries' => $groupedLogEntries,
|
||||
'constraint' => $constraint,
|
||||
'userGroups' => $this->createUserAndGroupListForSelectOptions(),
|
||||
'workspaces' => $this->createWorkspaceListForSelectOptions(),
|
||||
'pageDepths' => $this->createPageDepthOptions(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all log entries that share the same message with the log entry given
|
||||
* in $errorUid
|
||||
*
|
||||
* @param int $errorUid
|
||||
*/
|
||||
public function deleteMessageAction(int $errorUid)
|
||||
{
|
||||
/** @var \TYPO3\CMS\Belog\Domain\Model\LogEntry $logEntry */
|
||||
$logEntry = $this->logEntryRepository->findByUid($errorUid);
|
||||
if (!$logEntry) {
|
||||
$this->addFlashMessage(LocalizationUtility::translate('actions.delete.noRowFound', 'belog'), '', AbstractMessage::WARNING);
|
||||
$this->redirect('list');
|
||||
}
|
||||
$numberOfDeletedRows = $this->logEntryRepository->deleteByMessageDetails($logEntry);
|
||||
$this->addFlashMessage(sprintf(LocalizationUtility::translate('actions.delete.message', 'belog'), $numberOfDeletedRows));
|
||||
$this->redirect('list');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get module states (the constraint object) from user data
|
||||
*
|
||||
* @return Constraint
|
||||
*/
|
||||
protected function getConstraintFromBeUserData()
|
||||
{
|
||||
$serializedConstraint = $GLOBALS['BE_USER']->getModuleData(static::class);
|
||||
$constraint = null;
|
||||
if (is_string($serializedConstraint) && !empty($serializedConstraint)) {
|
||||
$constraint = @unserialize($serializedConstraint, ['allowed_classes' => [Constraint::class, \DateTime::class]]);
|
||||
}
|
||||
return $constraint ?: $this->objectManager->get(Constraint::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save current constraint object in be user settings (uC)
|
||||
*
|
||||
* @param Constraint $constraint
|
||||
*/
|
||||
protected function persistConstraintInBeUserData(Constraint $constraint)
|
||||
{
|
||||
$GLOBALS['BE_USER']->pushModuleData(static::class, serialize($constraint));
|
||||
}
|
||||
|
||||
/**
|
||||
* In case the script execution fails, because the user requested too many results
|
||||
* (memory exhaustion in php), reset the constraints in be user settings, so
|
||||
* the belog can be accessed again in the next call.
|
||||
*/
|
||||
protected function resetConstraintsOnMemoryExhaustionError()
|
||||
{
|
||||
$reservedMemory = new \SplFixedArray(187500); // 3M
|
||||
register_shutdown_function(function () use (&$reservedMemory) {
|
||||
$reservedMemory = null; // free the reserved memory
|
||||
$error = error_get_last();
|
||||
if (strpos($error['message'], 'Allowed memory size of') !== false) {
|
||||
$constraint = $this->objectManager->get(Constraint::class);
|
||||
$this->persistConstraintInBeUserData($constraint);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a sorted array for day and page view from
|
||||
* the query result of the sys log repository.
|
||||
*
|
||||
* If group by page is FALSE, pid is always -1 (will render a flat list),
|
||||
* otherwise the output is split by pages.
|
||||
* '12345' is a sub array to split entries by day, number is first second of day
|
||||
*
|
||||
* [pid][dayTimestamp][items]
|
||||
*
|
||||
* @param QueryResultInterface $logEntries
|
||||
* @param bool $groupByPage Whether or not log entries should be grouped by page
|
||||
* @return array
|
||||
*/
|
||||
protected function groupLogEntriesByPageAndDay(QueryResultInterface $logEntries, $groupByPage = false)
|
||||
{
|
||||
$targetStructure = [];
|
||||
/** @var LogEntry $entry */
|
||||
foreach ($logEntries as $entry) {
|
||||
// Create page split list or flat list
|
||||
if ($groupByPage) {
|
||||
$pid = $entry->getEventPid();
|
||||
} else {
|
||||
$pid = -1;
|
||||
}
|
||||
// Create array if it is not defined yet
|
||||
if (!is_array($targetStructure[$pid])) {
|
||||
$targetStructure[$pid] = [];
|
||||
}
|
||||
// Get day timestamp of log entry and create sub array if needed
|
||||
$timestampDay = strtotime(strftime('%d.%m.%Y', $entry->getTstamp()));
|
||||
if (!is_array($targetStructure[$pid][$timestampDay])) {
|
||||
$targetStructure[$pid][$timestampDay] = [];
|
||||
}
|
||||
// Add row
|
||||
$targetStructure[$pid][$timestampDay][] = $entry;
|
||||
}
|
||||
ksort($targetStructure);
|
||||
return $targetStructure;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create options for the user / group drop down.
|
||||
* This is not moved to a repository by intention to not mix up this 'meta' data
|
||||
* with real repository work
|
||||
*
|
||||
* @return array Key is the option name, value its label
|
||||
*/
|
||||
protected function createUserAndGroupListForSelectOptions()
|
||||
{
|
||||
$userGroupArray = [];
|
||||
// Two meta entries: 'all' and 'self'
|
||||
$userGroupArray[0] = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('allUsers', 'Belog');
|
||||
$userGroupArray[-1] = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('self', 'Belog');
|
||||
// List of groups, key is gr-'uid'
|
||||
$groups = \TYPO3\CMS\Backend\Utility\BackendUtility::getGroupNames();
|
||||
foreach ($groups as $group) {
|
||||
$userGroupArray['gr-' . $group['uid']] = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('group', 'Belog') . ' ' . $group['title'];
|
||||
}
|
||||
// List of users, key is us-'uid'
|
||||
$users = \TYPO3\CMS\Backend\Utility\BackendUtility::getUserNames();
|
||||
foreach ($users as $user) {
|
||||
$userGroupArray['us-' . $user['uid']] = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('user', 'Belog') . ' ' . $user['username'];
|
||||
}
|
||||
return $userGroupArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create options for the workspace selector
|
||||
*
|
||||
* @return array Key is uid of workspace, value its label
|
||||
*/
|
||||
protected function createWorkspaceListForSelectOptions()
|
||||
{
|
||||
if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('workspaces')) {
|
||||
return [];
|
||||
}
|
||||
$workspaceArray = [];
|
||||
// Two meta entries: 'all' and 'live'
|
||||
$workspaceArray[-99] = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('any', 'Belog');
|
||||
$workspaceArray[0] = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('live', 'Belog');
|
||||
$workspaces = $this->objectManager->get(\TYPO3\CMS\Belog\Domain\Repository\WorkspaceRepository::class)->findAll();
|
||||
/** @var \TYPO3\CMS\Belog\Domain\Model\Workspace $workspace */
|
||||
foreach ($workspaces as $workspace) {
|
||||
$workspaceArray[$workspace->getUid()] = $workspace->getUid() . ': ' . $workspace->getTitle();
|
||||
}
|
||||
return $workspaceArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the user is in a workspace different than LIVE,
|
||||
* we force to show only log entries from the selected workspace,
|
||||
* and the workspace selector is not shown.
|
||||
*
|
||||
* @param Constraint $constraint
|
||||
*/
|
||||
protected function forceWorkspaceSelectionIfInWorkspace(Constraint $constraint)
|
||||
{
|
||||
if ($GLOBALS['BE_USER']->workspace !== 0) {
|
||||
$constraint->setWorkspaceUid($GLOBALS['BE_USER']->workspace);
|
||||
$this->view->assign('showWorkspaceSelector', false);
|
||||
} else {
|
||||
$this->view->assign('showWorkspaceSelector', true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create options for the 'depth of page levels' selector.
|
||||
* This is shown if the module is displayed in page -> info
|
||||
*
|
||||
* @return array Key is depth identifier (1 = One level), value the localized select option label
|
||||
*/
|
||||
protected function createPageDepthOptions()
|
||||
{
|
||||
$options = [
|
||||
0 => \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_0', 'lang'),
|
||||
1 => \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_1', 'lang'),
|
||||
2 => \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_2', 'lang'),
|
||||
3 => \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_3', 'lang'),
|
||||
4 => \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_4', 'lang'),
|
||||
999 => \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_infi', 'lang')
|
||||
];
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the start- and end timestamp from the different time selector options
|
||||
*
|
||||
* @param Constraint $constraint
|
||||
*/
|
||||
protected function setStartAndEndTimeFromTimeSelector(Constraint $constraint)
|
||||
{
|
||||
$startTime = 0;
|
||||
$endTime = $GLOBALS['EXEC_TIME'];
|
||||
// @TODO: Refactor this construct
|
||||
switch ($constraint->getTimeFrame()) {
|
||||
case self::TIMEFRAME_THISWEEK:
|
||||
// This week
|
||||
$week = (date('w') ?: 7) - 1;
|
||||
$startTime = mktime(0, 0, 0) - $week * 3600 * 24;
|
||||
break;
|
||||
case self::TIMEFRAME_LASTWEEK:
|
||||
// Last week
|
||||
$week = (date('w') ?: 7) - 1;
|
||||
$startTime = mktime(0, 0, 0) - ($week + 7) * 3600 * 24;
|
||||
$endTime = mktime(0, 0, 0) - $week * 3600 * 24;
|
||||
break;
|
||||
case self::TIMEFRAME_LASTSEVENDAYS:
|
||||
// Last 7 days
|
||||
$startTime = mktime(0, 0, 0) - 7 * 3600 * 24;
|
||||
break;
|
||||
case self::TIMEFRAME_THISMONTH:
|
||||
// This month
|
||||
$startTime = mktime(0, 0, 0, date('m'), 1);
|
||||
break;
|
||||
case self::TIMEFRAME_LASTMONTH:
|
||||
// Last month
|
||||
$startTime = mktime(0, 0, 0, date('m') - 1, 1);
|
||||
$endTime = mktime(0, 0, 0, date('m'), 1);
|
||||
break;
|
||||
case self::TIMEFRAME_LAST31DAYS:
|
||||
// Last 31 days
|
||||
$startTime = mktime(0, 0, 0) - 31 * 3600 * 24;
|
||||
break;
|
||||
case self::TIMEFRAME_CUSTOM:
|
||||
$startTime = $constraint->getManualDateStart() ? $constraint->getManualDateStart()->getTimestamp() : 0;
|
||||
$endTime = $constraint->getManualDateStop() ? $constraint->getManualDateStop()->getTimestamp() : 0;
|
||||
if ($endTime <= $startTime) {
|
||||
$endTime = $GLOBALS['EXEC_TIME'];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
$constraint->setStartTimestamp($startTime);
|
||||
$constraint->setEndTimestamp($endTime);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
namespace TYPO3\CMS\Belog\Controller;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Backend\Backend\ToolbarItems\SystemInformationToolbarItem;
|
||||
use TYPO3\CMS\Backend\Routing\UriBuilder;
|
||||
use TYPO3\CMS\Backend\Toolbar\Enumeration\InformationStatus;
|
||||
use TYPO3\CMS\Core\Database\Connection;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
|
||||
|
||||
/**
|
||||
* Count newest exceptions for the system information menu
|
||||
* @internal This class is a TYPO3 Backend implementation and is not considered part of the Public TYPO3 API.
|
||||
*/
|
||||
class SystemInformationController
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $backendUserConfiguration;
|
||||
|
||||
public function __construct(array $backendUserConfiguration = null)
|
||||
{
|
||||
$this->backendUserConfiguration = $backendUserConfiguration ?? $GLOBALS['BE_USER']->uc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modifies the SystemInformation array
|
||||
*
|
||||
* @param SystemInformationToolbarItem $systemInformationToolbarItem
|
||||
*/
|
||||
public function appendMessage(SystemInformationToolbarItem $systemInformationToolbarItem)
|
||||
{
|
||||
// we can't use the extbase repository here as the required TypoScript may not be parsed yet
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_log');
|
||||
$count = $queryBuilder->count('error')
|
||||
->from('sys_log')
|
||||
->where(
|
||||
$queryBuilder->expr()->gte(
|
||||
'tstamp',
|
||||
$queryBuilder->createNamedParameter($this->fetchLastAccessTimestamp(), \PDO::PARAM_INT)
|
||||
),
|
||||
$queryBuilder->expr()->in(
|
||||
'error',
|
||||
$queryBuilder->createNamedParameter([-1, 1, 2], Connection::PARAM_INT_ARRAY)
|
||||
)
|
||||
)
|
||||
->execute()
|
||||
->fetchColumn(0);
|
||||
|
||||
if ($count > 0) {
|
||||
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
|
||||
$systemInformationToolbarItem->addSystemMessage(
|
||||
sprintf(
|
||||
LocalizationUtility::translate('systemmessage.errorsInPeriod', 'belog'),
|
||||
$count,
|
||||
(string)$uriBuilder->buildUriFromRoute(
|
||||
'system_BelogLog',
|
||||
['tx_belog_system_beloglog' => ['constraint' => ['action' => -1]]]
|
||||
)
|
||||
),
|
||||
InformationStatus::STATUS_ERROR,
|
||||
$count,
|
||||
'system_BelogLog',
|
||||
http_build_query(['tx_belog_system_beloglog' => ['constraint' => ['action' => -1]]])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
protected function fetchLastAccessTimestamp(): int
|
||||
{
|
||||
if (!isset($this->backendUserConfiguration['systeminformation'])) {
|
||||
return 0;
|
||||
}
|
||||
$systemInformationUc = json_decode($this->backendUserConfiguration['systeminformation'], true);
|
||||
if (!isset($systemInformationUc['system_BelogLog']['lastAccess'])) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (int)$systemInformationUc['system_BelogLog']['lastAccess'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,344 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Belog\Domain\Model;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constraints for log entries
|
||||
* @internal This class is a TYPO3 Backend implementation and is not considered part of the Public TYPO3 API.
|
||||
*/
|
||||
class Constraint
|
||||
{
|
||||
/**
|
||||
* Selected user/group; possible values are "gr-<uid>" for a group, "us-<uid>" for a user or -1 for "all users"
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $userOrGroup = '0';
|
||||
|
||||
/**
|
||||
* Number of log rows to show
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $number = 20;
|
||||
|
||||
/**
|
||||
* UID of selected workspace
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $workspaceUid = \TYPO3\CMS\Belog\Domain\Model\Workspace::UID_ANY_WORKSPACE;
|
||||
|
||||
/**
|
||||
* Selected time frame
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $timeFrame = 0;
|
||||
|
||||
/**
|
||||
* Selected action
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $action = 0;
|
||||
|
||||
/**
|
||||
* Whether rows should be grouped by page
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $groupByPage = false;
|
||||
|
||||
/**
|
||||
* Calculated start timestamp
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $startTimestamp = 0;
|
||||
|
||||
/**
|
||||
* Calculated end timestamp
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $endTimestamp = 0;
|
||||
|
||||
/**
|
||||
* Manual date start
|
||||
* @var \DateTime
|
||||
*/
|
||||
protected $manualDateStart;
|
||||
|
||||
/**
|
||||
* Manual date stop
|
||||
* @var \DateTime
|
||||
*/
|
||||
protected $manualDateStop;
|
||||
|
||||
/**
|
||||
* Selected page ID in page context
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $pageId = 0;
|
||||
|
||||
/**
|
||||
* Page level depth
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $depth = 0;
|
||||
|
||||
/**
|
||||
* Set user
|
||||
*
|
||||
* @param string $user
|
||||
*/
|
||||
public function setUserOrGroup($user)
|
||||
{
|
||||
$this->userOrGroup = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUserOrGroup()
|
||||
{
|
||||
return $this->userOrGroup;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set number of log rows to show
|
||||
*
|
||||
* @param int $number
|
||||
*/
|
||||
public function setNumber($number)
|
||||
{
|
||||
$this->number = (int)$number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get number of log entries to show
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getNumber()
|
||||
{
|
||||
return $this->number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set workspace
|
||||
*
|
||||
* @param string $workspace
|
||||
*/
|
||||
public function setWorkspaceUid($workspace)
|
||||
{
|
||||
$this->workspaceUid = $workspace;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get workspace
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getWorkspaceUid()
|
||||
{
|
||||
return $this->workspaceUid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set time frame
|
||||
*
|
||||
* @param int $timeFrame
|
||||
*/
|
||||
public function setTimeFrame($timeFrame)
|
||||
{
|
||||
$this->timeFrame = $timeFrame;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get time frame
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getTimeFrame()
|
||||
{
|
||||
return (int)$this->timeFrame;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set action
|
||||
*
|
||||
* @param int $action
|
||||
*/
|
||||
public function setAction($action)
|
||||
{
|
||||
$this->action = $action;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get action
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return (int)$this->action;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set group by page
|
||||
*
|
||||
* @param bool $groupByPage
|
||||
*/
|
||||
public function setGroupByPage($groupByPage)
|
||||
{
|
||||
$this->groupByPage = $groupByPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get group by page
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getGroupByPage()
|
||||
{
|
||||
return (bool)$this->groupByPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set calculated start timestamp from query constraints
|
||||
*
|
||||
* @param int $timestamp
|
||||
*/
|
||||
public function setStartTimestamp($timestamp)
|
||||
{
|
||||
$this->startTimestamp = (int)$timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get calculated start timestamp from query constraints
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getStartTimestamp()
|
||||
{
|
||||
return $this->startTimestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set calculated end timestamp from query constraints
|
||||
*
|
||||
* @param int $timestamp
|
||||
*/
|
||||
public function setEndTimestamp($timestamp)
|
||||
{
|
||||
$this->endTimestamp = (int)$timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get calculated end timestamp from query constraints
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getEndTimestamp()
|
||||
{
|
||||
return $this->endTimestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set page id
|
||||
*
|
||||
* @param int $id
|
||||
*/
|
||||
public function setPageId($id)
|
||||
{
|
||||
$this->pageId = (int)$id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get page id
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPageId()
|
||||
{
|
||||
return $this->pageId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set page level depth
|
||||
*
|
||||
* @param int $depth
|
||||
*/
|
||||
public function setDepth($depth)
|
||||
{
|
||||
$this->depth = $depth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get page level depth
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getDepth()
|
||||
{
|
||||
return (int)$this->depth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set manual date start
|
||||
*
|
||||
* @param \DateTime $manualDateStart
|
||||
*/
|
||||
public function setManualDateStart(\DateTime $manualDateStart = null)
|
||||
{
|
||||
$this->manualDateStart = $manualDateStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get manual date start
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getManualDateStart()
|
||||
{
|
||||
return $this->manualDateStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set manual date stop
|
||||
*
|
||||
* @param \DateTime $manualDateStop
|
||||
*/
|
||||
public function setManualDateStop(\DateTime $manualDateStop = null)
|
||||
{
|
||||
$this->manualDateStop = $manualDateStop;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get manual date stop
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getManualDateStop()
|
||||
{
|
||||
return $this->manualDateStop;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,489 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Belog\Domain\Model;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
/**
|
||||
* A sys log entry
|
||||
* This model is 'complete': All current database properties are in there.
|
||||
*
|
||||
* @todo : This should be stuffed to some more central place
|
||||
* @internal This class is a TYPO3 Backend implementation and is not considered part of the Public TYPO3 API.
|
||||
*/
|
||||
class LogEntry extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
||||
{
|
||||
/**
|
||||
* Storage page ID of the log entry
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $pid = 0;
|
||||
|
||||
/**
|
||||
* This is not a relation to BeUser model, since the user does
|
||||
* not always exist, but we want the uid in then anyway.
|
||||
* This case is ugly in extbase, the best way we
|
||||
* have found now is to resolve the username (if it exists) in a
|
||||
* view helper and just use the uid of the be user here.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $backendUserUid = 0;
|
||||
|
||||
/**
|
||||
* Action ID of the action that happened, for example 3 was a file action
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $action = 0;
|
||||
|
||||
/**
|
||||
* UID of the record the event happened to
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $recordUid = 0;
|
||||
|
||||
/**
|
||||
* Table name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $tableName = 0;
|
||||
|
||||
/**
|
||||
* PID of the record the event happened to
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $recordPid = 0;
|
||||
|
||||
/**
|
||||
* Error code
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $error = 0;
|
||||
|
||||
/**
|
||||
* This is the log message itself, but possibly with %s substitutions.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $details = '';
|
||||
|
||||
/**
|
||||
* Timestamp when the log entry was written
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $tstamp = 0;
|
||||
|
||||
/**
|
||||
* Type code
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $type = 0;
|
||||
|
||||
/**
|
||||
* Details number
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $detailsNumber = 0;
|
||||
|
||||
/**
|
||||
* IP address of client
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $ip = '';
|
||||
|
||||
/**
|
||||
* Serialized log data. This is a serialized array with substitutions for $this->details.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $logData = '';
|
||||
|
||||
/**
|
||||
* Event PID
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $eventPid = 0;
|
||||
|
||||
/**
|
||||
* This is only the UID and not the full workspace object for the same reason as in $beUserUid.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $workspaceUid = 0;
|
||||
|
||||
/**
|
||||
* New ID
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $newId = 0;
|
||||
|
||||
/**
|
||||
* Set pid
|
||||
*
|
||||
* @param int $pid
|
||||
*/
|
||||
public function setPid($pid)
|
||||
{
|
||||
$this->pid = (int)$pid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get pid
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPid()
|
||||
{
|
||||
return $this->pid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set backend user uid
|
||||
*
|
||||
* @param int $beUserUid
|
||||
*/
|
||||
public function setBackendUserUid($beUserUid)
|
||||
{
|
||||
$this->backendUserUid = $beUserUid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get backend user id
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getBackendUserUid()
|
||||
{
|
||||
return $this->backendUserUid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set action
|
||||
*
|
||||
* @param int $action
|
||||
*/
|
||||
public function setAction($action)
|
||||
{
|
||||
$this->action = $action;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get action
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return (int)$this->action;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set record uid
|
||||
*
|
||||
* @param int $recordUid
|
||||
*/
|
||||
public function setRecordUid($recordUid)
|
||||
{
|
||||
$this->recordUid = $recordUid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get record uid
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getRecordUid()
|
||||
{
|
||||
return (int)$this->recordUid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set table name
|
||||
*
|
||||
* @param string $tableName
|
||||
*/
|
||||
public function setTableName($tableName)
|
||||
{
|
||||
$this->tableName = $tableName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get table name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTableName()
|
||||
{
|
||||
return $this->tableName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set record pid
|
||||
*
|
||||
* @param int $recordPid
|
||||
*/
|
||||
public function setRecordPid($recordPid)
|
||||
{
|
||||
$this->recordPid = $recordPid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get record pid
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getRecordPid()
|
||||
{
|
||||
return (int)$this->recordPid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set error
|
||||
*
|
||||
* @param int $error
|
||||
*/
|
||||
public function setError($error)
|
||||
{
|
||||
$this->error = $error;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get error
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getError()
|
||||
{
|
||||
return (int)$this->error;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get class name for the error code
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getErrorIconClass(): string
|
||||
{
|
||||
switch ($this->getError()) {
|
||||
case 1:
|
||||
return 'status-dialog-warning';
|
||||
case 2:
|
||||
case 3:
|
||||
return 'status-dialog-error';
|
||||
default:
|
||||
return 'empty-empty';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set details
|
||||
*
|
||||
* @param string $details
|
||||
*/
|
||||
public function setDetails($details)
|
||||
{
|
||||
$this->details = $details;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get details
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDetails()
|
||||
{
|
||||
if ($this->type === 255) {
|
||||
return str_replace('###IP###', $this->ip, $this->details);
|
||||
}
|
||||
return $this->details;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set tstamp
|
||||
*
|
||||
* @param int $tstamp
|
||||
*/
|
||||
public function setTstamp($tstamp)
|
||||
{
|
||||
$this->tstamp = $tstamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tstamp
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getTstamp()
|
||||
{
|
||||
return (int)$this->tstamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set type
|
||||
*
|
||||
* @param int $type
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return (int)$this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set details number
|
||||
*
|
||||
* @param int $detailsNumber
|
||||
*/
|
||||
public function setDetailsNumber($detailsNumber)
|
||||
{
|
||||
$this->detailsNumber = $detailsNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get details number
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getDetailsNumber()
|
||||
{
|
||||
return (int)$this->detailsNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set ip
|
||||
*
|
||||
* @param string $ip
|
||||
*/
|
||||
public function setIp($ip)
|
||||
{
|
||||
$this->ip = $ip;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ip
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getIp()
|
||||
{
|
||||
return $this->ip;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set log data
|
||||
*
|
||||
* @param string $logData
|
||||
*/
|
||||
public function setLogData($logData)
|
||||
{
|
||||
$this->logData = $logData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get log data
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getLogData()
|
||||
{
|
||||
if ($this->logData === '') {
|
||||
return [];
|
||||
}
|
||||
$logData = @unserialize($this->logData);
|
||||
if (!is_array($logData)) {
|
||||
$logData = [];
|
||||
}
|
||||
return $logData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set event pid
|
||||
*
|
||||
* @param int $eventPid
|
||||
*/
|
||||
public function setEventPid($eventPid)
|
||||
{
|
||||
$this->eventPid = $eventPid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get event pid
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getEventPid()
|
||||
{
|
||||
return (int)$this->eventPid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set workspace uid
|
||||
*
|
||||
* @param int $workspaceUid
|
||||
*/
|
||||
public function setWorkspaceUid($workspaceUid)
|
||||
{
|
||||
$this->workspaceUid = $workspaceUid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get workspace
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getWorkspaceUid()
|
||||
{
|
||||
return (int)$this->workspaceUid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set new id
|
||||
*
|
||||
* @param string $newId
|
||||
*/
|
||||
public function setNewId($newId)
|
||||
{
|
||||
$this->newId = $newId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get new id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNewId()
|
||||
{
|
||||
return $this->newId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Belog\Domain\Model;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
/**
|
||||
* Stub model for workspaces - only properties required for belog module are added currently
|
||||
*
|
||||
* @todo : This should be extended and put at some more central place
|
||||
* @internal This class is a TYPO3 Backend implementation and is not considered part of the Public TYPO3 API.
|
||||
*/
|
||||
class Workspace extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
const UID_LIVE_WORKSPACE = 0;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
const UID_ANY_WORKSPACE = -99;
|
||||
|
||||
/**
|
||||
* title of the workspace
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $title = '';
|
||||
|
||||
/**
|
||||
* Set workspace title
|
||||
*
|
||||
* @param string $title
|
||||
*/
|
||||
public function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get workspace title
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Belog\Domain\Repository;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
use TYPO3\CMS\Belog\Domain\Model\LogEntry;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Type\Bitmask\Permission;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* Sys log entry repository
|
||||
* @internal This class is a TYPO3 Backend implementation and is not considered part of the Public TYPO3 API.
|
||||
*/
|
||||
class LogEntryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
|
||||
{
|
||||
/**
|
||||
* Backend users, with UID as key
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $beUserList = [];
|
||||
|
||||
/**
|
||||
* Initialize some local variables to be used during creation of objects
|
||||
*/
|
||||
public function initializeObject()
|
||||
{
|
||||
$this->beUserList = $this->getBackendUsers();
|
||||
/** @var \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface $defaultQuerySettings */
|
||||
$defaultQuerySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface::class);
|
||||
$defaultQuerySettings->setRespectStoragePage(false);
|
||||
$this->setDefaultQuerySettings($defaultQuerySettings);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds all log entries that match all given constraints.
|
||||
*
|
||||
* @param \TYPO3\CMS\Belog\Domain\Model\Constraint $constraint
|
||||
* @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface<\TYPO3\CMS\Belog\Domain\Model\LogEntry>
|
||||
*/
|
||||
public function findByConstraint(\TYPO3\CMS\Belog\Domain\Model\Constraint $constraint)
|
||||
{
|
||||
$query = $this->createQuery();
|
||||
$queryConstraints = $this->createQueryConstraints($query, $constraint);
|
||||
if (!empty($queryConstraints)) {
|
||||
$query->matching($query->logicalAnd($queryConstraints));
|
||||
}
|
||||
$query->setOrderings(['uid' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING]);
|
||||
$query->setLimit($constraint->getNumber());
|
||||
return $query->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an array of query constraints from constraint object
|
||||
*
|
||||
* @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
|
||||
* @param \TYPO3\CMS\Belog\Domain\Model\Constraint $constraint
|
||||
* @return array<\TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface>
|
||||
*/
|
||||
protected function createQueryConstraints(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query, \TYPO3\CMS\Belog\Domain\Model\Constraint $constraint)
|
||||
{
|
||||
$queryConstraints = [];
|
||||
// User / group handling
|
||||
$this->addUsersAndGroupsToQueryConstraints($constraint, $query, $queryConstraints);
|
||||
// Workspace
|
||||
if ($constraint->getWorkspaceUid() != \TYPO3\CMS\Belog\Domain\Model\Workspace::UID_ANY_WORKSPACE) {
|
||||
$queryConstraints[] = $query->equals('workspace', $constraint->getWorkspaceUid());
|
||||
}
|
||||
// Action (type):
|
||||
if ($constraint->getAction() > 0) {
|
||||
$queryConstraints[] = $query->equals('type', $constraint->getAction());
|
||||
} elseif ($constraint->getAction() == -1) {
|
||||
$queryConstraints[] = $query->equals('type', 5);
|
||||
}
|
||||
// Start / endtime handling: The timestamp calculation was already done
|
||||
// in the controller, since we need those calculated values in the view as well.
|
||||
$queryConstraints[] = $query->greaterThanOrEqual('tstamp', $constraint->getStartTimestamp());
|
||||
$queryConstraints[] = $query->lessThan('tstamp', $constraint->getEndTimestamp());
|
||||
// Page and level constraint if in page context
|
||||
$this->addPageTreeConstraintsToQuery($constraint, $query, $queryConstraints);
|
||||
return $queryConstraints;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds constraints for the page(s) to the query; this could be one single page or a whole subtree beneath a given
|
||||
* page.
|
||||
*
|
||||
* @param \TYPO3\CMS\Belog\Domain\Model\Constraint $constraint
|
||||
* @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
|
||||
* @param array &$queryConstraints the query constraints to add to, will be modified
|
||||
*/
|
||||
protected function addPageTreeConstraintsToQuery(\TYPO3\CMS\Belog\Domain\Model\Constraint $constraint, \TYPO3\CMS\Extbase\Persistence\QueryInterface $query, array &$queryConstraints)
|
||||
{
|
||||
$pageIds = [];
|
||||
// Check if we should get a whole tree of pages and not only a single page
|
||||
if ($constraint->getDepth() > 0) {
|
||||
/** @var \TYPO3\CMS\Backend\Tree\View\PageTreeView $pageTree */
|
||||
$pageTree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Tree\View\PageTreeView::class);
|
||||
$pageTree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(Permission::PAGE_SHOW));
|
||||
$pageTree->makeHTML = 0;
|
||||
$pageTree->fieldArray = ['uid'];
|
||||
$pageTree->getTree($constraint->getPageId(), $constraint->getDepth());
|
||||
$pageIds = $pageTree->ids;
|
||||
}
|
||||
if (!empty($constraint->getPageId())) {
|
||||
$pageIds[] = $constraint->getPageId();
|
||||
}
|
||||
if (!empty($pageIds)) {
|
||||
$queryConstraints[] = $query->in('eventPid', $pageIds);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds users and groups to the query constraints.
|
||||
*
|
||||
* @param \TYPO3\CMS\Belog\Domain\Model\Constraint $constraint
|
||||
* @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
|
||||
* @param array &$queryConstraints the query constraints to add to, will be modified
|
||||
*/
|
||||
protected function addUsersAndGroupsToQueryConstraints(\TYPO3\CMS\Belog\Domain\Model\Constraint $constraint, \TYPO3\CMS\Extbase\Persistence\QueryInterface $query, array &$queryConstraints)
|
||||
{
|
||||
$userOrGroup = $constraint->getUserOrGroup();
|
||||
if ($userOrGroup === '') {
|
||||
return;
|
||||
}
|
||||
// Constraint for a group
|
||||
if (strpos($userOrGroup, 'gr-') === 0) {
|
||||
$groupId = (int)substr($userOrGroup, 3);
|
||||
$userIds = [];
|
||||
foreach ($this->beUserList as $userId => $userData) {
|
||||
if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($userData['usergroup_cached_list'], $groupId)) {
|
||||
$userIds[] = $userId;
|
||||
}
|
||||
}
|
||||
if (!empty($userIds)) {
|
||||
$queryConstraints[] = $query->in('userid', $userIds);
|
||||
} else {
|
||||
// If there are no group members -> use -1 as constraint to not find anything
|
||||
$queryConstraints[] = $query->in('userid', [-1]);
|
||||
}
|
||||
} elseif (strpos($userOrGroup, 'us-') === 0) {
|
||||
$queryConstraints[] = $query->equals('userid', (int)substr($userOrGroup, 3));
|
||||
} elseif ($userOrGroup === '-1') {
|
||||
$queryConstraints[] = $query->equals('userid', (int)$GLOBALS['BE_USER']->user['uid']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all messages which have the same message details
|
||||
*
|
||||
* @param LogEntry $logEntry
|
||||
* @return int
|
||||
*/
|
||||
public function deleteByMessageDetails(LogEntry $logEntry): int
|
||||
{
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
->getQueryBuilderForTable('sys_log');
|
||||
$constraints = [];
|
||||
$constraints[] = $queryBuilder->expr()->eq('details', $queryBuilder->createNamedParameter($logEntry->getDetails()));
|
||||
// If the detailsNo is 11 or 12 we got messages that are heavily using placeholders. In this case
|
||||
// we need to compare both the message and the actual log data to not remove too many log entries.
|
||||
if (GeneralUtility::inList('11,12', $logEntry->getDetailsNumber())) {
|
||||
$constraints[] = $queryBuilder->expr()->eq('log_data', $queryBuilder->createNamedParameter($logEntry->getLogData()));
|
||||
}
|
||||
return $queryBuilder->delete('sys_log')
|
||||
->where(...$constraints)
|
||||
->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of all backend users that are not deleted
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getBackendUsers()
|
||||
{
|
||||
return \TYPO3\CMS\Backend\Utility\BackendUtility::getUserNames();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Belog\Domain\Repository;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
/**
|
||||
* Repository for workspaces
|
||||
* @todo This should be moved to EXT:workspaces if EXT:belog works no matter if workspaces are installed or not
|
||||
* @internal This class is a TYPO3 Backend implementation and is not considered part of the Public TYPO3 API.
|
||||
*/
|
||||
class WorkspaceRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
|
||||
{
|
||||
/**
|
||||
* Initializes the repository.
|
||||
*/
|
||||
public function initializeObject()
|
||||
{
|
||||
/** @var \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface $querySettings */
|
||||
$querySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface::class);
|
||||
$querySettings->setRespectStoragePage(false);
|
||||
$this->setDefaultQuerySettings($querySettings);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Belog\Module;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Core\Bootstrap;
|
||||
|
||||
/**
|
||||
* This class is a wrapper for WebInfo controller of belog.
|
||||
* It is registered in ext_tables.php with \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction()
|
||||
* and called by the info extension via SCbase functionality.
|
||||
*
|
||||
* Extbase currently provides no way to register a "TBE_MODULES_EXT" module directly,
|
||||
* therefore we need to bootstrap extbase on our own here to jump to the WebInfo controller.
|
||||
* @internal This class is a experimental and is not considered part of the Public TYPO3 API.
|
||||
*/
|
||||
class BackendLogModuleBootstrap
|
||||
{
|
||||
/**
|
||||
* Bootstrap extbase and jump to WebInfo controller
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function main()
|
||||
{
|
||||
$_GET['tx_belog_system_beloglog']['pageId'] = GeneralUtility::_GP('id');
|
||||
$_GET['tx_belog_system_beloglog']['layout'] = 'Plain';
|
||||
$serverRequest = $GLOBALS['TYPO3_REQUEST'] ?? null;
|
||||
if ($serverRequest instanceof ServerRequestInterface) {
|
||||
$GLOBALS['TYPO3_REQUEST'] = $serverRequest->withQueryParams($_GET);
|
||||
}
|
||||
$options['moduleConfiguration'] = [
|
||||
'extensionName' => 'Belog',
|
||||
'vendorName' => 'TYPO3\\CMS',
|
||||
];
|
||||
$options['moduleName'] = 'system_BelogLog';
|
||||
|
||||
$route = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\Route::class, '/system/BelogLog/', $options);
|
||||
$serverRequest = $serverRequest->withAttribute('route', $route);
|
||||
$extbaseBootstrap = GeneralUtility::makeInstance(Bootstrap::class);
|
||||
return $extbaseBootstrap->handleBackendRequest($serverRequest);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Belog\ViewHelpers\Be;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Backend\Utility\BackendUtility;
|
||||
use TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
|
||||
/**
|
||||
* Get page path string from page id
|
||||
* @internal
|
||||
*/
|
||||
class PagePathViewHelper extends AbstractBackendViewHelper
|
||||
{
|
||||
/**
|
||||
* Initializes the arguments
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
$this->registerArgument('pid', 'int', 'Pid of the page', true);
|
||||
$this->registerArgument('titleLimit', 'int', 'Limit of the page title', false, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve page id to page path string (with automatic cropping to maximum given length).
|
||||
*
|
||||
* @return string Page path string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return static::renderStatic(
|
||||
$this->arguments,
|
||||
$this->buildRenderChildrenClosure(),
|
||||
$this->renderingContext
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
|
||||
{
|
||||
return BackendUtility::getRecordPath($arguments['pid'], '', $arguments['titleLimit']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Belog\ViewHelpers\Form;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
/**
|
||||
* Extends the usual select ViewHelper, but additionally translates
|
||||
* the select option labels
|
||||
*
|
||||
* Example:
|
||||
* <belog:form.translateLabelSelect property="number" options="{settings.selectableNumberOfLogEntries}" optionLabelPrefix="numbers"
|
||||
*
|
||||
* Will lookup number.200 (or whatever optionValue is given) in locallang database
|
||||
* @internal
|
||||
*/
|
||||
class TranslateLabelSelectViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\SelectViewHelper
|
||||
{
|
||||
/**
|
||||
* Initialize arguments.
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
$this->registerArgument('optionLabelPrefix', 'string', 'Prefix for locallang lookup');
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the option tags.
|
||||
*
|
||||
* Extend the default handling by iterating over calculated options array and
|
||||
* try to translate the value
|
||||
*
|
||||
* @return array An associative array of options, key will be the value of the option tag
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
$options = parent::getOptions();
|
||||
foreach ($options as $value => $label) {
|
||||
$options[$value] = $this->translateLabel($label);
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the translation for a given label. If no translation is found, the label is returned unchanged.
|
||||
*
|
||||
* @param string $label The label to translate
|
||||
* @return string
|
||||
*/
|
||||
protected function translateLabel($label)
|
||||
{
|
||||
if ($label === '') {
|
||||
return '';
|
||||
}
|
||||
$labelKey = $this->hasArgument('optionLabelPrefix') ? $this->arguments['optionLabelPrefix'] . $label : $label;
|
||||
$translatedLabel = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($labelKey, $this->renderingContext->getControllerContext()->getRequest()->getControllerExtensionName());
|
||||
return $translatedLabel ?: $label;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Belog\ViewHelpers;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Belog\Domain\Model\LogEntry;
|
||||
use TYPO3\CMS\Core\Utility\PathUtility;
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* Create detail string from log entry
|
||||
* @internal
|
||||
*/
|
||||
class FormatDetailsViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* Initializes the arguments
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
$this->registerArgument('logEntry', LogEntry::class, '', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create formatted detail string from log row.
|
||||
*
|
||||
* The method handles two properties of the model: details and logData
|
||||
* Details is a string with possible %s placeholders, and logData an array
|
||||
* with the substitutions.
|
||||
* Furthermore, possible files in logData are stripped to their basename if
|
||||
* the action logged was a file action
|
||||
*
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
*
|
||||
* @return string Formatted details
|
||||
*/
|
||||
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
|
||||
{
|
||||
/** @var LogEntry $logEntry */
|
||||
$logEntry = $arguments['logEntry'];
|
||||
$detailString = $logEntry->getDetails();
|
||||
$substitutes = $logEntry->getLogData();
|
||||
// Strip paths from file names if the log was a file action
|
||||
if ($logEntry->getType() === 2) {
|
||||
$substitutes = self::stripPathFromFilenames($substitutes);
|
||||
}
|
||||
// Substitute
|
||||
if (!empty($substitutes)) {
|
||||
$detailString = vsprintf($detailString, $substitutes);
|
||||
}
|
||||
// Remove possible pending other %s
|
||||
$detailString = str_replace('%s', '', $detailString);
|
||||
return $detailString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Strips path from array of file names
|
||||
*
|
||||
* @param array $files
|
||||
* @return array
|
||||
*/
|
||||
protected static function stripPathFromFilenames(array $files = [])
|
||||
{
|
||||
foreach ($files as $key => $file) {
|
||||
$files[$key] = PathUtility::basename($file);
|
||||
}
|
||||
return $files;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Belog\ViewHelpers;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Domain\Repository\BackendUserRepository;
|
||||
use TYPO3\CMS\Extbase\Object\ObjectManager;
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* Get username from backend user id
|
||||
* @internal
|
||||
*/
|
||||
class UsernameViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* First level cache of user names
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static $usernameRuntimeCache = [];
|
||||
|
||||
/**
|
||||
* Initializes the arguments
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
$this->registerArgument('uid', 'int', 'Uid of the user', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve user name from backend user id.
|
||||
*
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
*
|
||||
* @return string Username or an empty string if there is no user with that UID
|
||||
*/
|
||||
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
|
||||
{
|
||||
$uid = $arguments['uid'];
|
||||
if (isset(static::$usernameRuntimeCache[$uid])) {
|
||||
return static::$usernameRuntimeCache[$uid];
|
||||
}
|
||||
|
||||
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
|
||||
$backendUserRepository = $objectManager->get(BackendUserRepository::class);
|
||||
/** @var \TYPO3\CMS\Extbase\Domain\Model\BackendUser $user */
|
||||
$user = $backendUserRepository->findByUid($uid);
|
||||
// $user may be NULL if user was deleted from DB, set it to empty string to always return a string
|
||||
static::$usernameRuntimeCache[$uid] = $user === null ? '' : $user->getUserName();
|
||||
return static::$usernameRuntimeCache[$uid];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Belog\ViewHelpers;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Belog\Domain\Repository\WorkspaceRepository;
|
||||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Object\ObjectManager;
|
||||
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
|
||||
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* Get workspace title from workspace id
|
||||
* @internal
|
||||
*/
|
||||
class WorkspaceTitleViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* First level cache of workspace titles
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static $workspaceTitleRuntimeCache = [];
|
||||
|
||||
/**
|
||||
* Initializes the arguments
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
$this->registerArgument('uid', 'int', 'UID of the workspace', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve workspace title from UID.
|
||||
*
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
*
|
||||
* @return string workspace title or UID
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
|
||||
{
|
||||
if (!$renderingContext instanceof RenderingContext) {
|
||||
throw new \InvalidArgumentException('The given rendering context is not of type "TYPO3\CMS\Fluid\Core\Rendering\RenderingContext"', 1468363946);
|
||||
}
|
||||
|
||||
$uid = $arguments['uid'];
|
||||
if (isset(static::$workspaceTitleRuntimeCache[$uid])) {
|
||||
return static::$workspaceTitleRuntimeCache[$uid];
|
||||
}
|
||||
|
||||
if ($uid === 0) {
|
||||
static::$workspaceTitleRuntimeCache[$uid] = LocalizationUtility::translate(
|
||||
'live',
|
||||
$renderingContext->getControllerContext()->getRequest()->getControllerExtensionName()
|
||||
);
|
||||
} elseif (!ExtensionManagementUtility::isLoaded('workspaces')) {
|
||||
static::$workspaceTitleRuntimeCache[$uid] = '';
|
||||
} else {
|
||||
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
|
||||
$workspaceRepository = $objectManager->get(WorkspaceRepository::class);
|
||||
/** @var \TYPO3\CMS\Belog\Domain\Model\Workspace $workspace */
|
||||
$workspace = $workspaceRepository->findByUid($uid);
|
||||
// $workspace may be null, force empty string in this case
|
||||
static::$workspaceTitleRuntimeCache[$uid] = $workspace === null ? '' : $workspace->getTitle();
|
||||
}
|
||||
|
||||
return static::$workspaceTitleRuntimeCache[$uid];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
module.tx_belog {
|
||||
persistence.classes {
|
||||
TYPO3\CMS\Belog\Domain\Model\LogEntry {
|
||||
mapping {
|
||||
tableName = sys_log
|
||||
columns {
|
||||
userid.mapOnProperty = backendUserUid
|
||||
recuid.mapOnProperty = recordUid
|
||||
tablename.mapOnProperty = tableName
|
||||
recpid.mapOnProperty = recordPid
|
||||
details_nr.mapOnProperty = detailsNumber
|
||||
IP.mapOnProperty = ip
|
||||
workspace.mapOnProperty = workspaceUid
|
||||
NEWid.mapOnProperty = newId
|
||||
}
|
||||
}
|
||||
}
|
||||
TYPO3\CMS\Belog\Domain\Model\Workspace {
|
||||
mapping {
|
||||
tableName = sys_workspace
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
settings {
|
||||
selectableNumberOfLogEntries {
|
||||
20 = 20
|
||||
50 = 50
|
||||
100 = 100
|
||||
200 = 200
|
||||
500 = 500
|
||||
1000 = 1000
|
||||
1000000 = any
|
||||
}
|
||||
|
||||
selectableTimeFrames {
|
||||
0 = thisWeek
|
||||
1 = lastWeek
|
||||
2 = last7Days
|
||||
10 = thisMonth
|
||||
11 = lastMonth
|
||||
12 = last31Days
|
||||
20 = noLimit
|
||||
30 = userDefined
|
||||
}
|
||||
|
||||
selectableActions {
|
||||
0 = any
|
||||
1 = actionDatabase
|
||||
2 = actionFile
|
||||
3 = actionCache
|
||||
254 = actionSettings
|
||||
255 = actionLogin
|
||||
-1 = actionErrors
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,345 @@
|
||||
Some icons used in the TYPO3 project are retrieved from the "Silk" icon set of
|
||||
Mark James, which can be found at http://famfamfam.com/lab/icons/silk/. This
|
||||
set is distributed under a Creative Commons Attribution 2.5 License. The
|
||||
license can be found at http://creativecommons.org/licenses/by/2.5/.
|
||||
---------------------------------
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
@@ -0,0 +1,389 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
|
||||
<file t3:id="1415814781" source-language="en" datatype="plaintext" original="EXT:belog/Resources/Private/Language/locallang.xlf" date="2011-10-17T20:22:32Z" product-name="belog">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="adminLog" resname="adminLog">
|
||||
<source>Administration log</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="allUsers" resname="allUsers">
|
||||
<source>[All users]</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="any" resname="any">
|
||||
<source>[Any]</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="viaUser" resname="viaUser">
|
||||
<source>via</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="live" resname="live">
|
||||
<source>LIVE</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="draft" resname="draft">
|
||||
<source>Draft</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="self" resname="self">
|
||||
<source>Self</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="userGroup" resname="userGroup">
|
||||
<source>Group</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="thisWeek" resname="thisWeek">
|
||||
<source>This week</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="lastWeek" resname="lastWeek">
|
||||
<source>Last week</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="last7Days" resname="last7Days">
|
||||
<source>Last 7 days</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="thisMonth" resname="thisMonth">
|
||||
<source>This month</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="lastMonth" resname="lastMonth">
|
||||
<source>Last month</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="last31Days" resname="last31Days">
|
||||
<source>Last 31 days</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="noLimit" resname="noLimit">
|
||||
<source>No limit</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="userDefined" resname="userDefined">
|
||||
<source>User defined</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="set" resname="set">
|
||||
<source>Set</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="20" resname="20" translate="no">
|
||||
<source>20</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="50" resname="50" translate="no">
|
||||
<source>50</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="100" resname="100" translate="no">
|
||||
<source>100</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="200" resname="200" translate="no">
|
||||
<source>200</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="500" resname="500" translate="no">
|
||||
<source>500</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="1000" resname="1000" translate="no">
|
||||
<source>1000</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="actionAll" resname="actionAll">
|
||||
<source>All</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="actionDatabase" resname="actionDatabase">
|
||||
<source>Database</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="actionFile" resname="actionFile">
|
||||
<source>File</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="actionCache" resname="actionCache">
|
||||
<source>Cache</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="actionSettings" resname="actionSettings">
|
||||
<source>Settings</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="actionLogin" resname="actionLogin">
|
||||
<source>Login</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="actionErrors" resname="actionErrors">
|
||||
<source>Errors</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="group" resname="group">
|
||||
<source>Group</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="user" resname="user">
|
||||
<source>User</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="users" resname="users">
|
||||
<source>Users</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="time" resname="time">
|
||||
<source>Time</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="max" resname="max">
|
||||
<source>Max</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="changesInFields" resname="changesInFields">
|
||||
<source>Changes in fields: %s.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="showHistory" resname="showHistory">
|
||||
<source>Show History</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action" resname="action">
|
||||
<source>Action</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="workspace" resname="workspace">
|
||||
<source>Workspace</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="groupByPage" resname="groupByPage">
|
||||
<source>Group by page</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="pagenameWithUID" resname="pagenameWithUID">
|
||||
<source>%s" [UID: %s]</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="overview" resname="overview">
|
||||
<source>Overview</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="timeInfo" resname="timeInfo">
|
||||
<source>These pages have log messages from %s to %s</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="forNonPageRelatedActions" resname="forNonPageRelatedActions">
|
||||
<source>for NON-PAGE related actions</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="forRootLevel" resname="forRootLevel">
|
||||
<source>for ROOT LEVEL</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="forPage" resname="forPage">
|
||||
<source>for PAGE "%s" (UID: %s)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="logForNonPageRelatedActionsOrRootLevelOrPage" resname="logForNonPageRelatedActionsOrRootLevelOrPage">
|
||||
<source>Log %s from %s to %s</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="type_1" resname="type_1">
|
||||
<source>DB</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_1_1" resname="action_1_1">
|
||||
<source>Insert</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_1_2" resname="action_1_2">
|
||||
<source>Update</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_1_3" resname="action_1_3">
|
||||
<source>Delete</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_1_4" resname="action_1_4">
|
||||
<source>Move</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_1_5" resname="action_1_5">
|
||||
<source>Check</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_0_1" resname="msg_1_0_1">
|
||||
<source>Referer host '%s' and server host '%s' did not match!</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_1_11" resname="msg_1_1_11">
|
||||
<source>Attempt to insert record on page '%s' (%s) where this table, %s, is not allowed</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_1_12" resname="msg_1_1_12">
|
||||
<source>Attempt to insert a record on page '%s' (%s) from table '%s' without permissions. Or non-existing page.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_2_1" resname="msg_1_2_1">
|
||||
<source>Attempt to modify table '%s' without permission</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_2_2" resname="msg_1_2_2">
|
||||
<source>Attempt to modify record '%s' (%s) without permission. Or non-existing page.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_2_10" resname="msg_1_2_10">
|
||||
<source>Record '%s' (%s) was updated.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_2_12" resname="msg_1_2_12">
|
||||
<source>MySQL error: '%s' (%s)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_4_1" resname="msg_1_4_1">
|
||||
<source>Attempt to move record '%s' (%s) to after a non-existing record (uid=%s)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_4_2" resname="msg_1_4_2">
|
||||
<source>Moved record '%s' (%s) to page '%s' (%s)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_4_3" resname="msg_1_4_3">
|
||||
<source>Moved record '%s' (%s) from page '%s' (%s)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_4_4" resname="msg_1_4_4">
|
||||
<source>Moved record '%s' (%s) on page '%s' (%s)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_4_10" resname="msg_1_4_10">
|
||||
<source>Attempt to move page '%s' (%s) to inside of its own rootline (at page '%s' (%s))</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_4_11" resname="msg_1_4_11">
|
||||
<source>Attempt to insert record on page '%s' (%s) where this table, %s, is not allowed</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_4_12" resname="msg_1_4_12">
|
||||
<source>Attempt to insert a record on page '%s' (%s) from table '%s' without permissions. Or non-existing page.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_4_13" resname="msg_1_4_13">
|
||||
<source>Attempt to move record '%s' (%s) to after another record, although the table has no sorting row.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_4_14" resname="msg_1_4_14">
|
||||
<source>Attempt to move record '%s' (%s) without having permissions to do so</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_5_1" resname="msg_1_5_1">
|
||||
<source>You cannot change the 'doktype' of page '%s' to the desired value.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_5_2" resname="msg_1_5_2">
|
||||
<source>'doktype' of page '%s' could not be changed because the page contains records from disallowed tables; %s</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_5_3" resname="msg_1_5_3">
|
||||
<source>Too few items in the list of values. (%s)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_5_10" resname="msg_1_5_10">
|
||||
<source>Could not delete file '%s' (does not exist). (%s)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_5_11" resname="msg_1_5_11">
|
||||
<source>Copying file '%s' failed!: No destination file (%s) possible!. (%s)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_5_12" resname="msg_1_5_12">
|
||||
<source>File extension '%s' is not allowed. (%s)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_5_13" resname="msg_1_5_13">
|
||||
<source>File size (%s) of file '%s' exceeds limit (%s). (%s)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_5_14" resname="msg_1_5_14">
|
||||
<source>The destination (%s) or the source file (%s) does not exist. (%s)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_5_15" resname="msg_1_5_15">
|
||||
<source>Copying to file '%s' failed! (%s)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_1_5_16" resname="msg_1_5_16">
|
||||
<source>Copying file '%s' failed!: The destination path (%s) may be write protected. Please make it write enabled!. (%s)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="type_2" resname="type_2">
|
||||
<source>FILE</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_2_1" resname="action_2_1">
|
||||
<source>Upload</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_2_2" resname="action_2_2">
|
||||
<source>Copy</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_2_3" resname="action_2_3">
|
||||
<source>Move</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_2_4" resname="action_2_4">
|
||||
<source>Delete</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_2_5" resname="action_2_5">
|
||||
<source>Rename</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_2_6" resname="action_2_6">
|
||||
<source>New</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_2_7" resname="action_2_7">
|
||||
<source>Unzip</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_2_8" resname="action_2_8">
|
||||
<source>New file</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_2_9" resname="action_2_9">
|
||||
<source>Edit</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="msg_2_9_1" resname="msg_2_9_1">
|
||||
<source>File saved to '%s', bytes: %s, MD5: %s </source>
|
||||
</trans-unit>
|
||||
<trans-unit id="type_3" resname="type_3">
|
||||
<source>CACHE</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_3_1" resname="action_3_1">
|
||||
<source>Clear Cache</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="type_4" resname="type_4">
|
||||
<source>EXTENSION</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="type_5" resname="type_5">
|
||||
<source>ERROR</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_5_0" resname="action_5_0">
|
||||
<source>Error handler</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="type_254" resname="type_254">
|
||||
<source>SETTING</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_254_1" resname="action_254_1">
|
||||
<source>Change</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="type_255" resname="type_255">
|
||||
<source>LOGIN</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_255_1" resname="action_255_1">
|
||||
<source>LOGIN</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_255_2" resname="action_255_2">
|
||||
<source>LOGOUT</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="action_255_3" resname="action_255_3">
|
||||
<source>ATTEMPT</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_title" resname="chLog_title">
|
||||
<source>Admin Changelog</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_users_0" resname="chLog_users_0">
|
||||
<source>All users</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_users_-1" resname="chLog_users_-1">
|
||||
<source>Self</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_time_0" resname="chLog_time_0">
|
||||
<source>This week</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_time_1" resname="chLog_time_1">
|
||||
<source>Last week</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_time_2" resname="chLog_time_2">
|
||||
<source>Last 7 days</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_time_10" resname="chLog_time_10">
|
||||
<source>This month</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_time_11" resname="chLog_time_11">
|
||||
<source>Last month</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_time_12" resname="chLog_time_12">
|
||||
<source>Last 31 days</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_time_20" resname="chLog_time_20">
|
||||
<source>No limit</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_l_time" resname="chLog_l_time">
|
||||
<source>Time</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_l_user" resname="chLog_l_user">
|
||||
<source>User</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_l_error" resname="chLog_l_error">
|
||||
<source>E</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_l_action" resname="chLog_l_action">
|
||||
<source>Action</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_l_types" resname="chLog_l_types">
|
||||
<source>Type</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_l_table" resname="chLog_l_table">
|
||||
<source>Table</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_l_details" resname="chLog_l_details">
|
||||
<source>Details</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_menuUsers" resname="chLog_menuUsers">
|
||||
<source>Users</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_menuDepth" resname="chLog_menuDepth">
|
||||
<source>Depth</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="chLog_menuTime" resname="chLog_menuTime">
|
||||
<source>Time</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="systemmessage.errorsInPeriod" resname="systemmessage.errorsInPeriod">
|
||||
<source><![CDATA[We have found %1$d errors. Please check your <a href="%2$s">system log</a>.]]></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="actions" resname="actions">
|
||||
<source>Actions</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="actions.delete" resname="actions.delete">
|
||||
<source>Delete similar errors</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="actions.deleteWarnings" resname="actions.deleteWarnings">
|
||||
<source>Delete similar warnings</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="actions.delete.message" resname="actions.delete.message">
|
||||
<source>Total entries deleted: %1$d</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="actions.delete.noRowFound" resname="actions.delete.noRowFound">
|
||||
<source>Log entry could not be found.</source>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
|
||||
<file t3:id="1415814782" source-language="en" datatype="plaintext" original="EXT:belog/Resources/Private/Language/locallang_mod.xlf" date="2011-10-17T20:22:32Z" product-name="belog">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="mlang_labels_tablabel" resname="mlang_labels_tablabel">
|
||||
<source>Viewing log</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="mlang_labels_tabdescr" resname="mlang_labels_tabdescr">
|
||||
<source>Allows you access to the full backend changelog in TYPO3.<br /><em>Access for 'admin' users only!</em></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="mlang_tabs_tab" resname="mlang_tabs_tab">
|
||||
<source>Log</source>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -0,0 +1,10 @@
|
||||
<html
|
||||
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
|
||||
xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"
|
||||
data-namespace-typo3-fluid="true">
|
||||
|
||||
<be:moduleLayout>
|
||||
<f:render section="Content" />
|
||||
</be:moduleLayout>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<html
|
||||
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
|
||||
data-namespace-typo3-fluid="true">
|
||||
|
||||
<f:variable name="isSubmoduleLayout" value="true"/>
|
||||
<f:render section="Content"/>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,161 @@
|
||||
<html
|
||||
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
|
||||
xmlns:belog="http://typo3.org/ns/TYPO3/CMS/Belog/ViewHelpers"
|
||||
data-namespace-typo3-fluid="true">
|
||||
|
||||
<f:comment>
|
||||
This is an ugly workaround.
|
||||
The function module in Web->Info already renders a form tag, and there is
|
||||
no easy way to circumvent this. The page id is needed for the info module
|
||||
that is not extbase based to figure the permissions. Thus, we have to add
|
||||
the page Id manually to hint the info module about that.
|
||||
</f:comment>
|
||||
<f:if condition="{isSubmoduleLayout}">
|
||||
<input type="hidden" name="id" value="{constraint.pageId}" />
|
||||
</f:if>
|
||||
|
||||
<f:form object="{constraint}" action="list" name="constraint" class="form-inline form-inline-spaced">
|
||||
<div class="form-group">
|
||||
<label for="belog-users"><f:translate key="users" /></label>
|
||||
<f:form.select
|
||||
property="userOrGroup"
|
||||
options="{userGroups}"
|
||||
additionalAttributes="{onchange : 'submit()'}"
|
||||
class="form-control input-sm"
|
||||
id="belog-users"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="belog-max"><f:translate key="max" /></label>
|
||||
<belog:form.translateLabelSelect
|
||||
property="number"
|
||||
options="{settings.selectableNumberOfLogEntries}"
|
||||
optionLabelPrefix="LLL:EXT:belog/Resources/Private/Language/locallang.xlf:"
|
||||
additionalAttributes="{onchange : 'submit()'}"
|
||||
class="form-control input-sm"
|
||||
id="belog-max"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<f:if condition="{workspacesExtensionLoaded}">
|
||||
<f:if condition="{showWorkspaceSelector}">
|
||||
<div class="form-group">
|
||||
<label for="belog-workspaces"><f:translate key="workspace" /></label>
|
||||
<f:form.select
|
||||
property="workspaceUid"
|
||||
options="{workspaces}"
|
||||
additionalAttributes="{onchange : 'submit()'}"
|
||||
class="form-control input-sm"
|
||||
id="belog-workspaces"
|
||||
/>
|
||||
</div>
|
||||
</f:if>
|
||||
</f:if>
|
||||
|
||||
<f:if condition="{isSubmoduleLayout}">
|
||||
<div class="form-group">
|
||||
<label for="belog-depth"><f:translate key="chLog_menuDepth" /></label>
|
||||
<f:form.select
|
||||
property="depth"
|
||||
options="{pageDepths}"
|
||||
additionalAttributes="{onchange : 'submit()'}"
|
||||
class="form-control input-sm"
|
||||
id="belog-depth"
|
||||
/>
|
||||
</div>
|
||||
</f:if>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="belog-time"><f:translate key="time" /></label>
|
||||
<belog:form.translateLabelSelect
|
||||
property="timeFrame"
|
||||
options="{settings.selectableTimeFrames}"
|
||||
optionLabelPrefix="LLL:EXT:belog/Resources/Private/Language/locallang.xlf:"
|
||||
additionalAttributes="{onchange : 'submit()'}"
|
||||
class="form-control input-sm"
|
||||
id="belog-time"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="belog-action"><f:translate key="action" /></label>
|
||||
<belog:form.translateLabelSelect
|
||||
property="action"
|
||||
options="{settings.selectableActions}"
|
||||
optionLabelPrefix="LLL:EXT:belog/Resources/Private/Language/locallang.xlf:"
|
||||
additionalAttributes="{onchange : 'submit()'}"
|
||||
class="form-control input-sm"
|
||||
id="belog-action"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<f:if condition="{constraint.depth} > 0">
|
||||
<div class="form-group">
|
||||
<label for="belog-group"><f:translate key="groupByPage" /></label>
|
||||
<f:form.checkbox
|
||||
property="groupByPage"
|
||||
value="1"
|
||||
additionalAttributes="{onchange : 'submit()'}"
|
||||
id="belog-group"
|
||||
/>
|
||||
</div>
|
||||
</f:if>
|
||||
|
||||
<f:comment>
|
||||
Date time fields for manual date selection
|
||||
</f:comment>
|
||||
|
||||
|
||||
<f:if condition="{constraint.timeFrame} == 30">
|
||||
<f:be.pageRenderer includeRequireJsModules="{0: 'TYPO3/CMS/Backend/DateTimePicker'}" />
|
||||
<div class="form-group">
|
||||
<label for="manualDateStart"><f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:from" /></label>
|
||||
<div class="input-group input-group-sm">
|
||||
<f:form.textfield
|
||||
name="manualDateStart"
|
||||
value="{f:if(condition: constraint.manualDateStart, then: \"{f:format.date(format:'{settings.timeFormat} {settings.dateFormat}', date: '{constraint.manualDateStart}')}\")}"
|
||||
id="manualDateStart"
|
||||
class="form-control input-sm t3js-datetimepicker t3js-clearable"
|
||||
data="{date-type: 'datetime'}"
|
||||
/>
|
||||
<f:form.hidden
|
||||
property="manualDateStart"
|
||||
value="{f:if(condition: constraint.manualDateStart, then: \"{f:format.date(format:'c', date: '{constraint.manualDateStart}')}\")}"
|
||||
/>
|
||||
<span class="input-group-btn">
|
||||
<label class="btn btn-default" for="manualDateStart">
|
||||
<span class="fa fa-calendar"></span>
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="manualDateStop"><f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:to" /></label>
|
||||
<div class="input-group input-group-sm">
|
||||
<f:form.textfield
|
||||
name="manualDateStop"
|
||||
value="{f:format.date(format:'{settings.timeFormat} {settings.dateFormat}', date: '{constraint.manualDateStop}')}"
|
||||
id="manualDateStop"
|
||||
class="form-control input-sm t3js-datetimepicker t3js-clearable"
|
||||
data="{date-type: 'datetime'}"
|
||||
/>
|
||||
<f:form.hidden property="manualDateStop"
|
||||
value="{f:format.date(format:'c', date: '{constraint.manualDateStop}')}"
|
||||
/>
|
||||
<span class="input-group-btn">
|
||||
<label class="btn btn-default" for="manualDateStop">
|
||||
<span class="fa fa-calendar"></span>
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<f:form.submit id="submit-constraint" value="{f:translate(key: 'set')}" class="btn btn-default btn-sm" />
|
||||
</div>
|
||||
</f:if>
|
||||
</f:form>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,241 @@
|
||||
<html
|
||||
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
|
||||
xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers"
|
||||
xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"
|
||||
xmlns:belog="http://typo3.org/ns/TYPO3/CMS/Belog/ViewHelpers"
|
||||
data-namespace-typo3-fluid="true">
|
||||
|
||||
<f:if condition="{constraint.groupByPage}">
|
||||
<div>
|
||||
<h2>
|
||||
<f:translate key="overview" />
|
||||
</h2>
|
||||
<f:translate
|
||||
key="timeInfo"
|
||||
arguments="{
|
||||
0: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.startTimestamp}\')}',
|
||||
1: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.endTimestamp}\')}'
|
||||
}"
|
||||
/>
|
||||
<p>
|
||||
<f:for each="{groupedLogEntries}" as="pidEntry" key="pid">
|
||||
<f:if condition="{pid} > 0">
|
||||
<br />
|
||||
<f:translate
|
||||
key="pagenameWithUID"
|
||||
arguments="{
|
||||
0: '{belog:be.pagePath(pid:\'{pid}\')}',
|
||||
1: '{pid}'
|
||||
}"
|
||||
/>
|
||||
</f:if>
|
||||
</f:for>
|
||||
</p>
|
||||
</div>
|
||||
</f:if>
|
||||
|
||||
<f:for each="{groupedLogEntries}" as="pidEntry" key="pid">
|
||||
<div>
|
||||
<h2>
|
||||
<f:if condition="{constraint.groupByPage}">
|
||||
<f:then>
|
||||
<f:if condition="{pid} < 1">
|
||||
<f:then>
|
||||
<f:if condition="{pid} == -1">
|
||||
<f:translate
|
||||
key="logForNonPageRelatedActionsOrRootLevelOrPage"
|
||||
arguments="{
|
||||
0: '{f:translate(key:\'forNonPageRelatedActions\')}',
|
||||
1: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.startTimestamp}\')}',
|
||||
2: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.endTimestamp}\')}'
|
||||
}"
|
||||
/>
|
||||
</f:if>
|
||||
<f:if condition="{pid} == 0">
|
||||
<f:translate
|
||||
key="logForNonPageRelatedActionsOrRootLevelOrPage"
|
||||
arguments="{
|
||||
0: '{f:translate(key:\'forRootLevel\')}',
|
||||
1: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.startTimestamp}\')}',
|
||||
2: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.endTimestamp}\')}'
|
||||
}"
|
||||
/>
|
||||
</f:if>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:comment>
|
||||
Nest view helpers three times:
|
||||
1. Feed pid as argument to be.pagePath
|
||||
2. Use this as argument for 'forPage' translate
|
||||
3. Use this as argument for 'logForNonPageRelatedActionsOrRootLevelOrPage' translate
|
||||
</f:comment>
|
||||
<f:translate
|
||||
key="logForNonPageRelatedActionsOrRootLevelOrPage"
|
||||
arguments="{
|
||||
0: '{f:translate(
|
||||
key:\'forPage\',
|
||||
arguments:\'{
|
||||
0:\\\'{belog:be.pagePath(pid:\\\\\\\'{pid}\\\\\\\')}\\\',
|
||||
1:\\\'{pid}\\\'
|
||||
}\'
|
||||
)}',
|
||||
1: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.startTimestamp}\')}',
|
||||
2: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.endTimestamp}\')}'
|
||||
}"
|
||||
/>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:translate
|
||||
key="logForNonPageRelatedActionsOrRootLevelOrPage"
|
||||
arguments="{
|
||||
0: '',
|
||||
1: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.startTimestamp}\')}',
|
||||
2: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.endTimestamp}\')}'
|
||||
}"
|
||||
/>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</h2>
|
||||
<f:for each="{pidEntry}" as="day" key="dayTimestamp">
|
||||
<h3>
|
||||
<f:format.date format="{settings.dateFormat}">@{dayTimestamp}</f:format.date>
|
||||
</h3>
|
||||
|
||||
<div class="table-fit">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<f:translate key="chLog_l_error"/>
|
||||
</th>
|
||||
<th>
|
||||
<f:translate key="chLog_l_time"/>
|
||||
</th>
|
||||
<th colspan="2">
|
||||
<f:translate key="chLog_l_user"/>
|
||||
</th>
|
||||
<th>
|
||||
<f:if condition="{isSubmoduleLayout}">
|
||||
<f:then>
|
||||
<f:translate key="chLog_l_table"/>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:translate key="chLog_l_types"/>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</th>
|
||||
<th>
|
||||
<f:translate key="chLog_l_action"/>
|
||||
</th>
|
||||
<th>
|
||||
<f:translate key="chLog_l_details"/>
|
||||
</th>
|
||||
<th>
|
||||
<f:translate key="actions"/>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<f:for each="{day}" as="logItem">
|
||||
<tr>
|
||||
<td>
|
||||
<f:if condition="{logItem.errorIconClass}">
|
||||
<core:icon identifier="{logItem.errorIconClass}" />
|
||||
</f:if>
|
||||
</td>
|
||||
<td>
|
||||
<f:format.date format="H:i:s">@{logItem.tstamp}</f:format.date>
|
||||
</td>
|
||||
<td>
|
||||
<f:if condition="{belog:username(uid:logItem.backendUserUid)}">
|
||||
<be:avatar backendUser="{logItem.backendUserUid}" showIcon="true"/>
|
||||
</f:if>
|
||||
</td>
|
||||
<td>
|
||||
<f:if condition="{belog:username(uid:logItem.backendUserUid)}">
|
||||
<f:then>
|
||||
<belog:username uid="{logItem.backendUserUid}"/>
|
||||
</f:then>
|
||||
<f:else>[{logItem.backendUserUid}]</f:else>
|
||||
</f:if>
|
||||
<f:if condition="{logItem.logData.originalUser}">
|
||||
({f:translate(key:'viaUser')}
|
||||
<f:if condition="{belog:username(uid:logItem.logData.originalUser)}">
|
||||
<f:then>
|
||||
<belog:username uid="{logItem.logData.originalUser}"/>
|
||||
</f:then>
|
||||
<f:else>[{logItem.logData.originalUser}]</f:else>
|
||||
</f:if>
|
||||
)
|
||||
</f:if>
|
||||
<br>
|
||||
<span class="text-muted">
|
||||
<f:if condition="{belog:workspaceTitle(uid:logItem.workspaceUid)}">
|
||||
<f:then><belog:workspaceTitle uid="{logItem.workspaceUid}"/></f:then>
|
||||
<f:else>[{logItem.workspaceUid}]</f:else>
|
||||
</f:if>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<f:if condition="{isSubmoduleLayout}">
|
||||
<f:then>
|
||||
{logItem.tableName}
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:if condition="{f:translate(key:'type_{logItem.type}')}">
|
||||
<f:then>
|
||||
<f:translate key="type_{logItem.type}"/>
|
||||
</f:then>
|
||||
<f:else>
|
||||
[{logItem.type}]
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</td>
|
||||
<td>
|
||||
<f:if condition="{f:translate(key:'action_{logItem.type}_{logItem.action}')}">
|
||||
<f:then>
|
||||
<f:translate key="action_{logItem.type}_{logItem.action}"/>
|
||||
</f:then>
|
||||
<f:else>
|
||||
[{logItem.action}]
|
||||
</f:else>
|
||||
</f:if>
|
||||
</td>
|
||||
<td class="col-word-break">
|
||||
<belog:formatDetails logEntry="{logItem}"/>
|
||||
<f:if condition="{logItem.detailsNumber} > 0">
|
||||
(msg#{logItem.type}.{logItem.action}.{logItem.detailsNumber})
|
||||
</f:if>
|
||||
</td>
|
||||
<td>
|
||||
<f:if condition="{logItem.error} == 1">
|
||||
<f:link.action action="deleteMessage" arguments="{errorUid:logItem.uid}" class="btn btn-warning">
|
||||
<f:translate key="actions.deleteWarnings"/>
|
||||
</f:link.action>
|
||||
</f:if>
|
||||
<f:if condition="{logItem.error} == 2">
|
||||
<f:link.action action="deleteMessage" arguments="{errorUid:logItem.uid}" class="btn btn-danger">
|
||||
<f:translate key="actions.delete"/>
|
||||
</f:link.action>
|
||||
</f:if>
|
||||
<f:if condition="{logItem.logData.history}">
|
||||
<a class="btn btn-default" href="{be:moduleLink(route: 'record_history', arguments: '{historyEntry: logItem.logData.history}')}" title="{f:translate(key: 'showHistory')}">
|
||||
<core:icon identifier="actions-document-history-open" />
|
||||
<f:translate id="showHistory" />
|
||||
</a>
|
||||
</f:if>
|
||||
</td>
|
||||
</tr>
|
||||
</f:for>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</f:for>
|
||||
</div>
|
||||
</f:for>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
<html
|
||||
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
|
||||
data-namespace-typo3-fluid="true">
|
||||
|
||||
<f:layout name="{layout}"/>
|
||||
<f:section name="Content">
|
||||
<h1>
|
||||
<f:translate key="adminLog" />
|
||||
</h1>
|
||||
|
||||
<div>
|
||||
<f:render
|
||||
partial="Content/Filter"
|
||||
arguments="{_all}"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<f:render
|
||||
partial="Content/LogEntries"
|
||||
arguments="{_all}"
|
||||
/>
|
||||
</f:section>
|
||||
|
||||
</html>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 360 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path fill="#D04139" d="M0 0h64v64H0z"/><path fill="#FFF" d="M19 14h26a1 1 0 0 1 1 1v34a1 1 0 0 1-1 1H19a1 1 0 0 1-1-1V15a1 1 0 0 1 1-1zM40 14H24l2.667-2h10.666z"/><path opacity=".5" fill="#D04139" d="M40 14H24l2.667 2h10.666z"/><path fill="#D04139" d="M24 26h4v2h-4zM30 26h10v2H30zM26 20h12v2H26zM24 30h4v2h-4zM30 30h10v2H30zM24 34h4v2h-4zM30 34h10v2H30zM24 38h4v2h-4zM30 38h10v2H30zM24 42h4v2h-4zM30 42h10v2H30z"/></svg>
|
||||
|
After Width: | Height: | Size: 482 B |
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "typo3/cms-belog",
|
||||
"type": "typo3-cms-framework",
|
||||
"description": "Displays backend log, both per page and system wide. Available as the module Tools>Log (system wide overview) and Web>Info/Log (page relative overview).",
|
||||
"homepage": "https://typo3.org",
|
||||
"license": ["GPL-2.0-or-later"],
|
||||
"authors": [{
|
||||
"name": "TYPO3 Core Team",
|
||||
"email": "typo3cms@typo3.org",
|
||||
"role": "Developer"
|
||||
}],
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"require": {
|
||||
"typo3/cms-core": "9.5.31"
|
||||
},
|
||||
"conflict": {
|
||||
"typo3/cms": "*"
|
||||
},
|
||||
"extra": {
|
||||
"typo3/cms": {
|
||||
"Package": {
|
||||
"partOfFactoryDefault": true
|
||||
},
|
||||
"extension-key": "belog"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"TYPO3\\CMS\\Belog\\": "Classes/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"TYPO3\\CMS\\Belog\\Tests\\": "Tests/"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
$EM_CONF[$_EXTKEY] = [
|
||||
'title' => 'Tools>Log',
|
||||
'description' => 'Displays backend log, both per page and system wide. Available as the module Tools>Log (system wide overview) and Web>Info/Log (page relative overview).',
|
||||
'category' => 'module',
|
||||
'state' => 'stable',
|
||||
'uploadfolder' => 0,
|
||||
'createDirs' => '',
|
||||
'clearCacheOnLoad' => 0,
|
||||
'author' => 'TYPO3 Core Team',
|
||||
'author_email' => 'typo3cms@typo3.org',
|
||||
'author_company' => '',
|
||||
'version' => '9.5.31',
|
||||
'constraints' => [
|
||||
'depends' => [
|
||||
'typo3' => '9.5.31',
|
||||
],
|
||||
'conflicts' => [],
|
||||
'suggests' => [],
|
||||
],
|
||||
];
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
defined('TYPO3_MODE') or die();
|
||||
|
||||
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class)
|
||||
->connect(
|
||||
\TYPO3\CMS\Backend\Backend\ToolbarItems\SystemInformationToolbarItem::class,
|
||||
'loadMessages',
|
||||
\TYPO3\CMS\Belog\Controller\SystemInformationController::class,
|
||||
'appendMessage'
|
||||
);
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
defined('TYPO3_MODE') or die();
|
||||
|
||||
// Module Web->Info->Log
|
||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
|
||||
'web_info',
|
||||
\TYPO3\CMS\Belog\Module\BackendLogModuleBootstrap::class,
|
||||
null,
|
||||
'Log'
|
||||
);
|
||||
|
||||
// Module Tools->Log
|
||||
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
|
||||
'TYPO3.CMS.Belog',
|
||||
'system',
|
||||
'log',
|
||||
'',
|
||||
[
|
||||
'BackendLog' => 'list,deleteMessage',
|
||||
],
|
||||
[
|
||||
'access' => 'admin',
|
||||
'icon' => 'EXT:belog/Resources/Public/Icons/module-belog.svg',
|
||||
'labels' => 'LLL:EXT:belog/Resources/Private/Language/locallang_mod.xlf',
|
||||
]
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:belog/Configuration/TypoScript/setup.typoscript">
|
||||
Reference in new issue
Block a user