- files block_search_forums.php, calendar/lib.php, lang/en_utf8/access.php, weblib.php, theme/standard/config.php, styles_color.css
}
function get_content() {
- global $CFG;
+ global $CFG, $THEME;
if($this->content !== NULL) {
return $this->content;
$advancedsearch = get_string('advancedsearch', 'block_search_forums');
- //Accessibility: replaced <input value=">" type="submit"> with button-embedded image.
+ //Accessibility: replaced <input value=">" type="submit"> with configurable text/'silent' character.
+ check_theme_arrows();
+ // Theme config, $CFG->block_search_button = $THEME->rarrow .'<span class="accesshide">'.get_string('search').'</span>';
+ $button = (isset($CFG->block_search_button)) ? $CFG->block_search_button : get_string('go');
+
$this->content->text = '<div class="searchform">';
$this->content->text .= '<form name="search" action="'.$CFG->wwwroot.'/mod/forum/search.php" style="display:inline">';
$this->content->text .= '<input name="id" type="hidden" value="'.$this->instance->pageid.'" />'; // course
- $this->content->text .= '<input name="search" type="text" size="16" value="" />';
- $this->content->text .= '<button type="submit" title="'.get_string('search').'"><img src="'.$CFG->pixpath.'/a/r_go.gif" alt="" class="resize" /><span class="accesshide">'.get_string('search').'</span></button><br />';
+ $this->content->text .= '<input name="search" type="text" size="16" />';
+ $this->content->text .= '<button type="submit" title="'.get_string('search').'">'.$button.'</button><br />';
$this->content->text .= '<a href="'.$CFG->wwwroot.'/mod/forum/search.php?id='.$this->instance->pageid.'">'.$advancedsearch.'</a>';
$this->content->text .= helpbutton('search', $advancedsearch, 'moodle', true, false, '', true);
$this->content->text .= '</form></div>';
}
function calendar_top_controls($type, $data) {
- global $CFG, $CALENDARDAYS;
+ global $CFG, $CALENDARDAYS, $THEME;
$content = '';
if(!isset($data['d'])) {
$data['d'] = 1;
$data['y'] = $date['year'];
//Accessibility: calendar block controls, replaced <table> with <div>.
- $nexttext = '<img src="'. $CFG->pixpath .'/a/r_next.gif" alt="'.get_string('monthnext','access').'" class="resize" />';
- $prevtext = '<img src="'. $CFG->pixpath .'/a/r_previous.gif" alt="'.get_string('monthprev','access').'" class="resize" />';
+ check_theme_arrows();
+ $nexttext = $THEME->rarrow .'<span class="accesshide">'.get_string('monthnext','access').'</span>';
+ $prevtext = $THEME->larrow .'<span class="accesshide">'.get_string('monthprev','access').'</span>';
switch($type) {
case 'frontpage':
$prevdate = make_timestamp($prevyear, $prevmonth, 1);
$nextdate = make_timestamp($nextyear, $nextmonth, 1);
$content .= '<div class="calendar-controls">';
- $content .= '<span class="previous"><a href="'.calendar_get_link_href('view.php?view=month&', 1, $prevmonth, $prevyear).'">< '.userdate($prevdate, get_string('strftimemonthyear')).'</a></span>';
+ $content .= '<span class="previous"><a href="'.calendar_get_link_href('view.php?view=month&', 1, $prevmonth, $prevyear)."\"> $THEME->larrow ".userdate($prevdate, get_string('strftimemonthyear')).'</a></span>';
$content .= '<span class="hide"> | </span><span class="current">'.userdate($time, get_string('strftimemonthyear'))."</span>\n";
- $content .= '<span class="hide"> | </span><span class="next"><a href="'.calendar_get_link_href('view.php?view=month&', 1, $nextmonth, $nextyear).'">'.userdate($nextdate, get_string('strftimemonthyear'))." ></a></span>\n";
+ $content .= '<span class="hide"> | </span><span class="next"><a href="'.calendar_get_link_href('view.php?view=month&', 1, $nextmonth, $nextyear).'">'.userdate($nextdate, get_string('strftimemonthyear'))." $THEME->rarrow</a></span>\n";
$content .= "<span class=\"clearer\"></span></div>\n";
break;
case 'day':
$prevname = calendar_wday_name($CALENDARDAYS[$prevdate['wday']]);
$nextname = calendar_wday_name($CALENDARDAYS[$nextdate['wday']]);
$content .= '<div class="calendar-controls">';
- $content .= '<span class="previous"><a href="'.calendar_get_link_href('view.php?view=day&', $prevdate['mday'], $prevdate['mon'], $prevdate['year']).'">< '.$prevname."</a></span>\n";
+ $content .= '<span class="previous"><a href="'.calendar_get_link_href('view.php?view=day&', $prevdate['mday'], $prevdate['mon'], $prevdate['year'])."\">$THEME->larrow ".$prevname."</a></span>\n";
// Get the format string
$text = get_string('strftimedaydate');
// Print the actual thing
$content .= '<span class="hide"> | </span><span class="current">'.$text.'</span>';
- $content .= '<span class="hide"> | </span><span class="next"><a href="'.calendar_get_link_href('view.php?view=day&', $nextdate['mday'], $nextdate['mon'], $nextdate['year']).'">'.$nextname." ></a></span>\n";
+ $content .= '<span class="hide"> | </span><span class="next"><a href="'.calendar_get_link_href('view.php?view=day&', $nextdate['mday'], $nextdate['mon'], $nextdate['year']).'">'.$nextname." $THEME->rarrow</a></span>\n";
$content .= "<span class=\"clearer\"></span></div>\n";
break;
}
return true;
}
-?>
+?>
\ No newline at end of file
$string['accesshelp'] = 'Accessibility help';
$string['accesskey'] = 'Access key, $a';
$string['accessstatement'] = 'Accessibility statement';
+$string['activitynext'] = 'Next activity';
+$string['activityprev'] = 'Previous activity';
$string['breadcrumb'] = 'Breadcrumb trail';
$string['monthnext'] = 'Next month';
$string['monthprev'] = 'Previous month';
}
/**
- * Prints breadcrumbs links
+ * Tests whether $THEME->rarrow, $THEME->larrow have been set (theme/-/config.php).
+ * If not it applies sensible defaults.
*
- * @uses $CFG
- * @param string $navigation The breadcrumbs string to be printed
+ * Accessibility: right and left arrow Unicode characters for breadcrumb, calendar,
+ * search forum block, etc. Important: these are 'silent' in a screen-reader
+ * (unlike > »), and must be accompanied by text.
+ * @uses $THEME
*/
-function print_navigation ($navigation, $return=false) {
- global $CFG, $USER;
+function check_theme_arrows() {
+ global $THEME;
+
+ if (!isset($THEME->rarrow) and !isset($THEME->larrow)) {
+ $THEME->rarrow = '►';
+ $THEME->larrow = '◄';
+ if (FALSE !== strpos($_SERVER['HTTP_USER_AGENT'], 'Opera')) {
+ $THEME->rarrow = '▶';
+ $THEME->larrow = '◀';
+ }
+ }
+}
+/**
+ * Prints breadcrumb trail of links, called in theme/-/header.html
+ *
+ * @uses $CFG
+ * @param string $navigation The breadcrumb navigation string to be printed
+ * @param string $separator The breadcrumb trail separator. The default 0 leads to the use
+ * of $THEME->rarrow, themes could use '→', '/', or '' for a style-sheet solution.
+ * @param boolean $return False to echo the breadcrumb string (default), true to return it.
+ */
+function print_navigation ($navigation, $separator=0, $return=false) {
+ global $CFG, $THEME;
$output = '';
+
+ check_theme_arrows();
+ if (0 === $separator) {
+ $separator = $THEME->rarrow;
+ }
+ if (!empty($separator)) {
+ $separator = '<span class="sep">'. $separator .'</span>';
+ }
if ($navigation) {
- //Accessibility: breadcrumb links now in a list, » replaced with image.
+ //Accessibility: breadcrumb links now in a list, » replaced with a 'silent' character.
$nav_text = get_string('youarehere','access');
- $output .= '<h2 class="accesshide">'.$nav_text.",</h2><ul>\n";
+ $output .= '<h2 class="accesshide">'.$nav_text."</h2><ul>\n";
if (! $site = get_site()) {
$site->shortname = get_string('home');
}
- $navigation = '<li title="'.$nav_text.'"><img src="'.$CFG->pixpath.'/a/r_breadcrumb.gif" class="resize" alt="" /> '
- .str_replace('->', '</li><li title="'.$nav_text.'"><img src="'.$CFG->pixpath.'/a/r_breadcrumb.gif" class="resize" alt="" /> ', $navigation)."</li>\n";
+ $navigation = "<li>$separator ". str_replace('->', "</li>\n<li>$separator", $navigation) ."</li>\n";
$output .= '<li class="first"><a target="'. $CFG->framename .'" href="'. $CFG->wwwroot.((!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID)) && !empty($USER->id) && !empty($CFG->mymoodleredirect) && !isguest())
? '/my' : '') .'/">'. $site->shortname ."</a></li>\n". $navigation;
$output .= "</ul>\n";
$previousmod = $mod;
}
}
+ //Accessibility: added Alt text, replaced > < with 'silent' character and 'accesshide' text.
+ check_theme_arrows();
+
if ($selectmod and has_capability('moodle/site:viewreports', get_context_instance(CONTEXT_COURSE, $course->id))) {
- $logslink = "<td><a target=\"$CFG->framename\" href=".
+ $logstext = get_string('alllogs');
+ $logslink = "<a title=\"$logstext\" target=\"$CFG->framename\" href=".
"\"$CFG->wwwroot/course/report/log/index.php?chooselog=1&user=0&date=0&id=$course->id&modid=$selectmod->cm\">".
- "<img border=\"0\" height=\"16\" width=\"16\" src=\"$CFG->pixpath/i/log.gif\" alt=\"\" /></a></td>";
+ "<img class=\"icon log\" src=\"$CFG->pixpath/i/log.gif\" alt=\"$logstext\" /></a>";
}
if ($backmod) {
+ $backtext= get_string('activityprev', 'access');
$backmod = "<form action=\"$CFG->wwwroot/mod/$backmod->mod/view.php\" target=\"$CFG->framename\">".
"<input type=\"hidden\" name=\"id\" value=\"$backmod->cm\" />".
- "<input type=\"submit\" value=\"<\" /></form>";
+ "<button type=\"submit\" title=\"$backtext\">$THEME->larrow<span class=\"accesshide\">$backtext</span></button></form>";
}
if ($nextmod) {
+ $nexttext= get_string('activitynext', 'access');
$nextmod = "<form action=\"$CFG->wwwroot/mod/$nextmod->mod/view.php\" target=\"$CFG->framename\">".
"<input type=\"hidden\" name=\"id\" value=\"$nextmod->cm\" />".
- "<input type=\"submit\" value=\">\" /></form>";
+ "<button type=\"submit\" title=\"$nexttext\">$THEME->rarrow<span class=\"accesshide\">$nexttext</span></button></form>";
}
- return '<table><tr>'.$logslink .'<td>'. $backmod .'</td><td>' .
+ return "<table><tr>\n<td>".$logslink .'</td><td>'. $backmod .'</td><td>' .
popup_form($CFG->wwwroot .'/mod/', $menu, 'navmenu', $selected, $strjumpto,
'', '', true, $targetwindow).
- '</td><td>'. $nextmod .'</td></tr></table>';
+ '</td><td>'. $nextmod ."</td>\n</tr></table>";
}
/**
}
// vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
-?>
+?>
\ No newline at end of file
/// files from the moodle/pix directory, plus a
/// "pix/mod" directory containing all the icons
/// for all the activity modules.
-////////////////////////////////////////////////////////////////////////////////
+///$THEME->rarrow = '►' //OR '→';
+///$THEME->larrow = '◄' //OR '←';
+///$CFG->block_search_button = $THEME->rarrow .'<span class="accesshide">'.get_string('search').'</span>';
+///
+/// Accessibility: Right and left arrow-like characters are
+/// used in the breadcrumb trail, course navigation menu
+/// (previous/next activity), calendar, and search forum block.
+///
+/// If the theme does not set characters, appropriate defaults
+/// are set by (lib/weblib.php:check_theme_arrows). The suggestions
+/// above are 'silent' in a screen-reader like JAWS. Please DO NOT
+/// use < > » - these are confusing for blind users.
+////////////////////////////////////////////////////////////////////////////////
+
// These colours are not used anymore, so I've set them to
// bright green to help identify where they should be removed
*** Header
***/
+.breadcrumb .sep {
+ color:#aaa;
+}
+
.headerskip a:link,
.headerskip a:visited,
.headerskip a:hover {
#admin-roles-override .capcurrent {
background-color:#FFFFFF;
border: 1px solid #cecece;
-}
+}
\ No newline at end of file