Completed
Push — master ( 28ebf5...09fe01 )
by
unknown
33:35 queued 16:54
created

NewRecordPageTreeView::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
namespace TYPO3\CMS\Backend\Tree\View;
3
4
/*
5
 * This file is part of the TYPO3 CMS project.
6
 *
7
 * It is free software; you can redistribute it and/or modify it under
8
 * the terms of the GNU General Public License, either version 2
9
 * of the License, or any later version.
10
 *
11
 * For the full copyright and license information, please read the
12
 * LICENSE.txt file that was distributed with this source code.
13
 *
14
 * The TYPO3 project - inspiring people to share!
15
 */
16
17
/**
18
 * Extension for the tree class that generates the tree of pages in the page-wizard mode
19
 *
20
 * @see \TYPO3\CMS\Backend\Controller\NewRecordController
21
 * @internal This class is a TYPO3 Backend implementation and is not considered part of the Public TYPO3 API.
22
 */
23
class NewRecordPageTreeView extends PageTreeView
24
{
25
    /**
26
     * @var int
27
     */
28
    protected $currentPageId;
29
30
    public function __construct(int $currentPageId)
31
    {
32
        $this->currentPageId = $currentPageId;
33
        parent::__construct();
34
    }
35
36
    /**
37
     * Determines whether to expand a branch or not.
38
     * Here the branch is expanded if the current id matches the global id for the listing/new
39
     *
40
     * @param int $id The ID (page id) of the element
41
     * @return bool Returns TRUE if the IDs matches
42
     */
43
    public function expandNext($id)
44
    {
45
        return (int)$id === $this->currentPageId;
46
    }
47
}
48