Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
5d9652bc
Commit
5d9652bc
authored
Jun 30, 2013
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2031341
by jenlampton: Move theme_container() into theme.inc.
parent
58de5374
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
30 deletions
+30
-30
core/includes/form.inc
core/includes/form.inc
+0
-30
core/includes/theme.inc
core/includes/theme.inc
+30
-0
No files found.
core/includes/form.inc
View file @
5d9652bc
...
...
@@ -3429,36 +3429,6 @@ function form_process_container($element, &$form_state) {
return
$element
;
}
/**
* Returns HTML to wrap child elements in a container.
*
* Used for grouped form items. Can also be used as a #theme_wrapper for any
* renderable element, to surround it with a <div> and add attributes such as
* classes or an HTML id.
*
* @param $variables
* An associative array containing:
* - element: An associative array containing the properties of the element.
* Properties used: #id, #attributes, #children.
*
* @ingroup themeable
*/
function
theme_container
(
$variables
)
{
$element
=
$variables
[
'element'
];
// Special handling for form elements.
if
(
isset
(
$element
[
'#array_parents'
]))
{
// Assign an html ID.
if
(
!
isset
(
$element
[
'#attributes'
][
'id'
]))
{
$element
[
'#attributes'
][
'id'
]
=
$element
[
'#id'
];
}
// Add the 'form-wrapper' class.
$element
[
'#attributes'
][
'class'
][]
=
'form-wrapper'
;
}
return
'<div'
.
new
Attribute
(
$element
[
'#attributes'
])
.
'>'
.
$element
[
'#children'
]
.
'</div>'
;
}
/**
* Returns HTML for a table with radio buttons or checkboxes.
*
...
...
core/includes/theme.inc
View file @
5d9652bc
...
...
@@ -2418,6 +2418,36 @@ function theme_indentation($variables) {
return
$output
;
}
/**
* Returns HTML to wrap child elements in a container.
*
* Used for grouped form items. Can also be used as a #theme_wrapper for any
* renderable element, to surround it with a <div> and add attributes such as
* classes or an HTML id.
*
* @param $variables
* An associative array containing:
* - element: An associative array containing the properties of the element.
* Properties used: #id, #attributes, #children.
*
* @ingroup themeable
*/
function
theme_container
(
$variables
)
{
$element
=
$variables
[
'element'
];
// Special handling for form elements.
if
(
isset
(
$element
[
'#array_parents'
]))
{
// Assign an html ID.
if
(
!
isset
(
$element
[
'#attributes'
][
'id'
]))
{
$element
[
'#attributes'
][
'id'
]
=
$element
[
'#id'
];
}
// Add the 'form-wrapper' class.
$element
[
'#attributes'
][
'class'
][]
=
'form-wrapper'
;
}
return
'<div'
.
new
Attribute
(
$element
[
'#attributes'
])
.
'>'
.
$element
[
'#children'
]
.
'</div>'
;
}
/**
* @} End of "addtogroup themeable".
*/
...
...
Write
Preview
Markdown
is supported
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