91 if (empty($this->settings)) {
92 throw new \RuntimeException(
93 'No settings detected. This usually happens if there is no frontend TypoScript template with root flag set. Please create one.',
97 if (!isset($this->settings[
'dateFormat'])) {
98 $this->settings[
'dateFormat'] =
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'ddmmyy'];
100 if (!isset($this->settings[
'timeFormat'])) {
101 $this->settings[
'timeFormat'] =
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'hhmm'];
123 if ($constraint === NULL) {
125 if ($constraint === NULL) {
126 $constraint = $this->objectManager->get(
'TYPO3\\CMS\\Belog\\Domain\\Model\\Constraint');
131 $constraint->setIsInPageContext($this->isInPageContext);
132 $constraint->setPageId($this->pageId);
135 $logEntries = $this->logEntryRepository->findByConstraint($constraint);
136 $groupedLogEntries = $this->groupLogEntriesByPageAndDay($logEntries, $constraint->getGroupByPage());
146 $serializedConstraint =
$GLOBALS[
'BE_USER']->getModuleData(get_class($this));
147 if (!is_string($serializedConstraint) || empty($serializedConstraint)) {
150 return @unserialize($serializedConstraint);
160 $GLOBALS[
'BE_USER']->pushModuleData(get_class($this), serialize($constraint));
177 protected function groupLogEntriesByPageAndDay(\
TYPO3\CMS\Extbase\Persistence\QueryResultInterface $logEntries, $groupByPage = FALSE) {
178 $targetStructure = array();
180 foreach ($logEntries as $entry) {
183 $pid = $entry->getEventPid();
188 if (!is_array($targetStructure[$pid])) {
189 $targetStructure[$pid] = array();
192 $timestampDay = strtotime(strftime(
'%d.%m.%Y', $entry->getTstamp()));
193 if (!is_array($targetStructure[$pid][$timestampDay])) {
194 $targetStructure[$pid][$timestampDay] = array();
197 $targetStructure[$pid][$timestampDay][] = $entry;
199 ksort($targetStructure);
200 return $targetStructure;
210 $propertyMapperDate->setTypeConverterOption(
'TYPO3\\CMS\\Extbase\\Property\\TypeConverter\\DateTimeConverter', \
TYPO3\CMS\Extbase\Property\TypeConverter\DateTimeConverter::CONFIGURATION_DATE_FORMAT, $this->settings[
'dateFormat'] .
' ' . $this->settings[
'timeFormat']);
221 $userGroupArray = array();
227 foreach ($groups as $group) {
232 foreach ($users as $user) {
235 return $userGroupArray;
243 protected function createWorkspaceListForSelectOptions() {
244 if (!\
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded(
'workspaces')) {
247 $workspaceArray = array();
251 $workspaces = $this->objectManager->get(
'TYPO3\\CMS\\Belog\\Domain\\Repository\\WorkspaceRepository')->findAll();
253 foreach ($workspaces as $workspace) {
254 $workspaceArray[$workspace->getUid()] = $workspace->getUid() .
': ' . $workspace->getTitle();
256 return $workspaceArray;
268 if (
$GLOBALS[
'BE_USER']->workspace !== 0) {
269 $constraint->setWorkspaceUid(
$GLOBALS[
'BE_USER']->workspace);
270 $this->view->assign(
'showWorkspaceSelector', FALSE);
272 $this->view->assign(
'showWorkspaceSelector', TRUE);
284 0 => \
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'LLL:EXT:lang/locallang_mod_web_info.xlf:depth_0',
'lang'),
285 1 => \
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'LLL:EXT:lang/locallang_mod_web_info.xlf:depth_1',
'lang'),
286 2 => \
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'LLL:EXT:lang/locallang_mod_web_info.xlf:depth_2',
'lang'),
287 3 => \
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'LLL:EXT:lang/locallang_mod_web_info.xlf:depth_3',
'lang')
302 switch ($constraint->getTimeFrame()) {
303 case self::TIMEFRAME_THISWEEK:
305 $week = (date(
'w') ?: 7) - 1;
306 $startTime = mktime(0, 0, 0) - $week * 3600 * 24;
308 case self::TIMEFRAME_LASTWEEK:
310 $week = (date(
'w') ?: 7) - 1;
311 $startTime = mktime(0, 0, 0) - ($week + 7) * 3600 * 24;
312 $endTime = mktime(0, 0, 0) - $week * 3600 * 24;
314 case self::TIMEFRAME_LASTSEVENDAYS:
316 $startTime = mktime(0, 0, 0) - 7 * 3600 * 24;
318 case self::TIMEFRAME_THISMONTH:
320 $startTime = mktime(0, 0, 0, date(
'm'), 1);
322 case self::TIMEFRAME_LASTMONTH:
324 $startTime = mktime(0, 0, 0, date(
'm') - 1, 1);
325 $endTime = mktime(0, 0, 0, date(
'm'), 1);
327 case self::TIMEFRAME_LAST31DAYS:
329 $startTime = mktime(0, 0, 0) - 31 * 3600 * 24;
331 case self::TIMEFRAME_CUSTOM:
332 if ($constraint->getManualDateStart() instanceof \DateTime) {
333 $startTime = $constraint->getManualDateStart()->format(
'U');
334 if ($constraint->getManualDateStop() instanceof \DateTime) {
335 $manualEndTime = $constraint->getManualDateStop()->format(
'U');
336 if ($manualEndTime > $startTime) {
337 $endTime = $manualEndTime;
347 $constraint->setStartTimestamp($startTime);
348 $constraint->setEndTimestamp($endTime);
const TIMEFRAME_THISMONTH
configurePropertyMapperForDateTimeFormat(\TYPO3\CMS\Extbase\Property\PropertyMappingConfiguration $propertyMapperDate)
const TIMEFRAME_LASTMONTH
static getGroupNames($fields='title, uid', $where='')
getConstraintFromBeUserData()
forceWorkspaceSelectionIfInWorkspace(\TYPO3\CMS\Belog\Domain\Model\Constraint $constraint)
const TIMEFRAME_LAST31DAYS
const TIMEFRAME_LASTSEVENDAYS
static getUserNames($fields='username, usergroup, usergroup_cached_list, uid', $where='')
createUserAndGroupListForSelectOptions()
persistConstraintInBeUserData(\TYPO3\CMS\Belog\Domain\Model\Constraint $constraint)
setStartAndEndTimeFromTimeSelector(\TYPO3\CMS\Belog\Domain\Model\Constraint $constraint)
indexAction(\TYPO3\CMS\Belog\Domain\Model\Constraint $constraint=NULL)
static translate($key, $extensionName, $arguments=NULL)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]