Permalink
Browse files

Fixes bug MDL-6360 "Resizable image in breadcrumb trail..."

  - files block_search_forums.php, calendar/lib.php, lang/en_utf8/access.php, weblib.php, theme/standard/config.php, styles_color.css
  • Loading branch information...
nfreear
nfreear committed Sep 19, 2006
1 parent 717cfb0 commit 57100a9098a94415a8c4d654f5868653467fe615
@@ -10,7 +10,7 @@ function init() {
}
function get_content() {
global $CFG;
global $CFG, $THEME;
if($this->content !== NULL) {
return $this->content;
@@ -26,12 +26,16 @@ function get_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>';
View
@@ -602,7 +602,7 @@ function calendar_sql_where($tstart, $tend, $users, $groups, $courses, $withdura
}
function calendar_top_controls($type, $data) {
global $CFG, $CALENDARDAYS;
global $CFG, $CALENDARDAYS, $THEME;
$content = '';
if(!isset($data['d'])) {
$data['d'] = 1;
@@ -620,8 +620,9 @@ function calendar_top_controls($type, $data) {
$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':
@@ -658,9 +659,9 @@ function calendar_top_controls($type, $data) {
$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&amp;', 1, $prevmonth, $prevyear).'">&lt; '.userdate($prevdate, get_string('strftimemonthyear')).'</a></span>';
$content .= '<span class="previous"><a href="'.calendar_get_link_href('view.php?view=month&amp;', 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&amp;', 1, $nextmonth, $nextyear).'">'.userdate($nextdate, get_string('strftimemonthyear'))." &gt;</a></span>\n";
$content .= '<span class="hide"> | </span><span class="next"><a href="'.calendar_get_link_href('view.php?view=month&amp;', 1, $nextmonth, $nextyear).'">'.userdate($nextdate, get_string('strftimemonthyear'))." $THEME->rarrow</a></span>\n";
$content .= "<span class=\"clearer\"></span></div>\n";
break;
case 'day':
@@ -670,7 +671,7 @@ function calendar_top_controls($type, $data) {
$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&amp;', $prevdate['mday'], $prevdate['mon'], $prevdate['year']).'">&lt; '.$prevname."</a></span>\n";
$content .= '<span class="previous"><a href="'.calendar_get_link_href('view.php?view=day&amp;', $prevdate['mday'], $prevdate['mon'], $prevdate['year'])."\">$THEME->larrow ".$prevname."</a></span>\n";
// Get the format string
$text = get_string('strftimedaydate');
@@ -684,7 +685,7 @@ function calendar_top_controls($type, $data) {
// 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&amp;', $nextdate['mday'], $nextdate['mon'], $nextdate['year']).'">'.$nextname." &gt;</a></span>\n";
$content .= '<span class="hide"> | </span><span class="next"><a href="'.calendar_get_link_href('view.php?view=day&amp;', $nextdate['mday'], $nextdate['mon'], $nextdate['year']).'">'.$nextname." $THEME->rarrow</a></span>\n";
$content .= "<span class=\"clearer\"></span></div>\n";
break;
}
@@ -1340,4 +1341,4 @@ function calendar_set_filters_status($packed_bitfield) {
return true;
}
?>
?>
View
@@ -15,6 +15,8 @@
$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';
View
@@ -2621,25 +2621,56 @@ function user_login_string($course=NULL, $user=NULL) {
}
/**
* 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 &gt; &raquo;), 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 = '&#x25BA;';
$THEME->larrow = '&#x25C4;';
if (FALSE !== strpos($_SERVER['HTTP_USER_AGENT'], 'Opera')) {
$THEME->rarrow = '&#x25B6;';
$THEME->larrow = '&#x25C0;';
}
}
}
/**
* 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 '&rarr;', '/', 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, &raquo; replaced with image.
//Accessibility: breadcrumb links now in a list, &raquo; 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";
@@ -4019,27 +4050,33 @@ function navmenu($course, $cm=NULL, $targetwindow='self') {
$previousmod = $mod;
}
}
//Accessibility: added Alt text, replaced &gt; &lt; 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&amp;user=0&amp;date=0&amp;id=$course->id&amp;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=\"&lt;\" /></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=\"&gt;\" /></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>";
}
/**
@@ -5252,4 +5289,4 @@ function debugging($message='', $level=E_NOTICE) {
}
// vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
?>
?>
View
@@ -121,9 +121,22 @@
/// files from the moodle/pix directory, plus a
/// "pix/mod" directory containing all the icons
/// for all the activity modules.
////////////////////////////////////////////////////////////////////////////////
///$THEME->rarrow = '&#x25BA;' //OR '&rarr;';
///$THEME->larrow = '&#x25C4;' //OR '&larr;';
///$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 &lt; &gt; &raquo; - 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
@@ -196,6 +196,10 @@ table.formtable tbody th {
*** Header
***/
.breadcrumb .sep {
color:#aaa;
}
.headerskip a:link,
.headerskip a:visited,
.headerskip a:hover {
@@ -957,4 +961,4 @@ body#mod-quiz-report table#attempts .r1 {
#admin-roles-override .capcurrent {
background-color:#FFFFFF;
border: 1px solid #cecece;
}
}

0 comments on commit 57100a9

Please sign in to comment.