Commit 5d9652bc authored by Dries's avatar Dries

Issue #2031341 by jenlampton: Move theme_container() into theme.inc.

parent 58de5374
......@@ -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.
*
......
......@@ -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".
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment