| Total Complexity | 7 |
| Total Lines | 70 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 8 | class ApplicationContextToolbarItem implements ToolbarItemInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var Main |
||
| 12 | */ |
||
| 13 | protected $main; |
||
| 14 | |||
| 15 | public function __construct() |
||
| 16 | { |
||
| 17 | $this->main = new Main(); |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Checks whether the user has access to this toolbar item. |
||
| 22 | * |
||
| 23 | * @return bool true if user has access, false if not |
||
| 24 | */ |
||
| 25 | public function checkAccess() |
||
| 26 | { |
||
| 27 | return $this->main->isToolbarItemShown(); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Renders the toolbar icon. |
||
| 32 | * |
||
| 33 | * @return string HTML |
||
| 34 | */ |
||
| 35 | public function getItem() |
||
| 36 | { |
||
| 37 | return $this->main->renderToolbarItem(); |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Renders the drop down. |
||
| 42 | * |
||
| 43 | * @return string HTML |
||
| 44 | */ |
||
| 45 | public function getDropDown() |
||
| 46 | { |
||
| 47 | return ''; |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * No additional attributes. |
||
| 52 | * |
||
| 53 | * @return array List item HTML attributes |
||
| 54 | */ |
||
| 55 | public function getAdditionalAttributes() |
||
| 56 | { |
||
| 57 | return []; |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * This item has a drop down. |
||
| 62 | * |
||
| 63 | * @return bool |
||
| 64 | */ |
||
| 65 | public function hasDropDown() |
||
| 66 | { |
||
| 67 | return false; |
||
| 68 | } |
||
| 69 | |||
| 70 | /** |
||
| 71 | * Position relative to others. |
||
| 72 | * |
||
| 73 | * @return int |
||
| 74 | */ |
||
| 75 | public function getIndex() |
||
| 78 | } |
||
| 79 | } |
||
| 80 |