diff --git a/core/authorize.php b/core/authorize.php index 114dcd3..01a9905 100644 --- a/core/authorize.php +++ b/core/authorize.php @@ -135,7 +135,7 @@ function authorize_access_allowed() { )); } - $output .= theme('item_list', array('items' => $links, 'title' => t('Next steps'))); + $output .= theme('unordered_list', array('items' => $links, 'title' => t('Next steps'))); } // If a batch is running, let it run. elseif (isset($_GET['batch'])) { diff --git a/core/includes/file.inc b/core/includes/file.inc index 5f54190..3529af0 100644 --- a/core/includes/file.inc +++ b/core/includes/file.inc @@ -1188,7 +1188,7 @@ function file_save_upload($source, $validators = array(), $destination = FALSE, if (!empty($errors)) { $message = t('The specified file %name could not be uploaded.', array('%name' => $file->filename)); if (count($errors) > 1) { - $message .= theme('item_list', array('items' => $errors)); + $message .= theme('unordered_list', array('items' => $errors)); } else { $message .= ' ' . array_pop($errors); diff --git a/core/includes/form.inc b/core/includes/form.inc index 3ebaca1..f781f0b 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -3325,7 +3325,7 @@ function form_pre_render_actions_dropbutton(array $element) { ); } // Add this button to the corresponding dropbutton. - // @todo Change #type 'dropbutton' to be based on theme_item_list() + // @todo Change #type 'dropbutton' to be based on theme_unordered_list() // instead of theme_links() to avoid this preemptive rendering. $button = drupal_render($element[$key]); $dropbuttons[$dropbutton]['#links'][$key] = array( diff --git a/core/includes/pager.inc b/core/includes/pager.inc index 4c497ba..bbe3738 100644 --- a/core/includes/pager.inc +++ b/core/includes/pager.inc @@ -309,7 +309,7 @@ function theme_pager($variables) { '#markup' => $li_last, ); } - return '

' . t('Pages') . '

' . theme('item_list', array( + return '

' . t('Pages') . '

' . theme('unordered_list', array( 'items' => $items, 'attributes' => array('class' => array('pager')), )); diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 8d527df..9b4054d 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2294,17 +2294,35 @@ function theme_mark($variables) { } /** - * Preprocesses variables for theme_item_list(). + * Preprocesses variables for theme_unordered_list(). + */ +function template_preprocess_unordered_list(&$variables) { + $variables = _template_preprocess_list($variables); +} + +/** + * Preprocesses variables for theme_ordered_list(). + */ +function template_preprocess_ordered_list(&$variables) { + $variables = _template_preprocess_list($variables); +} + +/** + * Helper function to prepare variables for unordered or ordered list theme + * functions. * * @param array $variables - * An associative array containing theme variables for theme_item_list(). - * 'items' in variables will be processed to automatically inherit the - * variables of this list to any possibly contained nested lists that do not - * specify custom render properties. This allows callers to specify larger - * nested lists, without having to explicitly specify and repeat the render - * properties for all nested child lists. - */ -function template_preprocess_item_list(&$variables) { + * An associative array containing theme variables for theme_unordered_list() + * and theme_ordered_list(). 'items' in variables will be processed to + * automatically inherit the variables of this list to any possibly contained + * nested lists that do not specify custom render properties. This allows + * callers to specify larger nested lists, without having to explicitly + * specify and repeat the render properties for all nested child lists. + * + * @see template_preprocess_unordered_list() + * @see template_preprocess_ordered_list() + */ +function _template_preprocess_list(&$variables) { foreach ($variables['items'] as &$item) { // If the item value is an array, then it is a render array. if (is_array($item)) { @@ -2316,11 +2334,12 @@ function template_preprocess_item_list(&$variables) { $child = &$item[$key]; // If this child element does not specify how it can be rendered, then // we need to inherit the render properties of the current list. - if (!isset($child['#type']) && !isset($child['#theme']) && !isset($child['#markup'])) { - // Since theme_item_list() supports both strings and render arrays as - // items, the items of the nested list may have been specified as the - // child elements of the nested list, instead of #items. For - // convenience, we automatically move them into #items. + if (!isset($child['#theme']) && !isset($child['#markup'])) { + // Since theme_unordered_list() and theme_ordered_list() support both + // strings and render arrays as items, the items of the nested list + // may have been specified as the child elements of the nested list, + // instead of #items. For convenience, we automatically move them into + // #items. if (!isset($child['#items'])) { // This is the same condition as in element_children(), which cannot // be used here, since it triggers an error on string values. @@ -2333,7 +2352,6 @@ function template_preprocess_item_list(&$variables) { } // Lastly, inherit the original theme variables of the current list. $child['#theme'] = $variables['theme_hook_original']; - $child['#type'] = $variables['type']; } } } @@ -2341,7 +2359,7 @@ function template_preprocess_item_list(&$variables) { } /** - * Returns HTML for a list or nested list of items. + * Returns HTML for a list or nested list of unordered list items. * * @param $variables * An associative array containing: @@ -2349,19 +2367,16 @@ function template_preprocess_item_list(&$variables) { * render arrays. Render arrays can specify list item attributes in the * #wrapper_attributes property. * - 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. */ -function theme_item_list($variables) { +function theme_unordered_list($variables) { $items = $variables['items']; $title = (string) $variables['title']; - // @todo 'type' clashes with '#type'. Rename to 'tag'. - $type = $variables['type']; $list_attributes = $variables['attributes']; $output = ''; if ($items) { - $output .= '<' . $type . new Attribute($list_attributes) . '>'; + $output .= ''; $num_items = count($items); $i = 0; @@ -2383,7 +2398,63 @@ function theme_item_list($variables) { } $output .= '' . $item . ''; } - $output .= ""; + $output .= ""; + } + + // Only output the list container and title, if there are any list items. + // Check to see whether the block title exists before adding a header. + // Empty headers are not semantic and present accessibility challenges. + if ($output !== '') { + if ($title !== '') { + $title = '

' . $title . '

'; + } + $output = '
' . $title . $output . '
'; + } + + return $output; +} + +/** + * Returns HTML for a list or nested list of ordered list items. + * + * @param $variables + * An associative array containing: + * - items: A list of items to render. Allowed values are strings or + * render arrays. Render arrays can specify list item attributes in the + * #wrapper_attributes property. + * - title: The title of the list. + * - attributes: The attributes applied to the list element. + */ +function theme_ordered_list($variables) { + $items = $variables['items']; + $title = (string) $variables['title']; + $list_attributes = $variables['attributes']; + + $output = ''; + if ($items) { + $output .= ''; + + $num_items = count($items); + $i = 0; + foreach ($items as &$item) { + $i++; + $attributes = array(); + if (is_array($item)) { + if (isset($item['#wrapper_attributes'])) { + $attributes = $item['#wrapper_attributes']; + } + $item = drupal_render($item); + } + $attributes['class'][] = ($i % 2 ? 'odd' : 'even'); + if ($i == 1) { + $attributes['class'][] = 'first'; + } + if ($i == $num_items) { + $attributes['class'][] = 'last'; + } + $output .= '' . $item . ''; + } + $output .= ""; } // Only output the list container and title, if there are any list items. @@ -3192,8 +3263,11 @@ function drupal_common_theme() { 'mark' => array( 'variables' => array('type' => MARK_NEW), ), - 'item_list' => array( - 'variables' => array('items' => array(), 'title' => '', 'type' => 'ul', 'attributes' => array()), + 'unordered_list' => array( + 'variables' => array('items' => array(), 'title' => '', 'attributes' => array()), + ), + 'ordered_list' => array( + 'variables' => array('items' => array(), 'title' => '', 'attributes' => array()), ), 'more_help_link' => array( 'variables' => array('url' => NULL), diff --git a/core/includes/theme.maintenance.inc b/core/includes/theme.maintenance.inc index 37775e6..89369fa 100644 --- a/core/includes/theme.maintenance.inc +++ b/core/includes/theme.maintenance.inc @@ -187,7 +187,7 @@ function theme_authorize_report($variables) { } $items[] = theme('authorize_message', array('message' => $log_message['message'], 'success' => $log_message['success'])); } - $output .= theme('item_list', array('items' => $items, 'title' => $heading)); + $output .= theme('unordered_list', array('items' => $items, 'title' => $heading)); } $output .= ''; } diff --git a/core/modules/aggregator/aggregator.pages.inc b/core/modules/aggregator/aggregator.pages.inc index 4310d79..e5d7d29 100644 --- a/core/modules/aggregator/aggregator.pages.inc +++ b/core/modules/aggregator/aggregator.pages.inc @@ -570,7 +570,7 @@ function template_preprocess_aggregator_summary_items(&$variables) { $summary_items[] = $variables['summary_items'][$key]; } $variables['summary_list'] = array( - '#theme' => 'item_list', + '#theme' => 'unordered_list', '#items' => $summary_items, ); $variables['source_url'] = $variables['source'] instanceof EntityInterface ? $variables['source']->url->value : $variables['source']->url; diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorCategoryBlock.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorCategoryBlock.php index 10bc52e..fb66a51 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorCategoryBlock.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorCategoryBlock.php @@ -78,7 +78,7 @@ public function build() { // Only display the block if there are items to show. if (count($items) > 0) { return array( - '#children' => theme('item_list', array('items' => $items)) . $read_more, + '#children' => theme('unordered_list', array('items' => $items)) . $read_more, ); } return array(); diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorFeedBlock.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorFeedBlock.php index afcef0e..5f77d49 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorFeedBlock.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorFeedBlock.php @@ -78,7 +78,7 @@ public function build() { // Only display the block if there are items to show. if (count($items) > 0) { return array( - '#children' => theme('item_list', array('items' => $items)) . $read_more, + '#children' => theme('unordered_list', array('items' => $items)) . $read_more, ); } } diff --git a/core/modules/book/book.pages.inc b/core/modules/book/book.pages.inc index 2418591..0d3b471 100644 --- a/core/modules/book/book.pages.inc +++ b/core/modules/book/book.pages.inc @@ -23,7 +23,7 @@ function book_render() { $book_list[] = l($book['title'], $book['href'], $book['options']); } - return theme('item_list', array('items' => $book_list)); + return theme('unordered_list', array('items' => $book_list)); } /** diff --git a/core/modules/ckeditor/ckeditor.admin.inc b/core/modules/ckeditor/ckeditor.admin.inc index 0dff9f5..26fd52f 100644 --- a/core/modules/ckeditor/ckeditor.admin.inc +++ b/core/modules/ckeditor/ckeditor.admin.inc @@ -109,8 +109,9 @@ function theme_ckeditor_settings_toolbar($variables) { return $output; }; - // We don't use theme_item_list() below in case there are no buttons in the - // active or disabled list, as theme_item_list() will not print an empty UL. + // We don't use theme_unordered_list() below in case there are no buttons in + // the active or disabled list, as theme_unordered_list() will not print an + // empty UL. $output = ''; $output .= '
'; $output .= '' . t('Toolbar configuration') . ''; diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index dd87b29..ba25fc9 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -564,7 +564,7 @@ function theme_comment_block($variables) { } if ($items) { - return theme('item_list', array('items' => $items)); + return theme('unordered_list', array('items' => $items)); } else { return t('No comments available.'); diff --git a/core/modules/field/field.module b/core/modules/field/field.module index 11cd9bb..dc8f06d 100644 --- a/core/modules/field/field.module +++ b/core/modules/field/field.module @@ -293,7 +293,7 @@ function field_help($path, $arg) { $items['items'][] = $display; } } - $output .= theme('item_list', $items) . ''; + $output .= theme('unordered_list', $items) . ''; $output .= '
' . t('Managing field data storage') . '
'; $output .= '
' . t('Developers of field modules can either use the default Field SQL Storage module to store data for their fields, or a contributed or custom module developed using the field storage API.', array('@storage-api' => 'http://api.drupal.org/api/group/field_storage/8', '@sql-store' => url('admin/help/field_sql_storage'))) . '
'; $output .= ''; diff --git a/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php index 976aa05..36d0edf 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php +++ b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php @@ -637,12 +637,18 @@ function render_items($items) { return implode(filter_xss_admin($this->options['separator']), $items); } else { - return theme('item_list', - array( - 'items' => $items, - 'title' => NULL, - 'type' => $this->options['multi_type'] - )); + $variables = array( + 'items' => $items, + 'title' => NULL, + ); + if ($this->options['multi_type'] == 'ol') { + return theme('ordered_list', $variables); + } + else { + return theme('unordered_list', $variables); + } + + } } } diff --git a/core/modules/field_ui/field_ui.admin.inc b/core/modules/field_ui/field_ui.admin.inc index 566959b..c56601e 100644 --- a/core/modules/field_ui/field_ui.admin.inc +++ b/core/modules/field_ui/field_ui.admin.inc @@ -77,7 +77,7 @@ function field_ui_inactive_message($entity_type, $bundle) { '%widget_module' => $instance['widget']['module'], )); } - drupal_set_message(t('Inactive fields are not shown unless their providing modules are enabled. The following fields are not enabled: !list', array('!list' => theme('item_list', array('items' => $list)))), 'error'); + drupal_set_message(t('Inactive fields are not shown unless their providing modules are enabled. The following fields are not enabled: !list', array('!list' => theme('unordered_list', array('items' => $list)))), 'error'); } } diff --git a/core/modules/help/help.admin.inc b/core/modules/help/help.admin.inc index a3bea9e..ca08620 100644 --- a/core/modules/help/help.admin.inc +++ b/core/modules/help/help.admin.inc @@ -47,7 +47,7 @@ function help_page($name) { foreach ($admin_tasks as $task) { $links[] = l($task['title'], $task['link_path'], $task['localized_options']); } - $output .= theme('item_list', array('items' => $links, 'title' => t('@module administration pages', array('@module' => $info[$name]['name'])))); + $output .= theme('unordered_list', array('items' => $links, 'title' => t('@module administration pages', array('@module' => $info[$name]['name'])))); } } return $output; diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc index fc68a51..8adbdb1 100644 --- a/core/modules/locale/locale.pages.inc +++ b/core/modules/locale/locale.pages.inc @@ -757,7 +757,7 @@ function theme_locale_translation_update_info($variables) { } } $description = '' . t('Updates for: @modules', array('@modules' => implode(', ', $modules))) . ''; - $details = theme('item_list', array('items' => $releases)); + $details = theme('unordered_list', array('items' => $releases)); } // Build output for updates not found. @@ -775,7 +775,7 @@ function theme_locale_translation_update_info($variables) { if ($details) { $details .= t('Missing translations for:'); } - $details .= theme('item_list', array('items' => $releases)); + $details .= theme('unordered_list', array('items' => $releases)); } $output = '
'; diff --git a/core/modules/node/node.admin.inc b/core/modules/node/node.admin.inc index 139b2d2..a8e28f9 100644 --- a/core/modules/node/node.admin.inc +++ b/core/modules/node/node.admin.inc @@ -385,7 +385,7 @@ function _node_mass_update_batch_finished($success, $results, $operations) { else { drupal_set_message(t('An error occurred and processing did not complete.'), 'error'); $message = format_plural(count($results), '1 item successfully processed:', '@count items successfully processed:'); - $message .= theme('item_list', array('items' => $results)); + $message .= theme('unordered_list', array('items' => $results)); drupal_set_message($message); } } diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module index c2d96d4..7ce136d 100644 --- a/core/modules/simpletest/simpletest.module +++ b/core/modules/simpletest/simpletest.module @@ -327,7 +327,7 @@ function _simpletest_batch_operation($test_list_init, $test_id, &$context) { } $context['message'] = t('Processed test @num of @max - %test.', array('%test' => $info['name'], '@num' => $max - $size, '@max' => $max)); $context['message'] .= '
Overall results: ' . _simpletest_format_summary_line($test_results) . '
'; - $context['message'] .= theme('item_list', array('items' => $items)); + $context['message'] .= theme('unordered_list', array('items' => $items)); // Save working values for the next iteration. $context['sandbox']['tests'] = $test_list; diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php index 1faf6d8..7659856 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php @@ -23,18 +23,18 @@ public static function getInfo() { } /** - * Tests theme_item_list(). + * Tests theme_unordered_list(). */ - function testItemList() { + function testUnorderedList() { // Verify that empty variables produce no output. $variables = array(); $expected = ''; - $this->assertThemeOutput('item_list', $variables, $expected, 'Empty %callback generates no output.'); + $this->assertThemeOutput('unordered_list', $variables, $expected, 'Empty %callback generates no output.'); $variables = array(); $variables['title'] = 'Some title'; $expected = ''; - $this->assertThemeOutput('item_list', $variables, $expected, 'Empty %callback with title generates no output.'); + $this->assertThemeOutput('unordered_list', $variables, $expected, 'Empty %callback with title generates no output.'); // Verify nested item lists. $variables = array(); @@ -52,9 +52,8 @@ function testItemList() { ), '#markup' => 'b', 'childlist' => array( - '#theme' => 'item_list', + '#theme' => 'unordered_list', '#attributes' => array('id' => 'blist'), - '#type' => 'ol', '#items' => array( 'ba', array( @@ -94,10 +93,10 @@ function testItemList() { 'f', ); - $inner_b = '
    '; + $inner_b = '
      '; $inner_b .= '
    • ba
    • '; $inner_b .= '
    • bb
    • '; - $inner_b .= '
'; + $inner_b .= '
'; $inner_cb = '
    '; $inner_cb .= '
  • cba
  • '; @@ -121,7 +120,108 @@ function testItemList() { $expected .= '
  • f
  • '; $expected .= '
'; - $this->assertThemeOutput('item_list', $variables, $expected); + $this->assertThemeOutput('unordered_list', $variables, $expected); + } + + /** + * Tests theme_ordered_list(). + */ + function testOrderedList() { + // Verify that empty variables produce no output. + $variables = array(); + $expected = ''; + $this->assertThemeOutput('ordered_list', $variables, $expected, 'Empty %callback generates no output.'); + + $variables = array(); + $variables['title'] = 'Some title'; + $expected = ''; + $this->assertThemeOutput('ordered_list', $variables, $expected, 'Empty %callback with title generates no output.'); + + // Verify nested item lists. + $variables = array(); + $variables['title'] = 'Some title'; + $variables['attributes'] = array( + 'id' => 'parentlist', + ); + $variables['items'] = array( + // A plain string value forms an own item. + 'a', + // Items can be fully-fledged render arrays with their own attributes. + array( + '#wrapper_attributes' => array( + 'id' => 'item-id-b', + ), + '#markup' => 'b', + 'childlist' => array( + '#theme' => 'ordered', + '#attributes' => array('id' => 'blist'), + '#items' => array( + 'ba', + array( + '#markup' => 'bb', + '#wrapper_attributes' => array('class' => array('item-class-bb')), + ), + ), + ), + ), + // However, items can also be child #items. + array( + '#markup' => 'c', + 'childlist' => array( + '#attributes' => array('id' => 'clist'), + 'ca', + array( + '#markup' => 'cb', + '#wrapper_attributes' => array('class' => array('item-class-cb')), + 'children' => array( + 'cba', + 'cbb', + ), + ), + 'cc', + ), + ), + // Use #markup to be able to specify #wrapper_attributes. + array( + '#markup' => 'd', + '#wrapper_attributes' => array('id' => 'item-id-d'), + ), + // An empty item with attributes. + array( + '#wrapper_attributes' => array('id' => 'item-id-e'), + ), + // Lastly, another plain string item. + 'f', + ); + + $inner_b = '
    '; + $inner_b .= '
  1. ba
  2. '; + $inner_b .= '
  3. bb
  4. '; + $inner_b .= '
'; + + $inner_cb = '
    '; + $inner_cb .= '
  1. cba
  2. '; + $inner_cb .= '
  3. cbb
  4. '; + $inner_cb .= '
'; + + $inner_c = '
    '; + $inner_c .= '
  1. ca
  2. '; + $inner_c .= '
  3. cb' . $inner_cb . '
  4. '; + $inner_c .= '
  5. cc
  6. '; + $inner_c .= '
'; + + $expected = '
'; + $expected .= '

Some title

'; + $expected .= '
    '; + $expected .= '
  1. a
  2. '; + $expected .= '
  3. b' . $inner_b . '
  4. '; + $expected .= '
  5. c' . $inner_c . '
  6. '; + $expected .= '
  7. d
  8. '; + $expected .= '
  9. '; + $expected .= '
  10. f
  11. '; + $expected .= '
'; + + $this->assertThemeOutput('ordered_list', $variables, $expected); } /** diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index 4a4ba0e..5f74981 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -1103,7 +1103,7 @@ function system_modules_confirm_form($modules, $storage) { $items[] = format_plural(count($info['depends']), 'The @module module is missing, so the following module will be disabled: @depends.', 'The @module module is missing, so the following modules will be disabled: @depends.', $t_argument); } - $form['text'] = array('#markup' => theme('item_list', array('items' => $items))); + $form['text'] = array('#markup' => theme('unordered_list', array('items' => $items))); // Set some default form values $form = confirm_form( @@ -1355,7 +1355,7 @@ function system_modules_uninstall_confirm_form($storage) { if (isset($uninstall)) { $form['#confirmed'] = TRUE; $form['uninstall']['#tree'] = TRUE; - $form['modules'] = array('#markup' => '

' . t('The following modules will be completely uninstalled from your site, and all data from these modules will be lost!') . '

' . theme('item_list', array('items' => $uninstall))); + $form['modules'] = array('#markup' => '

' . t('The following modules will be completely uninstalled from your site, and all data from these modules will be lost!') . '

' . theme('unordered_list', array('items' => $uninstall))); $form = confirm_form( $form, t('Confirm uninstall'), diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 08a9fd9..bec8f77 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -130,7 +130,7 @@ function system_requirements($phase) { '@system_requirements' => 'http://drupal.org/requirements', )); - $description .= theme('item_list', array('items' => $missing_extensions)); + $description .= theme('unordered_list', array('items' => $missing_extensions)); $requirements['php_extensions']['value'] = $t('Disabled'); $requirements['php_extensions']['severity'] = REQUIREMENT_ERROR; @@ -245,7 +245,7 @@ function system_requirements($phase) { $description = $conf_errors[0]; } else { - $description = theme('item_list', array('items' => $conf_errors)); + $description = theme('unordered_list', array('items' => $conf_errors)); } $requirements['settings.php'] = array( 'value' => $t('Not protected'), diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 2c51ae0..b23915c 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -3937,7 +3937,7 @@ function theme_exposed_filters($variables) { foreach (element_children($form['current']) as $key) { $items[] = $form['current'][$key]; } - $output .= theme('item_list', array('items' => $items, 'attributes' => array('class' => array('clearfix', 'current-filters')))); + $output .= theme('unordered_list', array('items' => $items, 'attributes' => array('class' => array('clearfix', 'current-filters')))); } $output .= drupal_render_children($form); diff --git a/core/modules/system/system.theme-rtl.css b/core/modules/system/system.theme-rtl.css index b2ee453..d9b21f6 100644 --- a/core/modules/system/system.theme-rtl.css +++ b/core/modules/system/system.theme-rtl.css @@ -17,7 +17,7 @@ caption { } /** - * Markup generated by theme_item_list(). + * Markup generated by theme_unordered_list(). */ .item-list ul li { margin: 0 1.5em 0.25em 0; diff --git a/core/modules/system/system.theme.css b/core/modules/system/system.theme.css index 680d15e..450ca51 100644 --- a/core/modules/system/system.theme.css +++ b/core/modules/system/system.theme.css @@ -63,7 +63,7 @@ td.active { } /** - * Markup generated by theme_item_list(). + * Markup generated by theme_unordered_list() and theme_ordered_list(). */ .item-list .title { font-weight: bold; diff --git a/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.module b/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.module index 5bab7a9..eac887a 100644 --- a/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.module +++ b/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.module @@ -29,7 +29,7 @@ function toolbar_test_toolbar() { 'id' => 'toolbar-tray-testing', ), 'content' => array( - '#theme' => 'item_list', + '#theme' => 'unordered_list', '#items' => array( l(t('link 1'), ''), l(t('link 2'), ''), diff --git a/core/modules/toolbar/toolbar.api.php b/core/modules/toolbar/toolbar.api.php index 9bf59f9..a0796f3 100644 --- a/core/modules/toolbar/toolbar.api.php +++ b/core/modules/toolbar/toolbar.api.php @@ -108,7 +108,7 @@ function hook_toolbar() { 'tray' => array( '#heading' => t('Shopping cart actions'), 'shopping_cart' => array( - '#theme' => 'item_list', + '#theme' => 'unordered_list', '#items' => array( /* An item list renderable array */ ), ), ), diff --git a/core/modules/tour/lib/Drupal/tour/TourRenderController.php b/core/modules/tour/lib/Drupal/tour/TourRenderController.php index 0f61c24..05b887e 100644 --- a/core/modules/tour/lib/Drupal/tour/TourRenderController.php +++ b/core/modules/tour/lib/Drupal/tour/TourRenderController.php @@ -47,9 +47,8 @@ public function viewMultiple(array $entities = array(), $view_mode = 'full', $la $key = key($list_items); $list_items[$key]['#wrapper_attributes']['data-text'] = t('End tour'); $build[$entity_id] = array( - '#theme' => 'item_list', + '#theme' => 'ordered_list', '#items' => $list_items, - '#type' => 'ol', '#attributes' => array( 'id' => 'tour', 'class' => array( diff --git a/core/modules/update/update.manager.inc b/core/modules/update/update.manager.inc index 0047a52..ba720e4 100644 --- a/core/modules/update/update.manager.inc +++ b/core/modules/update/update.manager.inc @@ -351,7 +351,7 @@ function update_manager_download_batch_finished($success, $results) { 'title' => t('Downloading updates failed:'), 'items' => $results['errors'], ); - drupal_set_message(theme('item_list', $error_list), 'error'); + drupal_set_message(theme('unordered_list', $error_list), 'error'); } elseif ($success) { drupal_set_message(t('Updates downloaded successfully.')); diff --git a/core/modules/update/update.report.inc b/core/modules/update/update.report.inc index 607b523..33f09eb 100644 --- a/core/modules/update/update.report.inc +++ b/core/modules/update/update.report.inc @@ -187,7 +187,7 @@ function theme_update_report($variables) { $row .= t('Includes:'); $includes_items[] = t('Enabled: %includes', array('%includes' => implode(', ', $project['includes']))); $includes_items[] = t('Disabled: %disabled', array('%disabled' => implode(', ', $project['disabled']))); - $row .= theme('item_list', array('items' => $includes_items)); + $row .= theme('unordered_list', array('items' => $includes_items)); } else { $row .= t('Includes: %includes', array('%includes' => implode(', ', $project['includes']))); diff --git a/core/modules/user/lib/Drupal/user/Plugin/block/block/UserLoginBlock.php b/core/modules/user/lib/Drupal/user/Plugin/block/block/UserLoginBlock.php index 716a315..40ae451 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/block/block/UserLoginBlock.php +++ b/core/modules/user/lib/Drupal/user/Plugin/block/block/UserLoginBlock.php @@ -59,7 +59,7 @@ public function build() { return array( 'user_login_form' => $form, 'user_links' => array( - '#theme' => 'item_list', + '#theme' => 'unordered_list', '#items' => $items, ), ); diff --git a/core/modules/user/user.admin.inc b/core/modules/user/user.admin.inc index c3931d8..2315fa6 100644 --- a/core/modules/user/user.admin.inc +++ b/core/modules/user/user.admin.inc @@ -222,7 +222,7 @@ function user_admin_account() { $options[$account->uid] = array( 'username' => theme('username', array('account' => $account)), 'status' => $status[$account->status], - 'roles' => theme('item_list', array('items' => $users_roles)), + 'roles' => theme('unordered_list', array('items' => $users_roles)), 'member_for' => format_interval(REQUEST_TIME - $account->created), 'access' => $account->access ? t('@time ago', array('@time' => format_interval(REQUEST_TIME - $account->access))) : t('never'), ); diff --git a/core/modules/views/lib/Drupal/views/Analyzer.php b/core/modules/views/lib/Drupal/views/Analyzer.php index a2ff8ed..f1c8b18 100644 --- a/core/modules/views/lib/Drupal/views/Analyzer.php +++ b/core/modules/views/lib/Drupal/views/Analyzer.php @@ -79,7 +79,7 @@ public function formatMessages(array $messages) { $type .= ' messages'; $message = ''; if (count($messages) > 1) { - $message = theme('item_list', array('items' => $messages)); + $message = theme('unordered_list', array('items' => $messages)); } elseif ($messages) { $message = array_shift($messages); diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php index 8bf057b..b769e13 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php @@ -324,7 +324,7 @@ public function globalTokenForm(&$form, &$form_state) { '#collapsed' => TRUE, ); $form['global_tokens']['list'] = array( - '#theme' => 'item_list', + '#theme' => 'unordered_list', '#items' => $token_items, '#attributes' => array( 'class' => array('global-tokens'), diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php index fa394ae..d6f89a3 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php @@ -134,7 +134,7 @@ public function tokenForm(&$form, &$form_state) { $items[] = $key . ' == ' . $value; } $form['tokens']['tokens'] = array( - '#theme' => 'item_list', + '#theme' => 'unordered_list', '#items' => $items, ); } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/area/Result.php b/core/modules/views/lib/Drupal/views/Plugin/views/area/Result.php index e4d11bd..510d7ca 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/area/Result.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/area/Result.php @@ -45,7 +45,7 @@ public function buildOptionsForm(&$form, &$form_state) { '@page_count -- the total page count', ), ); - $list = theme('item_list', $variables); + $list = theme('unordered_list', $variables); $form['content'] = array( '#title' => t('Display'), '#type' => 'textarea', diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php index 3259815..70d19cf 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php @@ -1686,11 +1686,12 @@ public function buildOptionsForm(&$form, &$form_state) { foreach ($options[$type] as $key => $value) { $items[] = $key . ' == ' . $value; } - $output .= theme('item_list', - array( - 'items' => $items, - 'type' => $type - )); + if($type == 'ol') { + $output .= theme('ordered_list', array($items)); + } + else { + $output .= theme('unordered_list', array($items)); + } } } } @@ -1839,7 +1840,7 @@ public function buildOptionsForm(&$form, &$form_state) { ); $form['analysis'] = array( - '#markup' => '
' . theme('item_list', array('items' => $funcs)) . '
', + '#markup' => '
' . theme('unordered_list', array('items' => $funcs)) . '
', ); $form['rescan_button'] = array( @@ -2075,7 +2076,7 @@ protected function formatThemes($themes) { $fixed[] = $template; } - return theme('item_list', array('items' => array_reverse($fixed))); + return theme('unordered_list', array('items' => array_reverse($fixed))); } /** diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php index 5f20f4a..1e840e7 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php @@ -873,11 +873,12 @@ public function buildOptionsForm(&$form, &$form_state) { foreach ($options[$type] as $key => $value) { $items[] = $key . ' == ' . $value; } - $output .= theme('item_list', - array( - 'items' => $items, - 'type' => $type - )); + if($type == 'ol') { + $output .= theme('ordered_list', array($items)); + } + else { + $output .= theme('unordered_list', array($items)); + } } } } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/field/PrerenderList.php b/core/modules/views/lib/Drupal/views/Plugin/views/field/PrerenderList.php index 306fe89..43015e4 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/field/PrerenderList.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/PrerenderList.php @@ -81,12 +81,12 @@ function render_items($items) { return implode($this->sanitizeValue($this->options['separator'], 'xss_admin'), $items); } else { - return theme('item_list', - array( - 'items' => $items, - 'title' => NULL, - 'type' => $this->options['type'] - )); + if($this->options['type'] == 'ol') { + return theme('ordered_list', array($items)); + } + else { + return theme('unordered_list', array($items)); + } } } } diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index 44f48f6..5aea4e2 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -1086,11 +1086,10 @@ function theme_views_mini_pager($vars) { '#wrapper_attributes' => array('class' => array('pager-next')), ) + $li_next; - return theme('item_list', + return theme('unordered_list', array( 'items' => $items, 'title' => NULL, - 'type' => 'ul', 'attributes' => array('class' => array('pager')), ) ); diff --git a/core/update.php b/core/update.php index d24d6e0..7488bf9 100644 --- a/core/update.php +++ b/core/update.php @@ -97,7 +97,7 @@ function update_script_selection_form($form, &$form_state) { '#value' => $update['start'], ); $form['start'][$module . '_updates'] = array( - '#theme' => 'item_list', + '#theme' => 'unordered_list', '#items' => $update['pending'], '#title' => $module . ' module', );