[BUGFIX] Fix several typos in php comments
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid / Classes / ViewHelpers / Be / Security / IfAuthenticatedViewHelper.php
1 <?php
2 namespace TYPO3\CMS\Fluid\ViewHelpers\Be\Security;
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 TYPO3Fluid\Fluid\Core\ViewHelper\AbstractConditionViewHelper;
18
19 /**
20 * This ViewHelper implements an ifAuthenticated/else condition for backend
21 * users and backend groups.
22 *
23 * Examples
24 * ========
25 *
26 * Basic usage::
27 *
28 * <f:be.security.ifAuthenticated>
29 * This is being shown whenever a BE user is logged in
30 * </f:be.security.ifAuthenticated>
31 *
32 * Everything inside the :html:`<f:be.ifAuthenticated>` tag is being displayed
33 * if the user is authenticated with any backend user account.
34 *
35 * IfAuthenticated / then / else::
36 *
37 * <f:be.security.ifAuthenticated>
38 * <f:then>
39 * This is being shown in case you have access.
40 * </f:then>
41 * <f:else>
42 * This is being displayed in case you do not have access.
43 * </f:else>
44 * </f:be.security.ifAuthenticated>
45 *
46 * Everything inside the :html:`<f:then></f:then>` is displayed the backend user is logged in.
47 * :html:`<f:else></f:else>` is displayed if no backend user is logged in.
48 */
49 class IfAuthenticatedViewHelper extends AbstractConditionViewHelper
50 {
51 /**
52 * This method decides if the condition is TRUE or FALSE. It can be overridden in extending viewhelpers to adjust functionality.
53 *
54 * @param array $arguments ViewHelper arguments to evaluate the condition for this ViewHelper, allows for flexibility in overriding this method.
55 * @return bool
56 */
57 protected static function evaluateCondition($arguments = null)
58 {
59 return isset($GLOBALS['BE_USER']) && $GLOBALS['BE_USER']->user['uid'] > 0;
60 }
61 }