Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simple_terms_and_menus
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
simple_terms_and_menus
Commits
80321297
Commit
80321297
authored
2 years ago
by
Tim Diels
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3308534
by tim-diels: Adding translation is not showing the whole table
parent
b0dcbcd5
No related branches found
No related tags found
1 merge request
!4
Issue #3308534: Adding translation is not showing the whole table
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
simple_terms_and_menus.module
+17
-14
17 additions, 14 deletions
simple_terms_and_menus.module
with
17 additions
and
14 deletions
simple_terms_and_menus.module
+
17
−
14
View file @
80321297
...
...
@@ -47,12 +47,12 @@ function simple_terms_and_menus_form_alter(&$form, FormStateInterface $form_stat
// Alter menu links form to open in dialogs.
if
(
$form_id
==
'menu_edit_form'
)
{
foreach
(
$form
[
'links'
][
'links'
]
as
$key
=>
$
item
)
{
if
(
substr
(
$key
,
0
,
14
)
==
'menu_plugin_id'
)
{
foreach
(
$form
[
'links'
][
'links'
]
as
$
link_
key
=>
$
link_info
)
{
if
(
substr
(
$
link_
key
,
0
,
14
)
==
'menu_plugin_id'
)
{
$items
=
[
'edit'
,
'delete'
];
foreach
(
$items
as
$item
)
{
if
(
isset
(
$form
[
'links'
][
'links'
][
$key
][
'operations'
][
'#links'
][
$item
]))
{
$form
[
'links'
][
'links'
][
$key
][
'operations'
][
'#links'
][
$item
][
'attributes'
]
=
[
if
(
isset
(
$form
[
'links'
][
'links'
][
$
link_
key
][
'operations'
][
'#links'
][
$item
]))
{
$form
[
'links'
][
'links'
][
$
link_
key
][
'operations'
][
'#links'
][
$item
][
'attributes'
]
=
[
'class'
=>
[
'use-ajax'
],
'data-dialog-type'
=>
'modal'
,
'data-dialog-options'
=>
json_encode
([
...
...
@@ -67,16 +67,19 @@ function simple_terms_and_menus_form_alter(&$form, FormStateInterface $form_stat
// Alter taxonomy term links form to open in dialogs.
if
(
$form_id
==
'taxonomy_overview_terms'
)
{
foreach
(
$form
[
'terms'
]
as
$key
=>
$item
)
{
if
(
is_array
(
$item
)
&&
isset
(
$item
[
'#term'
])
&&
isset
(
$form
[
'terms'
][
$key
][
'operations'
][
'#links'
]))
{
foreach
(
$form
[
'terms'
][
$key
][
'operations'
][
'#links'
]
as
$operation
=>
$link
)
{
$form
[
'terms'
][
$key
][
'operations'
][
'#links'
][
$operation
][
'attributes'
]
=
[
'class'
=>
[
'use-ajax'
],
'data-dialog-type'
=>
'modal'
,
'data-dialog-options'
=>
json_encode
([
'width'
=>
450
,
]),
];
foreach
(
$form
[
'terms'
]
as
$term_key
=>
$term_info
)
{
if
(
is_array
(
$term_info
)
&&
isset
(
$term_info
[
'#term'
])
&&
isset
(
$form
[
'terms'
][
$term_key
][
'operations'
][
'#links'
]))
{
$items
=
[
'edit'
,
'delete'
];
foreach
(
$items
as
$item
)
{
if
(
isset
(
$form
[
'terms'
][
$term_key
][
'operations'
][
'#links'
][
$item
]))
{
$form
[
'terms'
][
$term_key
][
'operations'
][
'#links'
][
$item
][
'attributes'
]
=
[
'class'
=>
[
'use-ajax'
],
'data-dialog-type'
=>
'modal'
,
'data-dialog-options'
=>
json_encode
([
'width'
=>
450
,
]),
];
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment