]> git.mjollnir.org Git - moodle.git/commitdiff
Breadcrumbs: mod/hotpot changes
authormattc-catalyst <mattc-catalyst>
Mon, 16 Apr 2007 21:40:46 +0000 (21:40 +0000)
committermattc-catalyst <mattc-catalyst>
Mon, 16 Apr 2007 21:40:46 +0000 (21:40 +0000)
- Modified to use build_navigation() for breadcrumb generation.

Author: Matt Clarkson <mattc@catalyst.net.nz>

mod/hotpot/index.php
mod/hotpot/report.php
mod/hotpot/review.php
mod/hotpot/view.php

index 04bd0e149539228398d017e7ddb8f3a948bf5035..faf07c21589f988f5d7ca10755611521e4945f30 100644 (file)
 
     $title = format_string($course->shortname) . ": $strmodulenameplural";
     $heading = $course->fullname;
-    $navigation = $strmodulenameplural;
-    if ($course->id != SITEID) {
-        $navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> -> $navigation";
-    }
+    
+    $crumbs[] = array('name' => $strmodulenameplural, 'link' => '', 'type' => 'activity');
+    $navigation = build_navigation($crumbs, $course);
+    
     print_header($title, $heading, $navigation, "", "", true, "", navmenu($course));
 
     $next_url = "$CFG->wwwroot/course/view.php?id=$course->id";
index 53871214e0c7fdee090adc0c3bc70c7e1d8cd0b9..bdb77f5c92b5a1a7c46d2ca9264f7c5aa50c0f23 100644 (file)
@@ -401,9 +401,10 @@ function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) {
 
     $title = format_string($course->shortname) . ": $hotpot->name";
     $heading = $course->fullname;
+    
+    $crumbs[] = array('name' => $strmodulenameplural, 'link' => 'index.php?id='.$course->id, 'type' => 'activity');
+    $crumbs[] = array('name' => $hotpot->name, 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
 
-    $navigation = "<a href=index.php?id=$course->id>$strmodulenameplural</a> -> ";
-    $navigation .= "<a href=\"view.php?id=$cm->id\">$hotpot->name</a> -> ";
 
     $modulecontext = get_context_instance(CONTEXT_MODULE, $cm->id);
     if (has_capability('mod/hotpot:viewreport',$modulecontext)) {
@@ -412,16 +413,17 @@ function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) {
         } else {
             $module = "hotpot";
         }
-        $navigation .= get_string("report$mode", $module);
+
+        $crumbs[] = array('name' => get_string("report$mode", $module), 'link' => '', 'type' => 'title');
+        
 
     } else {
-        $navigation .= get_string("report", "quiz");
-    }
-    if ($course->id != SITEID) {
-        $navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> -> $navigation";
+
+        $crumbs[] = array('name' => get_string("report", "quiz"), 'link' => '', 'type' => 'title');
     }
-    $button = update_module_button($cm->id, $course->id, $strmodulename);
 
+    $button = update_module_button($cm->id, $course->id, $strmodulename);
+    $navigation = build_navigation($crumbs, $course);
     print_header($title, $heading, $navigation, "", "", true, $button, navmenu($course, $cm));
 
     print_heading($hotpot->name);
index d0f7f39878e11cd6a3bf76328c6e0a20196cec50..578049f8a36dcb837ff918d72eef24b86acbac6b 100644 (file)
     // print header
     $title = format_string($course->shortname) . ": $hotpot->name";
     $heading = $course->fullname;
-    $navigation = "<a href=\"index.php?id=$course->id\">$strmodulenameplural</a> -> ".get_string("review", "quiz");
-    if ($course->id != SITEID) {
-        $navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> -> $navigation";
-    }
+    
+    $crumbs[] = array('name' => $strmodulenameplural, 'link' => 'index.php?id='.$course->id, 'type' => 'activity');
+    $crumbs[] = array('name' => get_string("review", "quiz"), 'link' => '', 'type' => 'activityinstance');
+    $navigation = build_navigation($crumbs, $course);
+    
+
     $button = update_module_button($cm->id, $course->id, $strmodulename);
     print_header($title, $heading, $navigation, "", "", true, $button, navmenu($course, $cm));
     print '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'; // for overlib
index 375d9fab63eef47624629f136aa78b0c20db7429..4197aec39f7b687ed2b08f63d7b47fe8cc1d5636 100644 (file)
     // header strings
     $title = format_string($course->shortname.': '.$hotpot->name, true);
     $heading = $course->fullname;
-    $navigation = '<a '.$CFG->frametarget.' href="'.$CFG->wwwroot.'/mod/hotpot/index.php?id='.$course->id.'">'.get_string("modulenameplural", "hotpot")."</a> -> $hotpot->name";
-    if ($course->id != SITEID) {
-        $navigation = '<a '.$CFG->frametarget.' href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'.$course->shortname.'</a> -> '.$navigation;
-    }
+    $crumbs[] = array('name' => get_string("modulenameplural", "hotpot"), 'link' => $CFG->wwwroot.'/mod/hotpot/index.php?id='.$course->id, 'type' => 'activity');
+    $crumbs[] = array('name' => $hotpot->name, 'link' => '', 'type' => 'activityinstance');
+    
+    $navigation = build_navigation($crumbs, $course);
+        
     $button = update_module_button($cm->id, $course->id, get_string("modulename", "hotpot"));
     $button = '<div style="font-size:0.75em;">'.$button.'</div>';
     $loggedinas = '<span class="logininfo">'.user_login_string($course, $USER).'</span>';