Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
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
drupal
Commits
e8f1ce11
Commit
e8f1ce11
authored
10 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2151105
by Cottser, longwave, joelpittet: Convert theme_system_admin_index() to Twig.
parent
a1ca5f6e
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/modules/system/system.admin.inc
+21
-43
21 additions, 43 deletions
core/modules/system/system.admin.inc
core/modules/system/system.module
+1
-0
1 addition, 0 deletions
core/modules/system/system.module
with
22 additions
and
43 deletions
core/modules/system/system.admin.inc
+
21
−
43
View file @
e8f1ce11
...
@@ -102,62 +102,40 @@ function template_preprocess_admin_page(&$variables) {
...
@@ -102,62 +102,40 @@ function template_preprocess_admin_page(&$variables) {
}
}
/**
/**
* Returns HTML for the output of the admin index page.
* Prepares variables for admin index templates.
*
* Default template: system-admin-index.html.twig.
*
*
* @param $variables
* @param $variables
* An associative array containing:
* An associative array containing:
* - menu_items: An array of modules to be displayed.
* - menu_items: An array of modules to be displayed.
*
* @ingroup themeable
*/
*/
function
theme_system_admin_index
(
$variables
)
{
function
template_preprocess_system_admin_index
(
&
$variables
)
{
$menu_items
=
$variables
[
'menu_items'
];
$variables
[
'system_compact_link'
]
=
array
(
'#theme'
=>
'system_compact_link'
,
$container
=
array
(
'left'
=>
''
,
'right'
=>
''
);
);
$flip
=
array
(
'left'
=>
'right'
,
'right'
=>
'left'
);
$variables
[
'containers'
]
=
array
();
$position
=
'left'
;
$stripe
=
0
;
// Iterate over all modules.
// Iterate over all modules.
foreach
(
$menu_items
as
$module
=>
$block
)
{
foreach
(
$
variables
[
'
menu_items
'
]
as
$module
=>
$block
)
{
list
(
$description
,
$items
)
=
$block
;
list
(
$description
,
$items
)
=
$block
;
$position
=
++
$stripe
%
2
?
'left'
:
'right'
;
// Output links.
// Output links.
if
(
count
(
$items
))
{
if
(
count
(
$items
))
{
$admin_block_content
=
array
(
$variables
[
'containers'
][
$position
][]
=
array
(
'#theme'
=>
'admin_block_content'
,
'#content'
=>
$items
,
);
$block
=
array
();
$block
[
'title'
]
=
$module
;
$block
[
'content'
]
=
drupal_render
(
$admin_block_content
);
$block
[
'description'
]
=
t
(
$description
);
$admin_block
=
array
(
'#theme'
=>
'admin_block'
,
'#theme'
=>
'admin_block'
,
'#block'
=>
$block
,
'#block'
=>
array
(
'position'
=>
$position
,
'title'
=>
$module
,
'content'
=>
array
(
'#theme'
=>
'admin_block_content'
,
'#content'
=>
$items
,
),
'description'
=>
t
(
$description
),
),
);
);
if
(
$block_output
=
drupal_render
(
$admin_block
))
{
if
(
!
isset
(
$block
[
'position'
]))
{
// Perform automatic striping.
$block
[
'position'
]
=
$position
;
$position
=
$flip
[
$position
];
}
$container
[
$block
[
'position'
]]
.
=
$block_output
;
}
}
}
}
}
$system_compact_link
=
array
(
'#theme'
=>
'system_compact_link'
);
$output
=
'<div class="admin clearfix">'
;
$output
.
=
drupal_render
(
$system_compact_link
);
foreach
(
$container
as
$id
=>
$data
)
{
$output
.
=
'<div class="'
.
$id
.
' clearfix">'
;
$output
.
=
$data
;
$output
.
=
'</div>'
;
}
$output
.
=
'</div>'
;
return
$output
;
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
core/modules/system/system.module
+
1
−
0
View file @
e8f1ce11
...
@@ -196,6 +196,7 @@ function system_theme() {
...
@@ -196,6 +196,7 @@ function system_theme() {
'system_admin_index'
=>
array
(
'system_admin_index'
=>
array
(
'variables'
=>
array
(
'menu_items'
=>
NULL
),
'variables'
=>
array
(
'menu_items'
=>
NULL
),
'file'
=>
'system.admin.inc'
,
'file'
=>
'system.admin.inc'
,
'template'
=>
'system-admin-index'
,
),
),
'system_compact_link'
=>
array
(
'system_compact_link'
=>
array
(
'variables'
=>
array
(),
'variables'
=>
array
(),
...
...
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