]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-8904: Used a numerical index for the navigation elements array instead of string...
authornicolasconnault <nicolasconnault>
Thu, 15 Mar 2007 04:08:40 +0000 (04:08 +0000)
committernicolasconnault <nicolasconnault>
Thu, 15 Mar 2007 04:08:40 +0000 (04:08 +0000)
MDL-8713: Added $CFG->formatstring temporary variable

lib/weblib.php

index f2b0b8848f25ef542f6d5e3023c4aca8690d526b..20b26aa5125a1fc12bef5a21dc1ac153f12dfc61 100644 (file)
@@ -1444,7 +1444,12 @@ function format_string ($string, $striplinks = false, $courseid=NULL ) {
 
     //Store to cache
     $strcache[$md5] = $string;
-       
+    
+    if (!empty($CFG->filterall)) {
+        $CFG->formatstring = true; // new
+        $string = filter_text($string, $courseid);
+        unset($CFG->formatstring);
+    }
         
     return $string;
 }
@@ -2831,10 +2836,10 @@ function print_navigation ($navigation, $separator=0, $return=false) {
             
             foreach ($ar as $a) {
                 if (strpos($a, '</a>') === false) {
-                    $navigation[trim(format_string($a))] = '';
+                    $navigation[] = array('title' => trim(format_string($a)), 'url' => '');
                 } else {
                     if (preg_match('/<a.*href="([^"]*)">(.*)<\/a>/', $a, $matches)) {                  
-                        $navigation[trim(format_string($matches[2]))] = $matches[1];
+                        $navigation[] = array('title' => trim(format_string($matches[2])), 'url' => $matches[1]);
                     }
                 }
             }
@@ -2855,7 +2860,8 @@ function print_navigation ($navigation, $separator=0, $return=false) {
                                  ? '/my' : '') .'/">'. format_string($site->shortname) ."</a></li>\n";
         
         
-        foreach ($navigation as $title=>$url) {
+        foreach ($navigation as $navitem) {
+            extract($navitem);
             $title = strip_tags(format_string($title));
             if (empty($url)) {
                 $output .= '<li class="first">'."$separator $title</li>\n";
@@ -4328,17 +4334,17 @@ function navmenu($course, $cm=NULL, $targetwindow='self') {
     }
     if ($backmod) {
         $backtext= get_string('activityprev', 'access');
-        $backmod = '<li><form action="'.$CFG->wwwroot.'/mod/'.$backmod->mod.'/view.php" '.$CFG->frametarget.'><div>'.
+        $backmod = '<li><form action="'.$CFG->wwwroot.'/mod/'.$backmod->mod.'/view.php" '.$CFG->frametarget.'><fieldset class="invisiblefieldset">'.
                    '<input type="hidden" name="id" value="'.$backmod->cm.'" />'.
                    '<button type="submit" title="'.$backtext.'">'.$THEME->larrow.
-                   '<span class="accesshide">'.$backtext.'</span></button></div></form></li>';
+                   '<span class="accesshide">'.$backtext.'</span></button></fieldset></form></li>';
     }
     if ($nextmod) {
         $nexttext= get_string('activitynext', 'access');
-        $nextmod = '<li><form action="'.$CFG->wwwroot.'/mod/'.$nextmod->mod.'/view.php"  '.$CFG->frametarget.'><div>'.
+        $nextmod = '<li><form action="'.$CFG->wwwroot.'/mod/'.$nextmod->mod.'/view.php"  '.$CFG->frametarget.'><fieldset class="invisiblefieldset">'.
                    '<input type="hidden" name="id" value="'.$nextmod->cm.'" />'.
                    '<button type="submit" title="'.$nexttext.'">'.$THEME->rarrow.
-                   '<span class="accesshide">'.$nexttext.'</span></button></div></form></li>';
+                   '<span class="accesshide">'.$nexttext.'</span></button></fieldset></form></li>';
     }
 
     return '<div class="navigation"><ul>'.$logslink . $backmod .