$searchterm) { if (strlen($searchterm) < 2) { unset($searchterms[$key]); } } $search = trim(implode(" ", $searchterms)); } elseif ( $eid ) { $search = ""; } if (! $cm = get_record("course_modules", "id", $id)) { error("Course Module ID was incorrect"); } if (! $course = get_record("course", "id", $cm->course)) { error("Course is misconfigured"); } if (! $glossary = get_record("glossary", "id", $cm->instance)) { error("Course module is incorrect"); } require_login($course->id); add_to_log($course->id, "glossary", "view", "view.php?id=$cm->id", "$glossary->id"); /// Print the page header if ($course->category) { $navigation = "id\">$course->shortname ->"; } $strglossaries = get_string("modulenameplural", "glossary"); $strglossary = get_string("modulename", "glossary"); $strselectletter = get_string("selectletter", "glossary"); $strspecial = get_string("special", "glossary"); $strallentries = get_string("allentries", "glossary"); $strnoentries = get_string("noentries", "glossary"); $straddentry = get_string("addentry", "glossary"); $streditentry = get_string("editentry", "glossary"); $strdeleteentry = get_string("deleteentry", "glossary"); print_header("$course->shortname: $glossary->name", "$course->fullname", "$navigation id>$strglossaries -> $glossary->name", "", "", true, update_module_button($cm->id, $course->id, $strglossary), navmenu($course, $cm)); /// Print the main part of the page /// Printing the navigation links (letters to look for) echo "
" ; if ( !$course->visible ) { notice(get_string("activityiscurrentlyhidden")); } print_simple_box_start("center", "70%"); echo "
wwwroot/mod/glossary/view.php?id=$id&l=SPECIAL\">$strspecial | ";
}
if ( $glossary->showalphabet ) {
$alphabet = explode("|", get_string("alphabet","glossary"));
$letters_by_line = 14;
for ($i = 0; $i < count($alphabet); $i++) {
echo "wwwroot/mod/glossary/view.php?id=$id&l=$alphabet[$i]\">$alphabet[$i]";
if ((int) ($i % $letters_by_line) != 0 or $i == 0) {
echo " | ";
} else {
echo "
";
}
}
}
if ( $glossary->showall ) {
echo "wwwroot/mod/glossary/view.php?id=$id&l=ALL\">$strallentries
"; if ($l) { $CurrentLetter = ""; if ($l == "ALL" or $l == "SPECIAL") { if ( $l == "ALL" ) { echo "
"; } elseif ($l == "SPECIAL") { echo "
"; } } } elseif( $search ) { echo get_string("search") . ": $search"; } $data[0]->link = "view.php?id=$id&l=$l&eid=$eid&search=$search&includedefinition=$includedefinition"; $data[0]->caption = get_string("standardview","glossary"); $data[1]->link = "view.php?id=$id&l=$l&eid=$eid&search=$search&includedefinition=$includedefinition¤tview=categories&cat=$cat"; $data[1]->caption = get_string("categoryview","glossary"); $tCFG->TabTableBGColor = $THEME->cellcontent2; $tCFG->TabTableWidth = "70%"; $tCFG->ActiveTabColor = $THEME->cellcontent2; $tCFG->InactiveTabColor = $THEME->cellheading2; $tCFG->TabsPerRow = 5; $tCFG->TabSeparation = 4; if ( $cat ) { $CurrentTab = 1; } else { $CurrentTab = 0; } print_tabbed_table_start($data, $CurrentTab, $tCFG); echo "
"; } echo "\n
cellheading2\">"; } echo "$CurrentLetter"; if ( $glossary->displayformat == 0 ) { echo "\n |