Commit 088b191c authored by alexpott's avatar alexpott

Issue #1828536 by sun, thedavidmeister, benjf, derek.deraps, jenlampton, dcam,...

Issue #1828536 by sun, thedavidmeister, benjf, derek.deraps, jenlampton, dcam, pwieck: Rename 'type' variable of theme_item_list() to 'list_type'.
parent 972bdf17
...@@ -2275,7 +2275,7 @@ function template_preprocess_item_list(&$variables) { ...@@ -2275,7 +2275,7 @@ function template_preprocess_item_list(&$variables) {
} }
// Lastly, inherit the original theme variables of the current list. // Lastly, inherit the original theme variables of the current list.
$child['#theme'] = $variables['theme_hook_original']; $child['#theme'] = $variables['theme_hook_original'];
$child['#type'] = $variables['type']; $child['#list_type'] = $variables['list_type'];
} }
} }
} }
...@@ -2291,19 +2291,18 @@ function template_preprocess_item_list(&$variables) { ...@@ -2291,19 +2291,18 @@ function template_preprocess_item_list(&$variables) {
* render arrays. Render arrays can specify list item attributes in the * render arrays. Render arrays can specify list item attributes in the
* #wrapper_attributes property. * #wrapper_attributes property.
* - title: The title of the list. * - title: The title of the list.
* - type: The type of list to return (e.g. "ul", "ol"). * - list_type: The type of HTML list (e.g. "ul", "ol").
* - attributes: The attributes applied to the list element. * - attributes: The attributes applied to the list element.
*/ */
function theme_item_list($variables) { function theme_item_list($variables) {
$items = $variables['items']; $items = $variables['items'];
$title = (string) $variables['title']; $title = (string) $variables['title'];
// @todo 'type' clashes with '#type'. Rename to 'tag'. $list_type = $variables['list_type'];
$type = $variables['type'];
$list_attributes = $variables['attributes']; $list_attributes = $variables['attributes'];
$output = ''; $output = '';
if ($items) { if ($items) {
$output .= '<' . $type . new Attribute($list_attributes) . '>'; $output .= '<' . $list_type . new Attribute($list_attributes) . '>';
$num_items = count($items); $num_items = count($items);
$i = 0; $i = 0;
...@@ -2325,7 +2324,7 @@ function theme_item_list($variables) { ...@@ -2325,7 +2324,7 @@ function theme_item_list($variables) {
} }
$output .= '<li' . new Attribute($attributes) . '>' . $item . '</li>'; $output .= '<li' . new Attribute($attributes) . '>' . $item . '</li>';
} }
$output .= "</$type>"; $output .= "</$list_type>";
} }
// Only output the list container and title, if there are any list items. // Only output the list container and title, if there are any list items.
...@@ -3130,7 +3129,7 @@ function drupal_common_theme() { ...@@ -3130,7 +3129,7 @@ function drupal_common_theme() {
'variables' => array('mark_type' => MARK_NEW), 'variables' => array('mark_type' => MARK_NEW),
), ),
'item_list' => array( 'item_list' => array(
'variables' => array('items' => array(), 'title' => '', 'type' => 'ul', 'attributes' => array()), 'variables' => array('items' => array(), 'title' => '', 'list_type' => 'ul', 'attributes' => array()),
), ),
'more_help_link' => array( 'more_help_link' => array(
'variables' => array('url' => NULL), 'variables' => array('url' => NULL),
......
...@@ -629,7 +629,7 @@ protected function renderItems($items) { ...@@ -629,7 +629,7 @@ protected function renderItems($items) {
array( array(
'items' => $items, 'items' => $items,
'title' => NULL, 'title' => NULL,
'type' => $this->options['multi_type'] 'list_type' => $this->options['multi_type'],
)); ));
} }
} }
......
...@@ -54,7 +54,7 @@ function testItemList() { ...@@ -54,7 +54,7 @@ function testItemList() {
'childlist' => array( 'childlist' => array(
'#theme' => 'item_list', '#theme' => 'item_list',
'#attributes' => array('id' => 'blist'), '#attributes' => array('id' => 'blist'),
'#type' => 'ol', '#list_type' => 'ol',
'#items' => array( '#items' => array(
'ba', 'ba',
array( array(
......
...@@ -56,7 +56,7 @@ public function viewMultiple(array $entities = array(), $view_mode = 'full', $la ...@@ -56,7 +56,7 @@ public function viewMultiple(array $entities = array(), $view_mode = 'full', $la
$build[$entity_id] = array( $build[$entity_id] = array(
'#theme' => 'item_list', '#theme' => 'item_list',
'#items' => $list_items, '#items' => $list_items,
'#type' => 'ol', '#list_type' => 'ol',
'#attributes' => array( '#attributes' => array(
'id' => 'tour', 'id' => 'tour',
'class' => array( 'class' => array(
......
...@@ -1705,7 +1705,7 @@ public function buildOptionsForm(&$form, &$form_state) { ...@@ -1705,7 +1705,7 @@ public function buildOptionsForm(&$form, &$form_state) {
$item_list = array( $item_list = array(
'#theme' => 'item_list', '#theme' => 'item_list',
'#items' => $items, '#items' => $items,
'#type' => $type, '#list_type' => $type,
); );
$output .= drupal_render($item_list); $output .= drupal_render($item_list);
} }
......
...@@ -873,7 +873,7 @@ public function buildOptionsForm(&$form, &$form_state) { ...@@ -873,7 +873,7 @@ public function buildOptionsForm(&$form, &$form_state) {
$item_list = array( $item_list = array(
'#theme' => 'item_list', '#theme' => 'item_list',
'#items' => $items, '#items' => $items,
'#type' => $type, '#list_type' => $type,
); );
$output .= drupal_render($item_list); $output .= drupal_render($item_list);
} }
......
...@@ -83,7 +83,7 @@ protected function renderItems($items) { ...@@ -83,7 +83,7 @@ protected function renderItems($items) {
'#theme' => 'item_list', '#theme' => 'item_list',
'#items' => $items, '#items' => $items,
'#title' => NULL, '#title' => NULL,
'#type' => $this->options['type'], '#list_type' => $this->options['type'],
); );
return drupal_render($item_list); return drupal_render($item_list);
} }
......
...@@ -1201,7 +1201,7 @@ function theme_views_mini_pager($vars) { ...@@ -1201,7 +1201,7 @@ function theme_views_mini_pager($vars) {
'#theme' => 'item_list', '#theme' => 'item_list',
'#items' => $items, '#items' => $items,
'#title' => NULL, '#title' => NULL,
'#type' => 'ul', '#list_type' => 'ul',
'#attributes' => array( '#attributes' => array(
'class' => array('pager'), 'class' => array('pager'),
), ),
......
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