From: nfreear Date: Tue, 19 Sep 2006 11:36:21 +0000 (+0000) Subject: Fixes bug MDL-6360 "Resizable image in breadcrumb trail..." X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=57100a9098a94415a8c4d654f5868653467fe615;p=moodle.git 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 --- diff --git a/blocks/search_forums/block_search_forums.php b/blocks/search_forums/block_search_forums.php index 4bdc9996de..de679ee13c 100644 --- a/blocks/search_forums/block_search_forums.php +++ b/blocks/search_forums/block_search_forums.php @@ -10,7 +10,7 @@ class block_search_forums extends block_base { } function get_content() { - global $CFG; + global $CFG, $THEME; if($this->content !== NULL) { return $this->content; @@ -26,12 +26,16 @@ class block_search_forums extends block_base { $advancedsearch = get_string('advancedsearch', 'block_search_forums'); - //Accessibility: replaced with button-embedded image. + //Accessibility: replaced with configurable text/'silent' character. + check_theme_arrows(); + // Theme config, $CFG->block_search_button = $THEME->rarrow .''.get_string('search').''; + $button = (isset($CFG->block_search_button)) ? $CFG->block_search_button : get_string('go'); + $this->content->text = '
'; $this->content->text .= '
'; $this->content->text .= ''; // course - $this->content->text .= ''; - $this->content->text .= '
'; + $this->content->text .= ''; + $this->content->text .= '
'; $this->content->text .= ''.$advancedsearch.''; $this->content->text .= helpbutton('search', $advancedsearch, 'moodle', true, false, '', true); $this->content->text .= '
'; diff --git a/calendar/lib.php b/calendar/lib.php index 4d38d155fe..bfce428e22 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -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 with
. - $nexttext = ''.get_string('monthnext','access').''; - $prevtext = ''.get_string('monthprev','access').''; + check_theme_arrows(); + $nexttext = $THEME->rarrow .''.get_string('monthnext','access').''; + $prevtext = $THEME->larrow .''.get_string('monthprev','access').''; 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 .= '\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 .= '
'; - $content .= '< '.$prevname."\n"; + $content .= '$THEME->larrow ".$prevname."\n"; // Get the format string $text = get_string('strftimedaydate'); @@ -684,7 +685,7 @@ function calendar_top_controls($type, $data) { // Print the actual thing $content .= ' | '.$text.''; - $content .= ' | '.$nextname." >\n"; + $content .= ' | '.$nextname." $THEME->rarrow\n"; $content .= "
\n"; break; } @@ -1340,4 +1341,4 @@ function calendar_set_filters_status($packed_bitfield) { return true; } -?> +?> \ No newline at end of file diff --git a/lang/en_utf8/access.php b/lang/en_utf8/access.php index faf22aacf1..4e1d8b0d4c 100644 --- a/lang/en_utf8/access.php +++ b/lang/en_utf8/access.php @@ -15,6 +15,8 @@ $string['access'] = 'Accessibility'; $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'; diff --git a/lib/weblib.php b/lib/weblib.php index 3d9e960e63..65da4f2063 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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 > »), 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 = ''. $separator .''; + } 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 .= '

'.$nav_text.",

"; + "pixpath/i/log.gif\" alt=\"$logstext\" />"; } if ($backmod) { + $backtext= get_string('activityprev', 'access'); $backmod = "wwwroot/mod/$backmod->mod/view.php\" target=\"$CFG->framename\">". "cm\" />". - ""; + ""; } if ($nextmod) { + $nexttext= get_string('activitynext', 'access'); $nextmod = "wwwroot/mod/$nextmod->mod/view.php\" target=\"$CFG->framename\">". "cm\" />". - ""; + ""; } - return '
framename\" href=". + $logstext = get_string('alllogs'); + $logslink = "framename\" href=". "\"$CFG->wwwroot/course/report/log/index.php?chooselog=1&user=0&date=0&id=$course->id&modid=$selectmod->cm\">". - "pixpath/i/log.gif\" alt=\"\" />
'.$logslink .'\n
'. $backmod .'' . + return "\n
".$logslink .''. $backmod .'' . popup_form($CFG->wwwroot .'/mod/', $menu, 'navmenu', $selected, $strjumpto, '', '', true, $targetwindow). - ''. $nextmod .'
'; + '
'. $nextmod ."
"; } /** @@ -5252,4 +5289,4 @@ function debugging($message='', $level=E_NOTICE) { } // vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140: -?> +?> \ No newline at end of file diff --git a/theme/standard/config.php b/theme/standard/config.php index 871981788d..25c833add5 100644 --- a/theme/standard/config.php +++ b/theme/standard/config.php @@ -121,9 +121,22 @@ $THEME->custompix = false; /// 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 .''.get_string('search').''; +/// +/// 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 diff --git a/theme/standard/styles_color.css b/theme/standard/styles_color.css index d6233094fe..06c57072d8 100644 --- a/theme/standard/styles_color.css +++ b/theme/standard/styles_color.css @@ -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; -} +} \ No newline at end of file