‪TYPO3CMS  10.4
HelpButton.php
Go to the documentation of this file.
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 
17 
22 
38 {
42  protected ‪$moduleName;
43 
47  protected ‪$fieldName = '';
48 
54  public function ‪getModuleName()
55  {
56  return ‪$this->moduleName;
57  }
58 
65  public function ‪setModuleName(‪$moduleName)
66  {
67  $this->moduleName = ‪$moduleName;
68  return $this;
69  }
70 
76  public function ‪getFieldName()
77  {
78  return ‪$this->fieldName;
79  }
80 
87  public function ‪setFieldName(‪$fieldName)
88  {
89  $this->fieldName = ‪$fieldName;
90  return $this;
91  }
92 
98  public function ‪getPosition()
99  {
101  }
102 
108  public function ‪getGroup()
109  {
110  return 99;
111  }
112 
118  public function ‪getType()
119  {
120  return static::class;
121  }
122 
129  public function ‪isValid()
130  {
131  return !empty($this->moduleName);
132  }
133 
139  public function ‪__toString()
140  {
141  return $this->‪render();
142  }
143 
149  public function ‪render()
150  {
151  $helpMarkup = ‪BackendUtility::cshItem($this->moduleName, $this->fieldName);
152  if ($helpMarkup === '') {
153  return '';
154  }
155  return '<span class="btn btn-sm btn-default">' . $helpMarkup . '</span>';
156  }
157 }
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\$fieldName
‪string $fieldName
Definition: HelpButton.php:45
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action
Definition: HelpButton.php:16
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\getFieldName
‪string getFieldName()
Definition: HelpButton.php:74
‪TYPO3\CMS\Backend\Template\Components\ButtonBar
Definition: ButtonBar.php:32
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\$moduleName
‪string $moduleName
Definition: HelpButton.php:41
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\isValid
‪bool isValid()
Definition: HelpButton.php:127
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\getGroup
‪int getGroup()
Definition: HelpButton.php:106
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\getType
‪string getType()
Definition: HelpButton.php:116
‪TYPO3\CMS\Backend\Utility\BackendUtility\cshItem
‪static string cshItem($table, $field, $_='', $wrap='')
Definition: BackendUtility.php:2306
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\__toString
‪string __toString()
Definition: HelpButton.php:137
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\setFieldName
‪HelpButton setFieldName($fieldName)
Definition: HelpButton.php:85
‪TYPO3\CMS\Backend\Template\Components\Buttons\PositionInterface
Definition: PositionInterface.php:22
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\getModuleName
‪string getModuleName()
Definition: HelpButton.php:52
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:75
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton
Definition: HelpButton.php:38
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\render
‪string render()
Definition: HelpButton.php:147
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\setModuleName
‪HelpButton setModuleName($moduleName)
Definition: HelpButton.php:63
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\getPosition
‪string getPosition()
Definition: HelpButton.php:96
‪TYPO3\CMS\Backend\Template\Components\ButtonBar\BUTTON_POSITION_RIGHT
‪const BUTTON_POSITION_RIGHT
Definition: ButtonBar.php:41
‪TYPO3\CMS\Backend\Template\Components\Buttons\ButtonInterface
Definition: ButtonInterface.php:22