From: nfreear Date: Wed, 9 May 2007 14:15:33 +0000 (+0000) Subject: Fixes bug MDL-9753, "THEME->larrow, rarrow don't work in stock IE6" X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ce3735d4537cda42d3c5b37a7421413ea106ec4e;p=moodle.git Fixes bug MDL-9753, "THEME->larrow, rarrow don't work in stock IE6" --- diff --git a/admin/report/simpletest/ex_reporter.php b/admin/report/simpletest/ex_reporter.php index 4b1b2022f8..b671180ea5 100644 --- a/admin/report/simpletest/ex_reporter.php +++ b/admin/report/simpletest/ex_reporter.php @@ -45,8 +45,7 @@ class ExHtmlReporter extends HtmlReporter { $this->strrunonlyfolder = $this->get_string('runonlyfolder'); $this->strrunonlyfile = $this->get_string('runonlyfile'); - check_theme_arrows(); - $this->strseparator = ' '.$THEME->rarrow.' '; + $this->strseparator = ' '.get_arrow_right().' '; } /** diff --git a/blocks/search_forums/block_search_forums.php b/blocks/search_forums/block_search_forums.php index 3630c6dd5a..a9ad69ad49 100644 --- a/blocks/search_forums/block_search_forums.php +++ b/blocks/search_forums/block_search_forums.php @@ -29,8 +29,7 @@ class block_search_forums extends block_base { $search = get_string('search'); //Accessibility: replaced with configurable text/'silent' character. - check_theme_arrows(); - // Theme config, $CFG->block_search_button = $THEME->rarrow .''.get_string('search').''; + // Theme config, $CFG->block_search_button = get_arrow_right() .''.get_string('search').''; $button = (isset($CFG->block_search_button)) ? $CFG->block_search_button : get_string('go'); $this->content->text = '
'; diff --git a/calendar/lib.php b/calendar/lib.php index cbc1326fe8..0a6ee266a9 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -620,9 +620,8 @@ function calendar_top_controls($type, $data) { $data['y'] = $date['year']; //Accessibility: calendar block controls, replaced with
. - check_theme_arrows(); - $nexttext = $THEME->rarrow .''.get_string('monthnext','access').''; - $prevtext = $THEME->larrow .''.get_string('monthprev','access').''; + $nexttext = get_arrow_right().''.get_string('monthnext','access').''; + $prevtext = get_arrow_left() .''.get_string('monthprev','access').''; switch($type) { case 'frontpage': @@ -661,7 +660,7 @@ function calendar_top_controls($type, $data) { $content .= '
'; $content .= ' $THEME->larrow ".userdate($prevdate, get_string('strftimemonthyear')).''; $content .= ' | '.userdate($time, get_string('strftimemonthyear'))."\n"; - $content .= ' | '.userdate($nextdate, get_string('strftimemonthyear'))." $THEME->rarrow\n"; + $content .= ' | '.userdate($nextdate, get_string('strftimemonthyear')).' '.get_arrow_left()."\n"; $content .= "
\n"; break; case 'day': @@ -685,7 +684,7 @@ function calendar_top_controls($type, $data) { // Print the actual thing $content .= ' | '.$text.''; - $content .= ' | '.$nextname." $THEME->rarrow\n"; + $content .= ' | '.$nextname.' '.get_arrow_right()."\n"; $content .= "
\n"; break; } diff --git a/lib/moodlelib.php b/lib/moodlelib.php index adac356401..a4729150ff 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -7015,10 +7015,9 @@ function setup_lang_from_browser() { * navigation strings. */ function build_navigation($extrabreadcrumbs) { - global $CFG, $THEME, $COURSE; + global $CFG, $COURSE; $navigation = ''; - check_theme_arrows(); //Site name if ($site = get_site()) { @@ -7048,7 +7047,7 @@ function build_navigation($extrabreadcrumbs) { } $navigation .= '
  • '; if ($i > 0) { - $navigation .= ' '.$THEME->rarrow.' '; + $navigation .= ' '.get_arrow_right('sep').' '; } if ($breadcrumbs[$i]['link'] && $i+1 < $countcrumb) { $navigation .= "framename'\" href=\"{$breadcrumbs[$i]['link']}\">"; @@ -7090,4 +7089,4 @@ function in_object_vars($var, $object) } // vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140: -?> +?> \ No newline at end of file diff --git a/lib/weblib.php b/lib/weblib.php index 88fb748919..6cb9edfd9c 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -3098,6 +3098,38 @@ function check_theme_arrows() { } } +/** + * Return (by default) the right arrow defined in check_theme_arrows function above. + * @param addclass Additional class names. + * @param return Default true, false means echo. + * @return Default HTML string, or nothing. + */ +function get_arrow_right($addclass='', $return=true) { + global $THEME; + check_theme_arrows(); + $output = ''.$THEME->rarrow.''; + if ($return) { + return $output; + } else { + echo $output; + } +} + +/** + * Return (by default) the left arrow defined in check_theme_arrows function above. + */ +function get_arrow_left($addclass='', $return=true) { + global $THEME; + check_theme_arrows(); + $output = ''.$THEME->larrow.''; + if ($return) { + return $output; + } else { + echo $output; + } +} + + /** * Prints breadcrumb trail of links, called in theme/-/header.html * @@ -3111,12 +3143,8 @@ 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 .''; + $separator = get_arrow_right('sep'); } if ($navigation) { @@ -3151,11 +3179,11 @@ function print_navigation ($navigation, $separator=0, $return=false) { $site = new object(); $site->shortname = get_string('home'); } - + //Accessibility: breadcrumb links now in a list, » replaced with a 'silent' character. $nav_text = get_string('youarehere','access'); $output .= '

    '.$nav_text."