Skip to content

Commit

Permalink
Accessibility: moved H2 from weblib.php: print_side_block_start, to m…
Browse files Browse the repository at this point in the history
…oodleblock.class.php: _title_html (validate, <span>s revert to <div>); skip block link - replaced pixel image with 'accesshide' text; use get_string.
  • Loading branch information
nfreear committed Mar 6, 2006
1 parent 9aa4592 commit 68ac3b3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
10 changes: 6 additions & 4 deletions blocks/moodleblock.class.php
Expand Up @@ -238,20 +238,22 @@ function _title_html() {
global $CFG;

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

if (!empty($CFG->allowuserblockhiding)) {
//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>';
//TODO (nfreear): language string 'hide OR show block'
$title .= '<div class="hide-show"><a title="'.get_string('showhideblock','access').'" href="#" onclick="elementToggleHide(this, true, function(el) {return findParentNode(el, \'DIV\', \'sideblock\'); } ); return false;"><img src="'.$CFG->pixpath.'/spacer.gif" alt="'.get_string('showhideblock','access').'" class="hide-show-image" /></a></div>';
}

$title .= $this->title;
//Accesssibility: added H2 (was in, weblib.php: print_side_block)
$title .= '<h2>'.$this->title.'</h2>';

if ($this->edit_controls !== NULL) {
$title .= $this->edit_controls;
}

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

return $title;
}
Expand Down
5 changes: 4 additions & 1 deletion theme/standard/styles_fonts.css
Expand Up @@ -202,8 +202,11 @@ body#admin-index .copyright {
/***
*** Blocks
***/
a.skip-block {
text-decoration:none;
}

.sideblock .header {
.sideblock .header, .sideblock h2 {
font-size:0.9em;
font-weight: bold;
}
Expand Down
18 changes: 17 additions & 1 deletion theme/standard/styles_layout.css
Expand Up @@ -234,6 +234,17 @@ form.popupform {
display: inline;
}

/*Accessibility: text 'seen' by screen readers but not visual users. */
.accesshide {
position:absolute;
left:-10000px;
}
img.resize {
width:1em;
height:1em;
}


/***
*** Header
***/
Expand Down Expand Up @@ -398,7 +409,7 @@ table.flexible th.c0 {
a.skip-block, .skip-block {
display:block;
width:2em;
height:3px;
height:4px;
}
.skip-block-to {
font-size:1px;
Expand Down Expand Up @@ -427,10 +438,15 @@ ul.list, ul.list li {
text-align: left;
margin:0%;
padding:4px;
padding-bottom:0%;
border-width: 1px;
border-style: solid;
border-bottom: none;
}
.sideblock h2 {
margin:0%;
padding:0%;
}

.sideblock .header .hide-show {
float:right;
Expand Down

0 comments on commit 68ac3b3

Please sign in to comment.