Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gin
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
gin
Commits
c08d9ee1
Commit
c08d9ee1
authored
3 months ago
by
Shivam-Innoraft
Browse files
Options
Downloads
Patches
Plain Diff
Updated files according to comments.
parent
15a44016
Branches
Branches containing commit
Tags
8.3.2
8.x-3.2
Tags containing commit
1 merge request
!591
Gin Settings Using static text that does not support translation.
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/GinAfterBuild.php
+2
-2
2 additions, 2 deletions
src/GinAfterBuild.php
src/GinContentFormHelper.php
+4
-4
4 additions, 4 deletions
src/GinContentFormHelper.php
src/GinNavigation.php
+16
-16
16 additions, 16 deletions
src/GinNavigation.php
with
22 additions
and
22 deletions
src/GinAfterBuild.php
+
2
−
2
View file @
c08d9ee1
...
...
@@ -33,12 +33,12 @@ class GinAfterBuild implements TrustedCallbackInterface {
$value
=
$element
[
'#options'
][
$value
];
}
if
(
$element
[
'#type'
]
===
'checkbox'
)
{
$value
=
$value
?
$this
->
t
(
'Enabled'
)
:
$this
->
t
(
'Disabled'
);
$value
=
$value
?
t
(
'Enabled'
)
:
t
(
'Disabled'
);
}
$element
+=
[
'#description'
=>
''
];
$element
[
'#description'
]
.
=
'<span class="form-item__warning">'
.
$this
->
t
(
'This setting is overridden by the <a href=":editUrl">current user</a>. @title: %value'
,
t
(
'This setting is overridden by the <a href=":editUrl">current user</a>. @title: %value'
,
[
'@title'
=>
$element
[
'#title'
],
'%value'
=>
$value
,
...
...
This diff is collapsed.
Click to expand it.
src/GinContentFormHelper.php
+
4
−
4
View file @
c08d9ee1
...
...
@@ -138,7 +138,7 @@ class GinContentFormHelper implements ContainerInjectionInterface {
];
// Create gin_more_actions group.
$toggle_more_actions
=
$this
->
t
(
'More actions'
);
$toggle_more_actions
=
t
(
'More actions'
);
$form
[
'gin_sticky_actions'
][
'more_actions'
]
=
[
'#type'
=>
'container'
,
'#multilingual'
=>
TRUE
,
...
...
@@ -181,7 +181,7 @@ class GinContentFormHelper implements ContainerInjectionInterface {
// Helper item to move focus to sticky header.
$form
[
'gin_move_focus_to_sticky_bar'
]
=
[
'#markup'
=>
'<a href="#" class="visually-hidden" role="button" gin-move-focus-to-sticky-bar>'
.
$this
->
t
(
'Moves focus to sticky header actions'
)
.
'</a>'
,
'#markup'
=>
'<a href="#" class="visually-hidden" role="button" gin-move-focus-to-sticky-bar>'
.
t
(
'Moves focus to sticky header actions'
)
.
'</a>'
,
'#weight'
=>
999
,
];
...
...
@@ -222,7 +222,7 @@ class GinContentFormHelper implements ContainerInjectionInterface {
// Action buttons.
if
(
isset
(
$form
[
'actions'
]))
{
// Add sidebar toggle.
$hide_panel
=
$this
->
t
(
'Hide sidebar panel'
);
$hide_panel
=
t
(
'Hide sidebar panel'
);
$form
[
'gin_sticky_actions'
][
'gin_sidebar_toggle'
]
=
[
'#markup'
=>
'<a href="#toggle-sidebar" class="meta-sidebar__trigger trigger" data-gin-tooltip role="button" title="'
.
$hide_panel
.
'" aria-controls="gin_sidebar"><span class="visually-hidden">'
.
$hide_panel
.
'</span></a>'
,
'#weight'
=>
1000
,
...
...
@@ -245,7 +245,7 @@ class GinContentFormHelper implements ContainerInjectionInterface {
$form
[
'gin_sidebar'
][
'footer'
]
=
(
$form
[
'footer'
])
??
[];
// Sidebar close button.
$close_sidebar_translation
=
$this
->
t
(
'Close sidebar panel'
);
$close_sidebar_translation
=
t
(
'Close sidebar panel'
);
$form
[
'gin_sidebar'
][
'gin_sidebar_close'
]
=
[
'#markup'
=>
'<a href="#close-sidebar" class="meta-sidebar__close trigger" data-gin-tooltip role="button" title="'
.
$close_sidebar_translation
.
'"><span class="visually-hidden">'
.
$close_sidebar_translation
.
'</span></a>'
,
];
...
...
This diff is collapsed.
Click to expand it.
src/GinNavigation.php
+
16
−
16
View file @
c08d9ee1
...
...
@@ -54,7 +54,7 @@ class GinNavigation implements ContainerInjectionInterface {
// Remove content and help from admin menu.
unset
(
$build
[
'#items'
][
'system.admin_content'
]);
unset
(
$build
[
'#items'
][
'help.main'
]);
$build
[
'#title'
]
=
$this
->
t
(
'Administration'
);
$build
[
'#title'
]
=
t
(
'Administration'
);
return
$build
;
}
...
...
@@ -68,7 +68,7 @@ class GinNavigation implements ContainerInjectionInterface {
$shortcuts
=
\Drupal
::
service
(
'shortcut.lazy_builders'
)
->
lazyLinks
()[
'shortcuts'
];
$shortcuts
[
'#theme'
]
=
'menu_region__top'
;
$shortcuts
[
'#menu_name'
]
=
'bookmarks'
;
$shortcuts
[
'#title'
]
=
$this
->
t
(
'Bookmarks'
);
$shortcuts
[
'#title'
]
=
t
(
'Bookmarks'
);
return
$shortcuts
;
}
else
{
...
...
@@ -122,7 +122,7 @@ class GinNavigation implements ContainerInjectionInterface {
$create_type_items
,
[
[
'title'
=>
$this
->
t
(
'Blocks'
),
'title'
=>
t
(
'Blocks'
),
'class'
=>
'blocks'
,
'url'
=>
''
,
'below'
=>
$block_type_items
,
...
...
@@ -148,7 +148,7 @@ class GinNavigation implements ContainerInjectionInterface {
$create_type_items
,
[
[
'title'
=>
$this
->
t
(
'Media'
),
'title'
=>
t
(
'Media'
),
'class'
=>
'media'
,
'url'
=>
''
,
'below'
=>
$media_type_items
,
...
...
@@ -174,7 +174,7 @@ class GinNavigation implements ContainerInjectionInterface {
$create_type_items
,
[
[
'title'
=>
$this
->
t
(
'Taxonomy'
),
'title'
=>
t
(
'Taxonomy'
),
'class'
=>
'taxonomy'
,
'url'
=>
''
,
'below'
=>
$taxonomy_type_items
,
...
...
@@ -189,7 +189,7 @@ class GinNavigation implements ContainerInjectionInterface {
// Generate menu items.
$create_items
[
'create'
]
=
[
'title'
=>
$this
->
t
(
'Create'
),
'title'
=>
t
(
'Create'
),
'class'
=>
'create'
,
'url'
=>
$create_item_url
,
'below'
=>
$create_type_items
,
...
...
@@ -199,7 +199,7 @@ class GinNavigation implements ContainerInjectionInterface {
'#theme'
=>
'menu_region__middle'
,
'#items'
=>
$create_items
,
'#menu_name'
=>
'create'
,
'#title'
=>
$this
->
t
(
'Create Navigation'
),
'#title'
=>
t
(
'Create Navigation'
),
];
}
...
...
@@ -214,7 +214,7 @@ class GinNavigation implements ContainerInjectionInterface {
// Get Content menu item.
if
(
$entity_type_manager
->
hasDefinition
(
'node'
))
{
$create_content_items
[
'content'
]
=
[
'title'
=>
$this
->
t
(
'Content'
),
'title'
=>
t
(
'Content'
),
'class'
=>
'content'
,
'url'
=>
Url
::
fromRoute
(
'system.admin_content'
)
->
toString
(),
];
...
...
@@ -223,7 +223,7 @@ class GinNavigation implements ContainerInjectionInterface {
// Get Blocks menu item.
if
(
$entity_type_manager
->
hasDefinition
(
'block_content'
))
{
$create_content_items
[
'blocks'
]
=
[
'title'
=>
$this
->
t
(
'Blocks'
),
'title'
=>
t
(
'Blocks'
),
'class'
=>
'blocks'
,
'url'
=>
Url
::
fromRoute
(
'entity.block_content.collection'
)
->
toString
(),
];
...
...
@@ -232,7 +232,7 @@ class GinNavigation implements ContainerInjectionInterface {
// Get File menu item.
if
(
$entity_type_manager
->
hasDefinition
(
'file'
))
{
$create_content_items
[
'files'
]
=
[
'title'
=>
$this
->
t
(
'Files'
),
'title'
=>
t
(
'Files'
),
'class'
=>
'files'
,
'url'
=>
'/admin/content/files'
,
];
...
...
@@ -241,7 +241,7 @@ class GinNavigation implements ContainerInjectionInterface {
// Get Media menu item.
if
(
$entity_type_manager
->
hasDefinition
(
'media'
))
{
$create_content_items
[
'media'
]
=
[
'title'
=>
$this
->
t
(
'Media'
),
'title'
=>
t
(
'Media'
),
'class'
=>
'media'
,
'url'
=>
'/admin/content/media'
,
];
...
...
@@ -251,7 +251,7 @@ class GinNavigation implements ContainerInjectionInterface {
'#theme'
=>
'menu_region__middle'
,
'#items'
=>
$create_content_items
,
'#menu_name'
=>
'content'
,
'#title'
=>
$this
->
t
(
'Content Navigation'
),
'#title'
=>
t
(
'Content Navigation'
),
];
}
...
...
@@ -261,17 +261,17 @@ class GinNavigation implements ContainerInjectionInterface {
public
function
getMenuNavigationUserItems
():
array
{
$user_items
=
[
[
'title'
=>
$this
->
t
(
'Profile'
),
'title'
=>
t
(
'Profile'
),
'class'
=>
'profile'
,
'url'
=>
Url
::
fromRoute
(
'user.page'
)
->
toString
(),
],
[
'title'
=>
$this
->
t
(
'Settings'
),
'title'
=>
t
(
'Settings'
),
'class'
=>
'settings'
,
'url'
=>
Url
::
fromRoute
(
'entity.user.admin_form'
)
->
toString
(),
],
[
'title'
=>
$this
->
t
(
'Log out'
),
'title'
=>
t
(
'Log out'
),
'class'
=>
'logout'
,
'url'
=>
Url
::
fromRoute
(
'user.logout'
)
->
toString
(),
],
...
...
@@ -280,7 +280,7 @@ class GinNavigation implements ContainerInjectionInterface {
'#theme'
=>
'menu_region__bottom'
,
'#items'
=>
$user_items
,
'#menu_name'
=>
'user'
,
'#title'
=>
$this
->
t
(
'User'
),
'#title'
=>
t
(
'User'
),
];
}
...
...
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