TYPO3 CMS  TYPO3_7-6
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 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 }
static cshItem($table, $field, $_='', $wrap='')