Completed
Push — master ( 07b37d...b10e41 )
by Torben
02:00
created

Typo3VersionClassViewHelper::render()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 3
eloc 7
nc 3
nop 0
1
<?php
2
namespace DERHANSEN\SfEventMgt\ViewHelpers\Be;
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
use TYPO3\CMS\Core\Utility\GeneralUtility;
18
19
/**
20
 * Typo3VersionClass ViewHelper
21
 *
22
 * @author Torben Hansen <[email protected]>
23
 */
24
class Typo3VersionClassViewHelper extends AbstractRecordViewHelper
25
{
26
    /**
27
     * Uses GeneralUtility::compat_version to return a classname which can be used in backend views
28
     *
29
     * @todo: Remove condition, when TYPO3 6.2 is deprecated
30
     *
31
     * @return string
32
     */
33
    public function render()
34
    {
35
        if (GeneralUtility::compat_version('7.6')) {
36
            return 'typo3-76';
37
        } elseif (GeneralUtility::compat_version('6.2')) {
38
            return 'typo3-62';
39
        } else {
40
            return '';
41
        }
42
    }
43
}
44