Commit f9be1f55 authored by catch's avatar catch
Browse files

Issue #1347266 by Everett Zufelt, pcambra, JohnAlbin, tim.plunkett: Convert...

Issue #1347266 by Everett Zufelt, pcambra, JohnAlbin, tim.plunkett: Convert theme_breadcrumb() to HTML5.
parent 2851e6b8
...@@ -1687,15 +1687,16 @@ function theme_image($variables) { ...@@ -1687,15 +1687,16 @@ function theme_image($variables) {
*/ */
function theme_breadcrumb($variables) { function theme_breadcrumb($variables) {
$breadcrumb = $variables['breadcrumb']; $breadcrumb = $variables['breadcrumb'];
$output = '';
if (!empty($breadcrumb)) { if (!empty($breadcrumb)) {
$output .= '<nav role="navigation" class="breadcrumb">';
// Provide a navigational heading to give context for breadcrumb links to // Provide a navigational heading to give context for breadcrumb links to
// screen-reader users. Make the heading invisible with .element-invisible. // screen-reader users. Make the heading invisible with .element-invisible.
$output = '<h2 class="element-invisible">' . t('You are here') . '</h2>'; $output .= '<h2 class="element-invisible">' . t('You are here') . '</h2>';
$output .= '<ol><li>' . implode(' » </li><li>', $breadcrumb) . '</li></ol>';
$output .= '<div class="breadcrumb">' . implode(' » ', $breadcrumb) . '</div>'; $output .= '</nav>';
return $output;
} }
return $output;
} }
/** /**
......
...@@ -156,7 +156,7 @@ class BookTestCase extends DrupalWebTestCase { ...@@ -156,7 +156,7 @@ class BookTestCase extends DrupalWebTestCase {
} }
// Fetch links in the current breadcrumb. // Fetch links in the current breadcrumb.
$links = $this->xpath('//div[@class="breadcrumb"]/a'); $links = $this->xpath('//nav[@class="breadcrumb"]/ol/li/a');
$got_breadcrumb = array(); $got_breadcrumb = array();
foreach ($links as $link) { foreach ($links as $link) {
$got_breadcrumb[] = (string) $link['href']; $got_breadcrumb[] = (string) $link['href'];
......
...@@ -1732,7 +1732,7 @@ class NodeTitleTestCase extends DrupalWebTestCase { ...@@ -1732,7 +1732,7 @@ class NodeTitleTestCase extends DrupalWebTestCase {
// Test breadcrumb in comment preview. // Test breadcrumb in comment preview.
$this->drupalGet("comment/reply/$node->nid"); $this->drupalGet("comment/reply/$node->nid");
$xpath = '//div[@class="breadcrumb"]/a[last()]'; $xpath = '//nav[@class="breadcrumb"]/ol/li[last()]/a';
$this->assertEqual(current($this->xpath($xpath)), $node->title, 'Node breadcrumb is equal to node title.', 'Node'); $this->assertEqual(current($this->xpath($xpath)), $node->title, 'Node breadcrumb is equal to node title.', 'Node');
// Test node title in comment preview. // Test node title in comment preview.
......
...@@ -107,7 +107,7 @@ class MenuWebTestCase extends DrupalWebTestCase { ...@@ -107,7 +107,7 @@ class MenuWebTestCase extends DrupalWebTestCase {
*/ */
protected function getParts() { protected function getParts() {
$parts = array(); $parts = array();
$elements = $this->xpath('//div[@class="breadcrumb"]/a'); $elements = $this->xpath('//nav[@class="breadcrumb"]/ol/li/a');
if (!empty($elements)) { if (!empty($elements)) {
foreach ($elements as $element) { foreach ($elements as $element) {
$parts[] = array( $parts[] = array(
......
...@@ -107,9 +107,7 @@ ...@@ -107,9 +107,7 @@
</nav> </nav>
<?php endif; ?> <?php endif; ?>
<?php if ($breadcrumb): ?> <?php print $breadcrumb; ?>
<div id="breadcrumb"><?php print $breadcrumb; ?></div>
<?php endif; ?>
<?php if ($messages): ?> <?php if ($messages): ?>
<div id="messages"><?php print $messages; ?></div> <div id="messages"><?php print $messages; ?></div>
......
...@@ -294,6 +294,16 @@ ul.inline li { ...@@ -294,6 +294,16 @@ ul.inline li {
.breadcrumb { .breadcrumb {
padding-bottom: 0.5em; padding-bottom: 0.5em;
} }
.breadcrumb ol {
margin: 0;
padding: 0;
}
.breadcrumb li {
display: inline;
list-style-type: none;
margin: 0;
padding: 0;
}
/** /**
* Markup generated by theme_menu_local_tasks(). * Markup generated by theme_menu_local_tasks().
......
...@@ -75,7 +75,7 @@ body, ...@@ -75,7 +75,7 @@ body,
.sidebar .section { .sidebar .section {
padding: 0 15px; padding: 0 15px;
} }
#breadcrumb { .breadcrumb {
margin: 0 15px; margin: 0 15px;
} }
.region-triptych-first, .region-triptych-first,
......
...@@ -172,9 +172,7 @@ ...@@ -172,9 +172,7 @@
<div id="main-wrapper" class="clearfix"><div id="main" class="clearfix"> <div id="main-wrapper" class="clearfix"><div id="main" class="clearfix">
<?php if ($breadcrumb): ?> <?php print $breadcrumb; ?>
<div id="breadcrumb"><?php print $breadcrumb; ?></div>
<?php endif; ?>
<?php if ($page['sidebar_first']): ?> <?php if ($page['sidebar_first']): ?>
<div id="sidebar-first" class="column sidebar"><div class="section"> <div id="sidebar-first" class="column sidebar"><div class="section">
......
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