| [ Index ] |
PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008] |
[Summary view] [Print] [Text view]
1 <?php // $Id: showentry.php,v 1.40 2007/08/17 19:09:21 nicolasconnault Exp $ 2 require_once("../../config.php"); 3 require_once ("lib.php"); 4 5 $concept = optional_param('concept', '', PARAM_CLEAN); 6 $courseid = optional_param('courseid', 0, PARAM_INT); 7 $eid = optional_param('eid', 0, PARAM_INT); // glossary entry id 8 $displayformat = optional_param('displayformat',-1, PARAM_SAFEDIR); 9 10 if ($CFG->forcelogin) { 11 require_login(); 12 } 13 14 if ($eid) { 15 $entry = get_record("glossary_entries", "id", $eid); 16 $glossary = get_record('glossary','id',$entry->glossaryid); 17 $entry->glossaryname = format_string($glossary->name,true); 18 if (!$cm = get_coursemodule_from_instance("glossary", $glossary->id)) { 19 error("Could not determine which course module this belonged to!"); 20 } 21 if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_MODULE, $cm->id))) { 22 redirect($CFG->wwwroot.'/course/view.php?id='.$cm->course, get_string('activityiscurrentlyhidden')); 23 } 24 $entry->cmid = $cm->id; 25 $entry->courseid = $cm->course; 26 $entries[] = $entry; 27 } else if ($concept) { 28 $entries = glossary_get_entries_search($concept, $courseid); 29 } else { 30 error('No valid entry specified'); 31 } 32 33 if ($entries) { 34 foreach ($entries as $key => $entry) { 35 //$entries[$key]->footer = "<p align=\"right\">» <a onClick=\"if (window.opener) {window.opener.location.href='$CFG->wwwroot/mod/glossary/view.php?g=$entry->glossaryid'; return false;} else {openpopup('/mod/glossary/view.php?g=$entry->glossaryid', 'glossary', 'menubar=1,location=1,toolbar=1,scrollbars=1,directories=1,status=1,resizable=1', 0); return false;}\" href=\"$CFG->wwwroot/mod/glossary/view.php?g=$entry->glossaryid\" target=\"_blank\">".format_string($entry->glossaryname,true)."</a></p>"; // Could not get this to work satisfactorily in all cases - Martin 36 $entries[$key]->footer = "<p style=\"text-align:right\">» <a href=\"$CFG->wwwroot/mod/glossary/view.php?g=$entry->glossaryid\">".format_string($entry->glossaryname,true)."</a></p>"; 37 add_to_log($entry->courseid, "glossary", "view entry", "showentry.php?eid=$entry->id", $entry->id, $entry->cmid); 38 } 39 } 40 41 if (!empty($courseid)) { 42 $course = get_record("course", "id", $courseid); 43 if ($course->id != SITEID) { 44 require_login($courseid); 45 } 46 47 $strglossaries = get_string("modulenameplural", "glossary"); 48 $strsearch = get_string("search"); 49 50 $CFG->framename = "newwindow"; 51 $navlinks = array(); 52 $navlinks[] = array('name' => $strglossaries, 'link' => '', 'type' => 'activity'); 53 $navlinks[] = array('name' => $strsearch, 'link' => '', 'type' => 'title'); 54 55 $navigation = build_navigation($navlinks); 56 57 print_header(strip_tags("$course->shortname: $strglossaries $strsearch"), $course->fullname, $navigation, "", "", true, " ", " "); 58 59 } else { 60 print_header(); // Needs to be something here to allow linking back to the whole glossary 61 } 62 63 if ($entries) { 64 glossary_print_dynaentry($courseid, $entries, $displayformat); 65 } 66 67 close_window_button(); 68 69 /// Show one reduced footer 70 print_footer('none'); 71 72 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Jan 14 11:33:29 2009 | Cross-referenced by PHPXref 0.7 |