]> git.mjollnir.org Git - moodle.git/commitdiff
Fixes bug MDL-6360 "Resizable image in breadcrumb trail..."
authornfreear <nfreear>
Tue, 19 Sep 2006 11:36:21 +0000 (11:36 +0000)
committernfreear <nfreear>
Tue, 19 Sep 2006 11:36:21 +0000 (11:36 +0000)
  - files block_search_forums.php, calendar/lib.php, lang/en_utf8/access.php, weblib.php, theme/standard/config.php, styles_color.css

blocks/search_forums/block_search_forums.php
calendar/lib.php
lang/en_utf8/access.php
lib/weblib.php
theme/standard/config.php
theme/standard/styles_color.css

index 4bdc9996de6387579f9e3171b75f1ab1189c434f..de679ee13cb01249cdb2b97f2e1d428ce863f52f 100644 (file)
@@ -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 <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>';
index 4d38d155fec31ea61fce49da5aa3d977270dbab6..bfce428e2219d1a82db8db6f61139244a8baebea 100644 (file)
@@ -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;
 }
 
-?>
+?>
\ No newline at end of file
index faf22aacf126790bd13eb6b5b47824ddfdb3dfd9..4e1d8b0d4c19c556e92492fec9a6ac9db188f7a2 100644 (file)
@@ -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';
index 3d9e960e63c70def37ca47d1b9182bf5fdb3a906..65da4f2063914c81fb342bf5cbbfe16fdceacb45 100644 (file)
@@ -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:
-?>
+?>
\ No newline at end of file
index 871981788deb1070c1e941d7bf3febd049a27249..25c833add5a8b5cd9ec7fd25d56bcebba1024f79 100644 (file)
@@ -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 = '&#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
index d6233094fea0031ce5e3c414e1acf7e051bc6160..06c57072d8244904bb1ca30e49ba28150939a265 100644 (file)
@@ -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