Commit 4c15ae09 authored by Wouter Wolters's avatar Wouter Wolters Committed by Oliver Hader
Browse files

[TASK] Cleanup "belog" sysext

Reformats the code, fixes indents and removes extra empty lines. This is
not a functional change but a visual clean up.

Change-Id: I0d11dd7c43eee5d181c4bc0565c85d651c5c29e1
Resolves: #45392
Releases: 6.0, 6.1
Reviewed-on: https://review.typo3.org/18207
Reviewed-by: Stefan Neufeind
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
parent 9ef16014
......@@ -25,6 +25,7 @@ namespace TYPO3\CMS\Belog\Controller;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Abstract class to show log entries from sys_log
*
......@@ -36,39 +37,46 @@ abstract class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\Acti
* @var integer
*/
const TIMEFRAME_THISWEEK = 0;
/**
* @var integer
*/
const TIMEFRAME_LASTWEEK = 1;
/**
* @var integer
*/
const TIMEFRAME_LASTSEVENDAYS = 2;
/**
* @var integer
*/
const TIMEFRAME_THISMONTH = 10;
/**
* @var integer
*/
const TIMEFRAME_LASTMONTH = 11;
/**
* @var integer
*/
const TIMEFRAME_LAST31DAYS = 12;
/**
* @var integer
*/
const TIMEFRAME_CUSTOM = 30;
/**
* whether plugin is running in page context (sub module of Web > Info)
* Whether plugin is running in page context (sub module of Web > Info)
*
* @var boolean
*/
protected $isInPageContext = FALSE;
/**
* page ID in page context
* Page ID in page context
*
* @var integer
*/
......@@ -174,7 +182,7 @@ abstract class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\Acti
*
* [pid][dayTimestamp][items]
*
* @param \TYPO3\CMS\Extbase\Persistence\QueryResultInterface<TYPO3\CMS\Belog\Domain\Model\LogEntry> $logEntries
* @param \TYPO3\CMS\Extbase\Persistence\QueryResultInterface<\TYPO3\CMS\Belog\Domain\Model\LogEntry> $logEntries
* @param boolean $groupByPage Whether or not log entries should be grouped by page
* @return array
*/
......@@ -354,5 +362,4 @@ abstract class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\Acti
}
?>
\ No newline at end of file
......@@ -25,6 +25,7 @@ namespace TYPO3\CMS\Belog\Controller;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Show log entries from table sys_log
*
......@@ -32,8 +33,6 @@ namespace TYPO3\CMS\Belog\Controller;
*/
class ToolsController extends \TYPO3\CMS\Belog\Controller\AbstractController {
}
?>
\ No newline at end of file
......@@ -25,6 +25,7 @@ namespace TYPO3\CMS\Belog\Controller;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Controller for log entry listings in Web->Info module
*
......@@ -44,5 +45,4 @@ class WebInfoController extends \TYPO3\CMS\Belog\Controller\AbstractController {
}
?>
\ No newline at end of file
......@@ -25,6 +25,7 @@ namespace TYPO3\CMS\Belog\Domain\Model;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Constraints for log entries
*
......@@ -40,7 +41,7 @@ class Constraint extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
protected $userOrGroup = '0';
/**
* number of log rows to show
* Number of log rows to show
*
* @var integer
*/
......@@ -54,70 +55,70 @@ class Constraint extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
protected $workspaceUid = \TYPO3\CMS\Belog\Domain\Model\Workspace::UID_ANY_WORKSPACE;
/**
* selected time frame
* Selected time frame
*
* @var integer
*/
protected $timeFrame = 0;
/**
* selected action
* Selected action
*
* @var integer
*/
protected $action = 0;
/**
* whether rows should be grouped by page
* Whether rows should be grouped by page
*
* @var boolean
*/
protected $groupByPage = FALSE;
/**
* manual date start
* Manual date start
*
* @var \DateTime
*/
protected $manualDateStart = NULL;
/**
* manual date stop
* Manual date stop
*
* @var \DateTime
*/
protected $manualDateStop = NULL;
/**
* calculated start timestamp
* Calculated start timestamp
*
* @var integer
*/
protected $startTimestamp = 0;
/**
* calculated end timestamp
* Calculated end timestamp
*
* @var integer
*/
protected $endTimestamp = 0;
/**
* whether the plugin is called in page context (submodule of Web > Info)
* Whether the plugin is called in page context (submodule of Web > Info)
*
* @var boolean
*/
protected $isInPageContext = FALSE;
/**
* selected page ID in page context
* Selected page ID in page context
*
* @var integer
*/
protected $pageId = 0;
/**
* page level depth
* Page level depth
*
* @var integer
*/
......@@ -379,5 +380,4 @@ class Constraint extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
}
?>
\ No newline at end of file
......@@ -25,6 +25,7 @@ namespace TYPO3\CMS\Belog\Domain\Model;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Stub model for sys history - only properties required for belog module are added currently
*
......@@ -33,7 +34,7 @@ namespace TYPO3\CMS\Belog\Domain\Model;
class HistoryEntry extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
/**
* list of changed fields
* List of changed fields
*
* @var string
*/
......@@ -61,5 +62,4 @@ class HistoryEntry extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
}
?>
\ No newline at end of file
......@@ -25,17 +25,18 @@ namespace TYPO3\CMS\Belog\Domain\Model;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* 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
* @todo : This should be stuffed to some more central place
* @author Christian Kuhn <lolli@schwarzbu.ch>
*/
class LogEntry extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
/**
* storage page ID of the log entry
* Storage page ID of the log entry
*
* @var integer
*/
......@@ -53,7 +54,7 @@ class LogEntry extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
protected $backendUserUid = 0;
/**
* action ID of the action that happened, for example 3 was a file action
* Action ID of the action that happened, for example 3 was a file action
*
* @var integer
*/
......@@ -67,7 +68,7 @@ class LogEntry extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
protected $recordUid = 0;
/**
* table name
* Table name
*
* @var string
*/
......@@ -81,7 +82,7 @@ class LogEntry extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
protected $recordPid = 0;
/**
* error code
* Error code
*
* @var integer
*/
......@@ -95,21 +96,21 @@ class LogEntry extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
protected $details = '';
/**
* timestamp when the log entry was written
* Timestamp when the log entry was written
*
* @var integer
*/
protected $tstamp = 0;
/**
* type code
* Type code
*
* @var integer
*/
protected $type = 0;
/**
* details number
* Details number
*
* @var integer
*/
......@@ -130,7 +131,7 @@ class LogEntry extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
protected $logData = '';
/**
* event PID
* Event PID
*
* @var integer
*/
......@@ -144,7 +145,7 @@ class LogEntry extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
protected $workspaceUid = 0;
/**
* new ID
* New ID
*
* @var string
*/
......@@ -463,5 +464,4 @@ class LogEntry extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
}
?>
\ No newline at end of file
......@@ -25,10 +25,11 @@ namespace TYPO3\CMS\Belog\Domain\Model;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* 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
* @todo : This should be extended and put at some more central place
* @author Christian Kuhn <lolli@schwarzbu.ch>
*/
class Workspace extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
......@@ -37,10 +38,12 @@ class Workspace extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
* @var integer
*/
const UID_LIVE_WORKSPACE = 0;
/**
* @var integer
*/
const UID_ANY_WORKSPACE = -99;
/**
* title of the workspace
*
......@@ -69,5 +72,4 @@ class Workspace extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
}
?>
\ No newline at end of file
......@@ -25,6 +25,7 @@ namespace TYPO3\CMS\Belog\Domain\Repository;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Find system history entries
*
......@@ -47,5 +48,4 @@ class HistoryEntryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
}
?>
\ No newline at end of file
......@@ -25,6 +25,7 @@ namespace TYPO3\CMS\Belog\Domain\Repository;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Sys log entry repository
*
......@@ -33,7 +34,7 @@ namespace TYPO3\CMS\Belog\Domain\Repository;
class LogEntryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
/**
* backend users, with UID as key
* Backend users, with UID as key
*
* @var array
*/
......@@ -113,7 +114,7 @@ class LogEntryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
return;
}
$pageIds = array();
// check if we should get a whole tree of pages and not only a single page
// Check if we should get a whole tree of pages and not only a single page
if ($constraint->getDepth() > 0) {
/** @var $pageTree \TYPO3\CMS\Backend\Tree\View\PageTreeView */
$pageTree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\View\\PageTreeView');
......@@ -164,5 +165,4 @@ class LogEntryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
}
?>
\ No newline at end of file
......@@ -25,13 +25,13 @@ namespace TYPO3\CMS\Belog\Domain\Repository;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Repository for workspaces
*
* TODO this should be moved to EXT:workspaces if EXT:belog works no matter if workspaces are installed or not
*
* @author Christian Kuhn <lolli@schwarzbu.ch>
* @author Oliver Klee <typo3-coding@oliverklee.de>
* @todo This should be moved to EXT:workspaces if EXT:belog works no matter if workspaces are installed or not
*/
class WorkspaceRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
......@@ -49,5 +49,4 @@ class WorkspaceRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
}
?>
\ No newline at end of file
......@@ -25,10 +25,11 @@ namespace TYPO3\CMS\Belog\Module;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* 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.
* 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.
......@@ -78,5 +79,4 @@ class BackendLogModuleBootstrap {
}
?>
\ No newline at end of file
......@@ -25,6 +25,7 @@ namespace TYPO3\CMS\Belog\ViewHelpers\Be;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* View helper to add a additional javascript file to the backend header
*
......@@ -48,5 +49,4 @@ class AddJsFileViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBacken
}
?>
\ No newline at end of file
......@@ -25,6 +25,7 @@ namespace TYPO3\CMS\Belog\ViewHelpers\Be;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* View helper to add a additional javascript settings to the backend header
*
......@@ -48,5 +49,4 @@ class InlineSettingsArrayViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\Abst
}
?>
\ No newline at end of file
......@@ -25,6 +25,7 @@ namespace TYPO3\CMS\Belog\ViewHelpers\Be;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Get page path string from page id
*
......@@ -45,5 +46,4 @@ class PagePathViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackend
}
?>
\ No newline at end of file
......@@ -25,6 +25,7 @@ namespace TYPO3\CMS\Belog\ViewHelpers\Form;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Extends the usual select view helper, but additionally translates
* the select option labels
......@@ -55,7 +56,7 @@ class TranslateLabelSelectViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\S
* 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
* @return array An associative array of options, key will be the value of the option tag
*/
protected function getOptions() {
$options = parent::getOptions();
......@@ -82,5 +83,4 @@ class TranslateLabelSelectViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\S
}
?>
\ No newline at end of file
......@@ -25,6 +25,7 @@ namespace TYPO3\CMS\Belog\ViewHelpers;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Create detail string from log entry
*
......@@ -73,5 +74,4 @@ class FormatDetailsViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractV
}
?>
\ No newline at end of file
......@@ -25,6 +25,7 @@ namespace TYPO3\CMS\Belog\ViewHelpers;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Get history entry from for log entry
*
......@@ -50,7 +51,11 @@ class HistoryEntryViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractVi
if (!$historyEntry instanceof \TYPO3\CMS\Belog\Domain\Model\HistoryEntry) {
return '';
}
$historyLabel = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('changesInFields', $this->controllerContext->getRequest()->getControllerExtensionName(), array($historyEntry->getFieldlist()));
$historyLabel = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'changesInFields',
$this->controllerContext->getRequest()->getControllerExtensionName(),
array($historyEntry->getFieldlist())
);
$historyIcon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-history-open', array(
'title' => \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('showHistory', $this->controllerContext->getRequest()->getControllerExtensionName())
));
......@@ -61,5 +66,4 @@ class HistoryEntryViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractVi
}
?>
\ No newline at end of file
......@@ -25,6 +25,7 @@ namespace TYPO3\CMS\Belog\ViewHelpers;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Returns true, if a specific extension is loaded
*
......@@ -44,5 +45,4 @@ class IsExtensionLoadedViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\Abstr
}
?>
\ No newline at end of file
......@@ -25,6 +25,7 @@ namespace TYPO3\CMS\Belog\ViewHelpers;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Get username from backend user id
*
......@@ -55,5 +56,4 @@ class UsernameViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHe
}
?>
\ No newline at end of file
......@@ -25,6 +25,7 @@ namespace TYPO3\CMS\Belog\ViewHelpers;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Get workspace title from workspace id
*
......@@ -63,5 +64,4 @@ class WorkspaceTitleViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\Abstract
}
?>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment