‪TYPO3CMS  11.5
AbstractControl.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 {
28  protected ‪$classes = '';
29 
35  protected ‪$title = '';
36 
43  protected ‪$dataAttributes = [];
44 
52  protected ‪$onClick = '';
53 
59  public function ‪getClasses()
60  {
61  return ‪$this->classes;
62  }
63 
69  public function ‪getTitle()
70  {
71  return ‪$this->title;
72  }
73 
79  public function ‪getDataAttributes()
80  {
82  }
83 
91  public function ‪hasOnClick(): bool
92  {
93  // does not trigger deprecation error on purpose
94  return $this->onClick !== '';
95  }
96 
103  public function ‪getOnClick()
104  {
105  trigger_error(
106  'Use HTML data attrs for GlobalEventHandler or ActionDispatcher instead. Will be removed in TYPO3 v12.0',
107  E_USER_DEPRECATED
108  );
109  return ‪$this->onClick;
110  }
111 
119  public function ‪setClasses(‪$classes)
120  {
121  $this->classes = ‪$classes;
122  return $this;
123  }
124 
132  public function ‪setTitle(‪$title)
133  {
134  $this->title = ‪$title;
135  return $this;
136  }
137 
145  public function ‪setDataAttributes(array ‪$dataAttributes)
146  {
147  $this->dataAttributes = ‪$dataAttributes;
148  return $this;
149  }
150 
159  public function ‪setOnClick(‪$onClick)
160  {
161  trigger_error(
162  'Use HTML data attrs for GlobalEventHandler or ActionDispatcher instead. Will be removed in TYPO3 v12.0',
163  E_USER_DEPRECATED
164  );
165  $this->onClick = ‪$onClick;
166  return $this;
167  }
168 }
‪TYPO3\CMS\Backend\Template\Components\AbstractControl\setClasses
‪$this setClasses($classes)
Definition: AbstractControl.php:115
‪TYPO3\CMS\Backend\Template\Components\AbstractControl\getDataAttributes
‪array getDataAttributes()
Definition: AbstractControl.php:75
‪TYPO3\CMS\Backend\Template\Components\AbstractControl\$onClick
‪string $onClick
Definition: AbstractControl.php:48
‪TYPO3\CMS\Backend\Template\Components\AbstractControl\hasOnClick
‪bool hasOnClick()
Definition: AbstractControl.php:87
‪TYPO3\CMS\Backend\Template\Components\AbstractControl\getOnClick
‪string getOnClick()
Definition: AbstractControl.php:99
‪TYPO3\CMS\Backend\Template\Components\AbstractControl\getClasses
‪string getClasses()
Definition: AbstractControl.php:55
‪TYPO3\CMS\Backend\Template\Components\AbstractControl\$title
‪string $title
Definition: AbstractControl.php:33
‪TYPO3\CMS\Backend\Template\Components\AbstractControl\getTitle
‪string getTitle()
Definition: AbstractControl.php:65
‪TYPO3\CMS\Backend\Template\Components\AbstractControl
Definition: AbstractControl.php:22
‪TYPO3\CMS\Backend\Template\Components\AbstractControl\$classes
‪string $classes
Definition: AbstractControl.php:27
‪TYPO3\CMS\Backend\Template\Components
Definition: AbstractControl.php:16
‪TYPO3\CMS\Backend\Template\Components\AbstractControl\$dataAttributes
‪array $dataAttributes
Definition: AbstractControl.php:40
‪TYPO3\CMS\Backend\Template\Components\AbstractControl\setOnClick
‪$this setOnClick($onClick)
Definition: AbstractControl.php:155
‪TYPO3\CMS\Backend\Template\Components\AbstractControl\setDataAttributes
‪$this setDataAttributes(array $dataAttributes)
Definition: AbstractControl.php:141
‪TYPO3\CMS\Backend\Template\Components\AbstractControl\setTitle
‪$this setTitle($title)
Definition: AbstractControl.php:128