TYPO3
7.6
Users
bogdan
Projects
Kapeli
Resources
Dash
Docsets
TYPO3
src
typo3
sysext
backend
Classes
Template
Components
Buttons
Action
HelpButton.php
Go to the documentation of this file.
1
<?php
2
namespace
TYPO3\CMS\Backend\Template\Components\Buttons\Action;
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\Backend\Utility\BackendUtility
;
18
use
TYPO3\CMS\Backend\Template\Components\ButtonBar
;
19
use
TYPO3\CMS\Backend\Template\Components\Buttons\ButtonInterface
;
20
use
TYPO3\CMS\Backend\Template\Components\Buttons\PositionInterface
;
21
36
class
HelpButton
implements
ButtonInterface
,
PositionInterface
37
{
41
protected
$moduleName
;
42
46
protected
$fieldName
=
''
;
47
53
public
function
getModuleName
()
54
{
55
return
$this->moduleName
;
56
}
57
64
public
function
setModuleName
(
$moduleName
)
65
{
66
$this->moduleName =
$moduleName
;
67
return
$this;
68
}
69
75
public
function
getFieldName
()
76
{
77
return
$this->fieldName
;
78
}
79
86
public
function
setFieldName
(
$fieldName
)
87
{
88
$this->fieldName =
$fieldName
;
89
return
$this;
90
}
91
97
public
function
getPosition
()
98
{
99
return
ButtonBar::BUTTON_POSITION_RIGHT
;
100
}
101
107
public
function
getGroup
()
108
{
109
return
99;
110
}
111
117
public
function
getType
()
118
{
119
return
get_class($this);
120
}
121
128
public
function
isValid
()
129
{
130
return
(!empty($this->moduleName));
131
}
132
138
public
function
__toString
()
139
{
140
return
$this->
render
();
141
}
142
148
public
function
render
()
149
{
150
$helpMarkup =
BackendUtility::cshItem
($this->moduleName, $this->fieldName);
151
if
($helpMarkup ===
''
) {
152
return
''
;
153
}
154
return
'<span class="btn btn-sm btn-default">'
. $helpMarkup .
'</span>'
;
155
}
156
}
Generated on Wed Nov 11 2015 01:51:57 for TYPO3 by
1.8.3