]> git.mjollnir.org Git - moodle.git/commitdiff
Fixes bug MDL-9753, "THEME->larrow, rarrow don't work in stock IE6"
authornfreear <nfreear>
Wed, 9 May 2007 14:15:33 +0000 (14:15 +0000)
committernfreear <nfreear>
Wed, 9 May 2007 14:15:33 +0000 (14:15 +0000)
admin/report/simpletest/ex_reporter.php
blocks/search_forums/block_search_forums.php
calendar/lib.php
lib/moodlelib.php
lib/weblib.php

index 4b1b2022f8761fb8b7453bb045dfbe0ebd468d0a..b671180ea58e85421059eef172cf66333b886d86 100644 (file)
@@ -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 = ' <span class="sep">'.$THEME->rarrow.'</span> ';
+        $this->strseparator = ' '.get_arrow_right().' ';
     }
 
     /**
index 3630c6dd5abe7f224ce22b38e1e4e4c807aac486..a9ad69ad496c522eee0a153ac827f1b568d1265f 100644 (file)
@@ -29,8 +29,7 @@ class block_search_forums extends block_base {
         $search = get_string('search');
 
         //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>';
+        // Theme config, $CFG->block_search_button = get_arrow_right() .'<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">';
index cbc1326fe8a1e00e34b197701f3ab723a1f4bc5a..0a6ee266a9506d43188a802de0ee2d165f38f217 100644 (file)
@@ -620,9 +620,8 @@ function calendar_top_controls($type, $data) {
     $data['y'] = $date['year'];
 
     //Accessibility: calendar block controls, replaced <table> with <div>.
-    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>';
+    $nexttext = get_arrow_right().'<span class="accesshide">'.get_string('monthnext','access').'</span>';
+    $prevtext = get_arrow_left() .'<span class="accesshide">'.get_string('monthprev','access').'</span>';
 
     switch($type) {
         case 'frontpage':
@@ -661,7 +660,7 @@ function calendar_top_controls($type, $data) {
             $content .= '<div class="calendar-controls">';
             $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'))." $THEME->rarrow</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')).' '.get_arrow_left()."</a></span>\n";
             $content .= "<span class=\"clearer\"><!-- --></span></div>\n";
         break;
         case 'day':
@@ -685,7 +684,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." $THEME->rarrow</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.' '.get_arrow_right()."</a></span>\n";
             $content .= "<span class=\"clearer\"><!-- --></span></div>\n";
         break;
     }
index adac35640180e43bb720100ce616856a66171774..a4729150ff04edecd1a6cc961618ea7f1eff0c4f 100644 (file)
@@ -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 .= '<li class="first">';
         if ($i > 0) {
-            $navigation .= '<span class="sep"> '.$THEME->rarrow.' </span>';
+            $navigation .= ' '.get_arrow_right('sep').' ';
         }
         if ($breadcrumbs[$i]['link'] && $i+1 < $countcrumb) {
             $navigation .= "<a onclick=\"this.target='$CFG->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
index 88fb748919016aab62fb82a53673c0e5bef69251..6cb9edfd9c4b7fdffa2e77c887425c1814979d7b 100644 (file)
@@ -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 = '<span class="arrow '.$addclass.'">'.$THEME->rarrow.'</span>';
+    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 = '<span class="arrow '.$addclass.'">'.$THEME->larrow.'</span>';
+    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 = '<span class="sep">'. $separator .'</span>';
+        $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, &raquo; replaced with a 'silent' character.
         $nav_text = get_string('youarehere','access');
         $output .= '<h2 class="accesshide">'.$nav_text."</h2><ul>\n";
-        
+
         $output .= '<li class="first">'."\n".'<a '.$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
                .$CFG->wwwroot.((!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))
                                  && !empty($USER->id) && !empty($CFG->mymoodleredirect) && !isguest())
@@ -3655,11 +3683,11 @@ has_capability('moodle/course:viewhiddenuserfields', $context)) {
 /**
  * Print a specified group's avatar.
  *
- * @param group $group A {@link group} object representing a group or array of groups
- * @param int $courseid ?
- * @param boolean $large ?
- * @param boolean $return ?
- * @param boolean $link ?
+ * @param group $group A single {@link group} object OR array of groups.
+ * @param int $courseid The course ID.
+ * @param boolean $large Default small picture, or large.
+ * @param boolean $return If false print picture, otherwise return the output as string
+ * @param boolean $link Enclose image in a link to view specified course?
  * @return string
  * @todo Finish documenting this function
  */
@@ -4629,7 +4657,6 @@ function navmenu($course, $cm=NULL, $targetwindow='self') {
         }
     }
     //Accessibility: added Alt text, replaced &gt; &lt; with 'silent' character and 'accesshide' text.
-    check_theme_arrows();
 
     if ($selectmod and has_capability('moodle/site:viewreports', $context)) {
         $logstext = get_string('alllogs');
@@ -4643,14 +4670,14 @@ function navmenu($course, $cm=NULL, $targetwindow='self') {
         $backtext= get_string('activityprev', 'access');
         $backmod = '<li>'."\n".'<form action="'.$CFG->wwwroot.'/mod/'.$backmod->mod.'/view.php" '.$CFG->frametarget.'>'."\n".'<div>'."\n".
                    '<input type="hidden" name="id" value="'.$backmod->cm.'" />'."\n".
-                   '<button type="submit" title="'.$backtext.'">'.$THEME->larrow."\n".
+                   '<button type="submit" title="'.$backtext.'">'.get_arrow_left()."\n".
                    '<span class="accesshide">'.$backtext.'</span>'."\n".'</button>'."\n".'</div>'."\n".'</form>'."\n".'</li>'."\n";
     }
     if ($nextmod) {
         $nexttext= get_string('activitynext', 'access');
         $nextmod = '<li>'."\n".'<form action="'.$CFG->wwwroot.'/mod/'.$nextmod->mod.'/view.php"  '.$CFG->frametarget.'>'."\n".'<div>'."\n".
                    '<input type="hidden" name="id" value="'.$nextmod->cm.'" />'."\n".
-                   '<button type="submit" title="'.$nexttext.'">'.$THEME->rarrow."\n".
+                   '<button type="submit" title="'.$nexttext.'">'.get_arrow_right()."\n".
                    '<span class="accesshide">'.$nexttext.'</span>'."\n".'</button>'."\n".'</div>'."\n".'</form>'."\n".'</li>'."\n";
     }
 
@@ -6122,4 +6149,4 @@ function print_location_comment($file, $line, $return = false)
     }
 }
 // vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
-?>
+?>
\ No newline at end of file