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

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

12 files changed:
mod/glossary/comment.php
mod/glossary/comments.php
mod/glossary/deleteentry.php
mod/glossary/edit.php
mod/glossary/editcategories.php
mod/glossary/export.php
mod/glossary/exportentry.php
mod/glossary/formats.php
mod/glossary/import.php
mod/glossary/index.php
mod/glossary/showentry.php
mod/glossary/view.php

index c329807c87b4ddc426b9d7346e1441e394d1b969..5f13dfb0853e3008e62f7587da3ac97282b40621 100644 (file)
@@ -222,9 +222,15 @@ function glossary_comment_print_header($course, $cm, $glossary, $entry, $action)
     $strglossaries = get_string('modulenameplural', 'glossary');
     $strglossary   = get_string('modulename', 'glossary');
     $strcomments   = get_string('comments', 'glossary');
-
-    print_header_simple(format_string($glossary->name), '',
-        "<a href=\"index.php?id=$course->id\">$strglossaries</a> -> <a href=\"view.php?id=$cm->id\">".format_string($glossary->name,true)."</a> -> <a href=\"comments.php?id=$cm->id&amp;eid=$entry->id\">$strcomments</a> -> " . $straction,
+    
+    $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+    $crumbs[] = array('name' => format_string($glossary->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+    $crumbs[] = array('name' => $strcomments, 'link' => "comments.php?id=$cm->id&amp;eid=$entry->id", 'type' => 'title');
+    $crumbs[] = array('name' => $straction, 'link' => '', 'type' => 'action');
+    
+    $navigation = build_navigation($crumbs, $course);
+
+    print_header_simple(format_string($glossary->name), '', $navigation,
         '', '', true, update_module_button($cm->id, $course->id, $strglossary),
         navmenu($course, $cm));
 /// print original glossary entry for any comment action (add, update, delete)
index 6af15e1cb0dbe0cd9a129fe6c57e628ba98820a6..3f5994472e87e356596c0058da2551d183bbe6dd 100644 (file)
     $strcomments = get_string("comments", "glossary");
     $straddcomment = get_string("addcomment", "glossary");
 
-    print_header_simple(strip_tags("$strcomments: $entry->concept"), "",
-        "<a href=index.php?id=$course->id>$strglossaries</a> -> <a href=view.php?id=$cm->id>".format_string($glossary->name,true)."</a> -> $strcomments",
+    $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+    $crumbs[] = array('name' => format_string($glossary->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+    $crumbs[] = array('name' => $strcomments, 'link' => '', 'type' => 'title');
+    $navigation = build_navigation($crumbs, $course);
+    
+    print_header_simple(strip_tags("$strcomments: $entry->concept"), "", $navigation,
         "", "", true, update_module_button($cm->id, $course->id, $strglossary),
         navmenu($course, $cm));
 
index fc89e74d0db305ca0467487fb76cffe33be94be2..0f1180e6e2aa8cafd9ce1eedd6d50cba45c93f2c 100644 (file)
 
     $strareyousuredelete = get_string("areyousuredelete","glossary");
 
-    print_header_simple(format_string($glossary->name), "",
-                 "<a href=\"index.php?id=$course->id\">$strglossaries</a> -> ".format_string($glossary->name),
+    $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+    $crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+
+$navigation = build_navigation($crumbs, $course);
+
+    print_header_simple(format_string($glossary->name), "", $navigation,
                   "", "", true, update_module_button($cm->id, $course->id, $strglossary),
                   navmenu($course, $cm));
 
index 0e44b8bee6872826a026a6ad4e426828641fbcea..13c2228dc6152aefc05f9c65296ea1414a313784 100644 (file)
@@ -192,10 +192,13 @@ $strglossary = get_string("modulename", "glossary");
 $strglossaries = get_string("modulenameplural", "glossary");
 $stredit = empty($e) ? get_string('addentry', 'glossary') : get_string("edit");
 
+$crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+$crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+$crumbs[] = array('name' => $stredit, 'link' => '', 'type' => 'title');
 
-print_header_simple(format_string($glossary->name), "",
-             "<a href=\"index.php?id=$course->id\">$strglossaries</a> ->
-              <a href=\"view.php?id=$cm->id\">".format_string($glossary->name,true)."</a> -> $stredit", "",
+$navigation = build_navigation($crumbs, $course);
+
+print_header_simple(format_string($glossary->name), "", $navigation, "",
               "", true, "", navmenu($course, $cm));
 
 
index 5c81b59549eff0ce6c2b5de671148f75af534148..9c207c75945247aa83d9ff9be252bfca01fb509a 100644 (file)
     $strglossaries   = get_string("modulenameplural", "glossary");
     $strglossary     = get_string("modulename", "glossary");
 
-    print_header_simple(format_string($glossary->name), "",
-                        "<a href=\"index.php?id=$course->id\">$strglossaries</a> -> <a href=\"view.php?id=$cm->id&amp;tab=GLOSSARY_CATEGORY_VIEW\">".format_string($glossary->name,true)."</a> -> " . get_string("categories","glossary"),
+    $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+    $crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id&amp;tab=GLOSSARY_CATEGORY_VIEW", 'type' => 'activityinstance');
+    $crumbs[] = array('name' => get_string("categories","glossary"), 'link' => '', 'type' => 'title');
+    
+    $navigation = build_navigation($crumbs, $course);
+
+    print_header_simple(format_string($glossary->name), "", $navigation,
                         "", "", true, update_module_button($cm->id, $course->id, $strglossary),
                         navmenu($course, $cm));
 
index f37dad575bfc1359a01c33d7204913f9680d0f89..003613d913abafd823ab242c4c6ce2f12a414365 100644 (file)
     $strexportfile = get_string("exportfile", "glossary");
     $strexportentries = get_string('exportentries', 'glossary');
 
-    print_header_simple(format_string($glossary->name), "",
-        "<a href=\"index.php?id=$course->id\">$strglossaries</a> -> " .
-        "<a href=\"view.php?id=$id\">" .format_string($glossary->name) . "</a> -> " .
-        $strexportentries,
+    $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+    $crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+   
+    $navigation = build_navigation($crumbs, $course);
+    
+    print_header_simple(format_string($glossary->name), "",$navigation,
         "", "", true, update_module_button($cm->id, $course->id, $strglossary),
         navmenu($course, $cm));
 
index d441ce9a1b1006e4b7077c60eb5f977247f9a529..0213ecefaeb28c3ba3c7ccf0d5e412cc61749365 100644 (file)
     $entryalreadyexist = get_string('entryalreadyexist','glossary');
     $entryexported = get_string('entryexported','glossary');
 
-    print_header_simple(format_string($glossary->name), '',
-                 '<a href="index.php?id='.$course->id.'">'.$strglossaries.'</a> -> '.format_string($glossary->name),
-                  '', '', true, '',
-                  navmenu($course, $cm));
+    $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+    $crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+   
+    $navigation = build_navigation($crumbs, $course);
+
+    print_header_simple(format_string($glossary->name), '', $navigation, '', '', true, '', navmenu($course, $cm));
 
     if ( $PermissionGranted ) {
         $entry = get_record('glossary_entries', 'id', $entry);
index ffe721b6e3e48b866d7d6922d9ed47d80ac965f5..bba5a0057bf428f4a8b25ced11a1cc4e1b00b20f 100644 (file)
     $strmodulename = get_string("modulename", "glossary");
     $strdisplayformats = get_string("displayformats","glossary");
 
-    print_header("$strmodulename: $strconfiguration", $site->fullname,
-                  "<a href=\"../../$CFG->admin/index.php\">$stradmin</a> -> ".
-                  "<a href=\"../../$CFG->admin/configure.php\">$strconfiguration</a> -> ".
-                  "<a href=\"../../$CFG->admin/modules.php\">$strmanagemodules</a> -> <a href=\"../../$CFG->admin/module.php?module=glossary&amp;sesskey=$USER->sesskey\">$strmodulename</a> -> $strdisplayformats");
+    $crumbs[] = array('name' => $stradmin, 'link' => "../../$CFG->admin/index.php", 'type' => 'core');
+    $crumbs[] = array('name' => $strconfiguration, 'link' => "../../$CFG->admin/configure.php", 'type' => 'core');
+    $crumbs[] = array('name' => $strmanagemodules, 'link' => "../../$CFG->admin/modules.php", 'type' => 'core');
+    $crumbs[] = array('name' => $strmodulename, 'link' => "../../$CFG->admin/module.php?module=glossary&amp;sesskey=$USER->sesskey", 'type' => 'core');
+    $crumbs[] = array('name' => $strdisplayformats, 'link' => '', 'type' => 'core');
+
+    $navigation = build_navigation($crumbs);
+
+    print_header("$strmodulename: $strconfiguration", $site->fullname, $navigation);
 
     print_heading($strmodulename . ': ' . get_string("displayformats","glossary"));
 
index 0a83eef4d2a515051684eb183898942ab24151b5..4ef0c497477943a2bc349031878b8a7b16eb5440 100644 (file)
     $strsearch = get_string("search");
     $strimportentries = get_string('importentriesfromxml', 'glossary');
 
-    print_header_simple(format_string($glossary->name), "",
-        "<a href=\"index.php?id=$course->id\">$strglossaries</a> -> " .
-        "<a href=\"view.php?id=$id\">" .format_string($glossary->name) . "</a> -> " .
-        $strimportentries,
+    $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+    $crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
+    $crumbs[] = array('name' => $strimportentries, 'link' => '', 'type' => 'title');
+   
+    $navigation = build_navigation($crumbs, $course);
+
+    print_header_simple(format_string($glossary->name), "", $navigation,
         "", "", true, update_module_button($cm->id, $course->id, $strglossary),
         navmenu($course, $cm));
 
index a6758df813d09235d3b8a3f901db317f7195f901..f17f5b6f89fb485df1f95a8a96da1e436928e1f3 100644 (file)
 
 
 /// Print the header
-
-    print_header_simple("$strglossarys", "", "$strglossarys", "", "", true, "", navmenu($course));
+    $crumbs[] = array('name' => $strglossarys, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+    $navigation = build_navigation($crumbs, $course);
+    
+    print_header_simple("$strglossarys", "", $navigation, "", "", true, "", navmenu($course));
 
 /// Get all the appropriate data
 
index 496ce9c2ba0c438e4d7e73b4c14526f3cd2553d7..dd74a706de039b57dc5c0ebc386f3c6c29fa8734 100644 (file)
 
         $CFG->framename = "newwindow";
         if ($course->id != SITEID) {
-            print_header(strip_tags("$course->shortname: $strglossaries $strsearch"), $course->fullname,
-            "<a target=\"newwindow\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> -> $strglossaries -> $strsearch", "", "", true, "&nbsp;", "&nbsp;");
+               $crumbs[] = array('name' => $strglossaries, 'link' => '', 'type' => 'activity');
+            $crumbs[] = array('name' => $strsearch, 'link' => '', 'type' => 'title');
+            
+            $navigation = build_navigation($crumbs, $course);
+            
+            print_header(strip_tags("$course->shortname: $strglossaries $strsearch"), $course->fullname, $navigation, "", "", true, "&nbsp;", "&nbsp;");
         } else {
             print_header(strip_tags("$course->shortname: $strglossaries $strsearch"), $course->fullname,
             "$strglossaries -> $strsearch", "", "", true, "&nbsp;", "&nbsp;");
index 3e8b944cfbb545e7b5e6bdc7949b3a5e9ed239fa..ddd34ef285fb6c190e8b2482521601a5ffd425c5 100644 (file)
     $strsearch = get_string("search");
     $strwaitingapproval = get_string('waitingapproval', 'glossary');
 
+    $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+    $crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$id", 'type' => 'activityinstance');
+
 /// If we are in approval mode, prit special header
     if ($tab == GLOSSARY_APPROVAL_VIEW) {
         require_capability('mod/glossary:approve', $context);
-        print_header_simple(format_string($glossary->name), "",
-            "<a href=\"index.php?id=$course->id\">$strglossaries</a> -> " .
-            "<a href=\"view.php?id=$id\">" .format_string($glossary->name) . "</a> -> " .
-            $strwaitingapproval,
-            "", "", true, 
+        
+        $crumbs[] = array('name' => $strwaitingapproval, 'link' => '', 'type' => 'title');
+        $navigation = build_navigation($crumbs, $course);
+        
+        print_header_simple(format_string($glossary->name), "", $navigation, "", "", true, 
             update_module_button($cm->id, $course->id, $strglossary), navmenu($course, $cm));
 
         print_heading($strwaitingapproval);
     } else { /// Print standard header
-        print_header_simple(format_string($glossary->name), "",
-            "<a href=\"index.php?id=$course->id\">$strglossaries</a> -> " .
-            format_string($glossary->name),
-            "", "", true, 
+        $navigation = build_navigation($crumbs, $course);
+        print_header_simple(format_string($glossary->name), "", $navigation, "", "", true, 
             update_module_button($cm->id, $course->id, $strglossary), navmenu($course, $cm));
     }