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
16namespace TYPO3\CMS\Backend\Template\Components;
17
18/**
19 * Control used by various components
20 */
21class AbstractControl
22{
23    /**
24     * HTML tag attribute for class
25     *
26     * @var string
27     */
28    protected $classes = '';
29
30    /**
31     * HTML tag attribute for title
32     *
33     * @var string
34     */
35    protected $title = '';
36
37    /**
38     * HTML tag attributes for data-*
39     * Use key => value pairs
40     *
41     * @var array
42     */
43    protected $dataAttributes = [];
44
45    /**
46     * HTML tag attribute onClick
47     * Outdated, use sparingly
48     *
49     * @var string
50     */
51    protected $onClick = '';
52
53    /**
54     * Get classes
55     *
56     * @return string
57     */
58    public function getClasses()
59    {
60        return $this->classes;
61    }
62
63    /**
64     * Get Title
65     *
66     * @return string
67     */
68    public function getTitle()
69    {
70        return $this->title;
71    }
72
73    /**
74     * Get Data attributes
75     *
76     * @return array
77     */
78    public function getDataAttributes()
79    {
80        return $this->dataAttributes;
81    }
82
83    /**
84     * Get Onclick Attribute
85     *
86     * @return string
87     */
88    public function getOnClick()
89    {
90        return $this->onClick;
91    }
92
93    /**
94     * Set classes
95     *
96     * @param string $classes HTML class attribute to set
97     *
98     * @return $this
99     */
100    public function setClasses($classes)
101    {
102        $this->classes = $classes;
103        return $this;
104    }
105
106    /**
107     * Set title attribute
108     *
109     * @param string $title HTML title attribute to set
110     *
111     * @return $this
112     */
113    public function setTitle($title)
114    {
115        $this->title = $title;
116        return $this;
117    }
118
119    /**
120     * Set Data attributes
121     *
122     * @param array $dataAttributes HTML data attributes to set
123     *
124     * @return $this
125     */
126    public function setDataAttributes(array $dataAttributes)
127    {
128        $this->dataAttributes = $dataAttributes;
129        return $this;
130    }
131
132    /**
133     * Set OnClick
134     *
135     * @param string $onClick HTML onClick attribute to set
136     *
137     * @return $this
138     */
139    public function setOnClick($onClick)
140    {
141        $this->onClick = $onClick;
142        return $this;
143    }
144}
145