Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CSU
tweeki
Commits
9441ca61
Commit
9441ca61
authored
Dec 17, 2019
by
Tobias Haider
Browse files
allow for headers in dropdowns, fixes #152
parent
f4f6c158
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/Hooks.php
View file @
9441ca61
...
...
@@ -327,7 +327,13 @@ class TweekiHooks {
if
(
!
isset
(
$buttons
[
$currentparentkey
][
'items'
]
)
)
{
$buttons
[
$currentparentkey
][
'items'
]
=
array
();
}
$buttons
[
$currentparentkey
][
'items'
]
=
array_merge
(
$buttons
[
$currentparentkey
][
'items'
],
TweekiHooks
::
parseButtonLink
(
$cleanline
,
$parser
,
$frame
)
);
// dropdown-headers (dropdown-lines that start with a colon)
if
(
strpos
(
$cleanline
,
':'
)
===
0
)
{
$buttons
[
$currentparentkey
][
'items'
][]
=
[
'text'
=>
ltrim
(
$cleanline
,
':'
),
'header'
=>
true
];
}
else
{
$buttons
[
$currentparentkey
][
'items'
]
=
array_merge
(
$buttons
[
$currentparentkey
][
'items'
],
TweekiHooks
::
parseButtonLink
(
$cleanline
,
$parser
,
$frame
)
);
}
}
}
return
$buttons
;
...
...
@@ -366,7 +372,7 @@ class TweekiHooks {
return
$semanticLinks
;
}
else
{
$text
=
'
broken
'
;
$text
=
'
INVALID-TITLE/QUERY-BROKEN
'
;
}
}
...
...
@@ -670,6 +676,11 @@ class TweekiHooks {
$renderedMenu
.
=
'<li class="divider" />'
;
}
// header
elseif
(
isset
(
$entry
[
'text'
]
)
&&
isset
(
$entry
[
'header'
]
)
&&
$entry
[
'header'
]
)
{
$renderedMenu
.
=
'<li class="dropdown-header">'
.
$entry
[
'text'
]
.
'</li>'
;
}
// standard menu entry
else
{
$entry
[
'tabindex'
]
=
'-1'
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment