1 | <?php |
||
31 | abstract class AbstractMenuTwigExtension extends AbstractTwigExtension { |
||
32 | |||
33 | use TranslatorTrait; |
||
34 | |||
35 | /** |
||
36 | * Constructor. |
||
37 | * |
||
38 | * @param Environment $twigEnvironment The Twig environment. |
||
39 | * @param BaseTranslatorInterface $translator The translator. |
||
40 | */ |
||
41 | public function __construct(Environment $twigEnvironment, $translator) { |
||
45 | |||
46 | /** |
||
47 | * Displays an AdminBSB menu. |
||
48 | * |
||
49 | * @param NavigationTree $tree The navigation tree. |
||
50 | * @return string Returns the Admin BSB menu. |
||
51 | */ |
||
52 | protected function adminBSBMenu(NavigationTree $tree): string { |
||
62 | |||
63 | /** |
||
64 | * Determines if a node is a menu toggle. |
||
65 | * |
||
66 | * @param NavigationNode $node |
||
67 | * @return bool Returns true in case of success, false otherwise. |
||
68 | */ |
||
69 | protected function isMenuToggle(NavigationNode $node): bool { |
||
80 | |||
81 | /** |
||
82 | * Render an anchor. |
||
83 | * |
||
84 | * @param NavigationNode $node The navigation node. |
||
85 | * @return string Returns the rendered anchor. |
||
86 | */ |
||
87 | private function renderAnchor(NavigationNode $node): string { |
||
103 | |||
104 | /** |
||
105 | * Render a dropdown. |
||
106 | * |
||
107 | * @param NavigationNode $node The navigation node. |
||
108 | * @param array $items The items. |
||
109 | * @return string Returns the rendered dropdown. |
||
110 | */ |
||
111 | private function renderDropdown(NavigationNode $node, array $items): string { |
||
119 | |||
120 | /** |
||
121 | * Render an header node. |
||
122 | * |
||
123 | * @param HeaderNode $node The header node. |
||
124 | * @return string Returns the rendered header node. |
||
125 | */ |
||
126 | private function renderHeader(HeaderNode $node): string { |
||
129 | |||
130 | /** |
||
131 | * Render an icon. |
||
132 | * |
||
133 | * @param NavigationNode $node The navigation node. |
||
134 | * @return string Returns the rendered icon. |
||
135 | */ |
||
136 | private function renderIcon(NavigationNode $node): string { |
||
142 | |||
143 | /** |
||
144 | * Render a navigation node. |
||
145 | * |
||
146 | * @param NavigationNode $node The navigation node. |
||
147 | * @param int $level The level. |
||
148 | * @return string Returns the rendered navigation node. |
||
149 | */ |
||
150 | private function renderNavigation(NavigationNode $node, int $level = 0): string { |
||
169 | |||
170 | /** |
||
171 | * Render a node. |
||
172 | * |
||
173 | * @param AbstractNavigationNode $node The node. |
||
174 | * @param int $level The level. |
||
175 | * @return string Returns the rendered node. |
||
176 | */ |
||
177 | private function renderNode(AbstractNavigationNode $node, int $level = 0): string { |
||
193 | |||
194 | /** |
||
195 | * Render a span. |
||
196 | * |
||
197 | * @param NavigationNode $node The navigation node. |
||
198 | * @return string Returns the rendered span. |
||
199 | */ |
||
200 | private function renderSpan(NavigationNode $node): string { |
||
206 | |||
207 | /** |
||
208 | * Translate. |
||
209 | * |
||
210 | * @param string $id The translation id. |
||
211 | * @return string Returns the translation in case of success, id otherwise. |
||
212 | */ |
||
213 | private function translate(string $id): string { |
||
232 | } |
||
233 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.