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
28f7908f
Commit
28f7908f
authored
18 years ago
by
Neil Drumm
Browse files
Options
Downloads
Patches
Plain Diff
#2039
by Boris Mann ("My first diff to the list"), moshe weitzman, and David Lesieur, nested lists.
parent
a8584f1b
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
CHANGELOG.txt
+1
-0
1 addition, 0 deletions
CHANGELOG.txt
includes/theme.inc
+10
-2
10 additions, 2 deletions
includes/theme.inc
with
11 additions
and
2 deletions
CHANGELOG.txt
+
1
−
0
View file @
28f7908f
...
...
@@ -45,6 +45,7 @@ Drupal x.x.x, xxxx-xx-xx (development version)
- upgrade system:
* created space for update branches.
- split up and removed drupal.css.
- added nested lists generation.
Drupal 4.7.0, 2006-05-01
------------------------
...
...
This diff is collapsed.
Click to expand it.
includes/theme.inc
+
10
−
2
View file @
28f7908f
...
...
@@ -835,8 +835,9 @@ function theme_mark($type = MARK_NEW) {
* @param $items
* An array of items to be displayed in the list. If an item is a string,
* then it is used as is. If an item is an array, then the "data" element of
* the array is used as the contents of the list item and all other elements
* are treated as attributes of the list item element.
* the array is used as the contents of the list item. If an item is an array
* with a "children" element, those children are displayed in a nested list.
* All other elements are treated as attributes of the list item element.
* @param $title
* The title of the list.
* @param $attributes
...
...
@@ -856,11 +857,15 @@ function theme_item_list($items = array(), $title = NULL, $type = 'ul', $attribu
$output
.
=
"<
$type
"
.
drupal_attributes
(
$attributes
)
.
'>'
;
foreach
(
$items
as
$item
)
{
$attributes
=
array
();
$children
=
array
();
if
(
is_array
(
$item
))
{
foreach
(
$item
as
$key
=>
$value
)
{
if
(
$key
==
'data'
)
{
$data
=
$value
;
}
elseif
(
$key
==
'children'
)
{
$children
=
$value
;
}
else
{
$attributes
[
$key
]
=
$value
;
}
...
...
@@ -869,6 +874,9 @@ function theme_item_list($items = array(), $title = NULL, $type = 'ul', $attribu
else
{
$data
=
$item
;
}
if
(
count
(
$children
)
>
0
)
{
$data
.
=
theme_item_list
(
$children
,
NULL
,
$type
,
$attributes
);
// Render nested list
}
$output
.
=
'<li'
.
drupal_attributes
(
$attributes
)
.
'>'
.
$data
.
'</li>'
;
}
$output
.
=
"</
$type
>"
;
...
...
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