diff --git a/core/includes/pager.inc b/core/includes/pager.inc
index 91532e3..c1f87c1 100644
--- a/core/includes/pager.inc
+++ b/core/includes/pager.inc
@@ -237,14 +237,14 @@ function theme_pager($variables) {
if ($pager_total[$element] > 1) {
if ($li_first) {
$items[] = array(
- 'class' => array('pager-first'),
- 'data' => $li_first,
+ '#wrapper_attributes' => array('class' => array('pager-first')),
+ '#markup' => $li_first,
);
}
if ($li_previous) {
$items[] = array(
- 'class' => array('pager-previous'),
- 'data' => $li_previous,
+ '#wrapper_attributes' => array('class' => array('pager-previous')),
+ '#markup' => $li_previous,
);
}
@@ -252,16 +252,16 @@ function theme_pager($variables) {
if ($i != $pager_max) {
if ($i > 1) {
$items[] = array(
- 'class' => array('pager-ellipsis'),
- 'data' => '…',
+ '#wrapper_attributes' => array('class' => array('pager-ellipsis')),
+ '#markup' => '…',
);
}
// Now generate the actual pager piece.
for (; $i <= $pager_last && $i <= $pager_max; $i++) {
if ($i < $pager_current) {
$items[] = array(
- 'class' => array('pager-item'),
- 'data' => theme('pager_link', array(
+ '#wrapper_attributes' => array('class' => array('pager-item')),
+ '#markup' => theme('pager_link', array(
'text' => $i,
'page_new' => pager_load_array($i - 1, $element, $pager_page_array),
'element' => $element,
@@ -272,14 +272,14 @@ function theme_pager($variables) {
}
if ($i == $pager_current) {
$items[] = array(
- 'class' => array('pager-current'),
- 'data' => $i,
+ '#wrapper_attributes' => array('class' => array('pager-current')),
+ '#markup' => $i,
);
}
if ($i > $pager_current) {
$items[] = array(
- 'class' => array('pager-item'),
- 'data' => theme('pager_link', array(
+ '#wrapper_attributes' => array('class' => array('pager-item')),
+ '#markup' => theme('pager_link', array(
'text' => $i,
'page_new' => pager_load_array($i - 1, $element, $pager_page_array),
'element' => $element,
@@ -291,22 +291,22 @@ function theme_pager($variables) {
}
if ($i < $pager_max) {
$items[] = array(
- 'class' => array('pager-ellipsis'),
- 'data' => '…',
+ '#wrapper_attributes' => array('class' => array('pager-ellipsis')),
+ '#markup' => '…',
);
}
}
// End generation.
if ($li_next) {
$items[] = array(
- 'class' => array('pager-next'),
- 'data' => $li_next,
+ '#wrapper_attributes' => array('class' => array('pager-next')),
+ '#markup' => $li_next,
);
}
if ($li_last) {
$items[] = array(
- 'class' => array('pager-last'),
- 'data' => $li_last,
+ '#wrapper_attributes' => array('class' => array('pager-last')),
+ '#markup' => $li_last,
);
}
return '
' . t('Pages') . '
' . theme('item_list', array(
diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index cc29a98..c8526ea 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -2078,15 +2078,9 @@ function theme_mark($variables) {
*
* @param $variables
* An associative array containing:
- * - items: A list of items to render. String values are rendered as is. Each
- * item can also be an associative array containing:
- * - data: The string content of the list item.
- * - children: A list of nested child items to render that behave
- * identically to 'items', but any non-numeric string keys are treated as
- * HTML attributes for the child list that wraps 'children'.
- * - type: The type of list to return (e.g. "ul", "ol").
- * Any other key/value pairs are used as HTML attributes for the list item
- * in 'data'.
+ * - items: A list of items to render. Allowed values are strings or
+ * renderable arrays. Additionally, the key #wrapper_attributes can be used
+ * to specify attributes for the wrapping li tag.
* - title: The title of the list.
* - type: The type of list to return (e.g. "ul", "ol").
* - attributes: The attributes applied to the list element.
@@ -2103,38 +2097,13 @@ function theme_item_list($variables) {
$num_items = count($items);
$i = 0;
- foreach ($items as $key => $item) {
+ foreach ($items as $item) {
$i++;
- $attributes = array();
-
+ // @todo Support attributes on the li tag? How?
if (is_array($item)) {
- $value = '';
- if (isset($item['data'])) {
- $value .= $item['data'];
- }
- $attributes = array_diff_key($item, array('data' => 0, 'children' => 0, 'type' => 0));
-
- // Append nested child list, if any.
- if (isset($item['children'])) {
- // HTML attributes for the outer list are defined in the 'attributes'
- // theme variable, but not inherited by children. For nested lists,
- // all non-numeric keys in 'children' are used as list attributes.
- $child_list_attributes = array();
- foreach ($item['children'] as $child_key => $child_item) {
- if (is_string($child_key)) {
- $child_list_attributes[$child_key] = $child_item;
- unset($item['children'][$child_key]);
- }
- }
- $value .= theme('item_list', array(
- 'items' => $item['children'],
- 'type' => (isset($item['type']) ? $item['type'] : $type),
- 'attributes' => $child_list_attributes,
- ));
- }
- }
- else {
- $value = $item;
+ $attributes = isset($item['#wrapper_attributes']) ? $item['#wrapper_attributes'] : array();
+ unset($item['#wrapper_attributes']);
+ $item = drupal_render($item);
}
$attributes['class'][] = ($i % 2 ? 'odd' : 'even');
@@ -2145,7 +2114,7 @@ function theme_item_list($variables) {
$attributes['class'][] = 'last';
}
- $output .= '' . $value . '';
+ $output .= '' . $item . '';
}
$output .= "$type>";
}
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index ea3dadc..dbfee54 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -4168,7 +4168,7 @@ function theme_exposed_filters($variables) {
if (isset($form['current'])) {
$items = array();
foreach (element_children($form['current']) as $key) {
- $items[] = drupal_render($form['current'][$key]);
+ $items[] = $form['current'][$key];
}
$output .= theme('item_list', array('items' => $items, 'attributes' => array('class' => array('clearfix', 'current-filters'))));
}