diff -ur moodle.before-resource-navigation-links-fix/mod/resource/lib.php moodle/mod/resource/lib.php
--- moodle.before-resource-navigation-links-fix/mod/resource/lib.php	2007-07-06 04:06:15.000000000 +0200
+++ moodle/mod/resource/lib.php	2007-08-24 22:22:44.000000000 +0200
@@ -163,10 +163,8 @@
         $USER->editing = $edit;
     }
 
-    $morenavlinks = array($this->strresources   => 'index.php?id='.$this->course->id,
-                             $this->resource->name => '');
-
-    $PAGE->print_header($this->course->shortname.': %fullname%', $morenavlinks);
+    $this->navlinks[] = array('name' => format_string($this->resource->name), 'link' => '', 'type' => 'activityinstance');
+    $PAGE->print_header($this->course->shortname.': %fullname%', $this->navlinks);
 
     echo '<table id="layout-table"><tr>';
 
diff -ur moodle.before-resource-navigation-links-fix/mod/resource/type/html/resource.class.php moodle/mod/resource/type/html/resource.class.php
--- moodle.before-resource-navigation-links-fix/mod/resource/type/html/resource.class.php	2007-07-07 04:09:08.000000000 +0200
+++ moodle/mod/resource/type/html/resource.class.php	2007-08-24 22:42:41.000000000 +0200
@@ -72,11 +72,10 @@
         $pagetitle = strip_tags($course->shortname.': '.format_string($resource->name));
         $inpopup = optional_param('inpopup', '', PARAM_BOOL);
         
-        // fix for MDL-9021, thanks Etienne Roz
-        add_to_log($course->id, "resource", "view", "view.php?id={$cm->id}", $resource->id, $cm->id);
 
         if ($resource->popup) {
             if ($inpopup) {                    /// Popup only
+                add_to_log($course->id, "resource", "view", "view.php?id={$cm->id}", $resource->id, $cm->id);
                 
                 print_header();
                 print_simple_box(format_text($resource->alltext, FORMAT_HTML, $formatoptions, $course->id),
@@ -113,6 +112,7 @@
             }
         } else {    /// not a popup at all
 
+            add_to_log($course->id, "resource", "view", "view.php?id={$cm->id}", $resource->id, $cm->id);
             $this->navlinks[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activityinstance');
             $this->navigation = build_navigation($this->navlinks);
             
diff -ur moodle.before-resource-navigation-links-fix/mod/resource/type/text/resource.class.php moodle/mod/resource/type/text/resource.class.php
--- moodle.before-resource-navigation-links-fix/mod/resource/type/text/resource.class.php	2007-07-06 04:06:22.000000000 +0200
+++ moodle/mod/resource/type/text/resource.class.php	2007-08-24 22:35:55.000000000 +0200
@@ -83,7 +83,10 @@
                 print_footer($course);
             } else {                           /// Make a page and a pop-up window
 
-                print_header($pagetitle, $course->fullname, "$this->navigation ".format_string($resource->name),
+                $this->navlinks[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activityinstance');
+                $this->navigation = build_navigation($this->navlinks);
+
+                print_header($pagetitle, $course->fullname, $this->navigation,
                         "", "", true, update_module_button($cm->id, $course->id, $this->strresource),
                         navmenu($course, $cm));
 
