1b475e306cb01775cc95454adc50628f73f46f93
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Toolbar / ToolbarItemInterface.php
1 <?php
2 namespace TYPO3\CMS\Backend\Toolbar;
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
17 /**
18 * Interface for classes which extend the backend by adding items to the top toolbar
19 *
20 * @TODO: This interface is FIRST DRAFT and still WILL CHANGE
21 * @see https://forge.typo3.org/issues/62928
22 */
23 interface ToolbarItemInterface {
24
25 /**
26 * Checks whether the user has access to this toolbar item
27 *
28 * @return boolean TRUE if user has access, FALSE if not
29 */
30 public function checkAccess();
31
32 /**
33 * Render "item" part of this toolbar
34 *
35 * @return string Toolbar item HTML
36 */
37 public function getItem();
38
39 /**
40 * TRUE if this toolbar item has a collapsible drop down
41 *
42 * @return bool
43 */
44 public function hasDropDown();
45
46 /**
47 * Render "drop down" part of this toolbar
48 *
49 * @return string Drop down HTML
50 */
51 public function getDropDown();
52
53 /**
54 * Returns an array with additional attributes added to containing <li> tag of the item.
55 *
56 * Typical usages are additional css classes and data-* attributes, classes may be merged
57 * with other classes needed by the framework. Do NOT set an id attribute here.
58 *
59 * array(
60 * 'class' => 'my-class',
61 * 'data-foo' => '42',
62 * )
63 *
64 * @return string List item HTML attibutes
65 */
66 public function getAdditionalAttributes();
67
68 /**
69 * Returns an integer between 0 and 100 to determine
70 * the position of this item relative to others
71 *
72 * By default, extensions should return 50 to be sorted between main core
73 * items and other items that should be on the very right.
74 *
75 * @return integer 0 .. 100
76 */
77 public function getIndex();
78
79 }