Skip to content

Commit

Permalink
Accessibility: function _title_html, replaced <div> with H2, enclosed…
Browse files Browse the repository at this point in the history
… <div> to <span> - now validates!
  • Loading branch information
nfreear committed Feb 28, 2006
1 parent b6f30b1 commit 02db7f7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions blocks/moodleblock.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,12 @@ function _print_shadow() {
function _title_html() {
global $CFG;

$title = '<div class="title">';
//Accessibility: validation, can't have <div> inside <h2>, use <span>.
$title = '<span class="title">';

if (!empty($CFG->allowuserblockhiding)) {
$title .= '<div class="hide-show"><a href="#" onclick="elementToggleHide(this, true, function(el) {return findParentNode(el, \'DIV\', \'sideblock\'); } ); return false;"><img src="'.$CFG->pixpath.'/spacer.gif" alt="" class="hide-show-image" /></a></div>';
//Accessibility: added static 'alt' text for the +- icon.
$title .= '<span class="hide-show"><a href="#" onclick="elementToggleHide(this, true, function(el) {return findParentNode(el, \'DIV\', \'sideblock\'); } ); return false;"><img src="'.$CFG->pixpath.'/spacer.gif" alt="hide OR show block" class="hide-show-image" /></a></span>';
}

$title .= $this->title;
Expand All @@ -249,7 +251,7 @@ function _title_html() {
$title .= $this->edit_controls;
}

$title .= '</div>';
$title .= '</span>';

return $title;
}
Expand Down

0 comments on commit 02db7f7

Please sign in to comment.