Bug #82528 ยป RestoreRegisterContentObject.php

Reindl Bernd, 2021-05-28 07:02

 
1
<?php
2

    
3
/*
4
 * This file is part of the TYPO3 CMS project.
5
 *
6
 * It is free software; you can redistribute it and/or modify it under
7
 * the terms of the GNU General Public License, either version 2
8
 * of the License, or any later version.
9
 *
10
 * For the full copyright and license information, please read the
11
 * LICENSE.txt file that was distributed with this source code.
12
 *
13
 * The TYPO3 project - inspiring people to share!
14
 */
15

    
16
namespace TYPO3\CMS\Frontend\ContentObject;
17

    
18
/**
19
 * Contains RESTORE_REGISTER class object.
20
 */
21
class RestoreRegisterContentObject extends AbstractContentObject
22
{
23
    /**
24
     * Rendering the cObject, RESTORE_REGISTER
25
     * NOTICE: This cObject does NOT return any content since it just sets internal data based on the TypoScript properties.
26
     *
27
     * @param array $conf Array of TypoScript properties
28
     * @return string Empty string (the cObject only sets internal data!)
29
     */
30
    public function render($conf = [])
31
    {
32
        $SYS_LASTCHANGED = isset($GLOBALS['TSFE']->register['SYS_LASTCHANGED']) ? $GLOBALS['TSFE']->register['SYS_LASTCHANGED'] : false;
33
        $GLOBALS['TSFE']->register = array_pop($GLOBALS['TSFE']->registerStack);
34
        if($SYS_LASTCHANGED !== false)
35
            $GLOBALS['TSFE']->register['SYS_LASTCHANGED'] = $SYS_LASTCHANGED;            
36
        return '';
37
    }
38
}
    (1-1/1)