‪TYPO3CMS  9.5
HelpButton.php
Go to the documentation of this file.
1 <?php
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 
21 
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  {
100  }
101 
107  public function ‪getGroup()
108  {
109  return 99;
110  }
111 
117  public function ‪getType()
118  {
119  return static::class;
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 }
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\$fieldName
‪string $fieldName
Definition: HelpButton.php:44
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action
Definition: HelpButton.php:2
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\getFieldName
‪string getFieldName()
Definition: HelpButton.php:73
‪TYPO3\CMS\Backend\Template\Components\ButtonBar
Definition: ButtonBar.php:31
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\$moduleName
‪string $moduleName
Definition: HelpButton.php:40
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\isValid
‪bool isValid()
Definition: HelpButton.php:126
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\getGroup
‪int getGroup()
Definition: HelpButton.php:105
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\getType
‪string getType()
Definition: HelpButton.php:115
‪TYPO3\CMS\Backend\Utility\BackendUtility\cshItem
‪static string cshItem($table, $field, $_='', $wrap='')
Definition: BackendUtility.php:2565
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\__toString
‪string __toString()
Definition: HelpButton.php:136
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\setFieldName
‪HelpButton setFieldName($fieldName)
Definition: HelpButton.php:84
‪TYPO3\CMS\Backend\Template\Components\Buttons\PositionInterface
Definition: PositionInterface.php:21
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\getModuleName
‪string getModuleName()
Definition: HelpButton.php:51
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:72
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton
Definition: HelpButton.php:37
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\render
‪string render()
Definition: HelpButton.php:146
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\setModuleName
‪HelpButton setModuleName($moduleName)
Definition: HelpButton.php:62
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\getPosition
‪string getPosition()
Definition: HelpButton.php:95
‪TYPO3\CMS\Backend\Template\Components\ButtonBar\BUTTON_POSITION_RIGHT
‪const BUTTON_POSITION_RIGHT
Definition: ButtonBar.php:40
‪TYPO3\CMS\Backend\Template\Components\Buttons\ButtonInterface
Definition: ButtonInterface.php:21