-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathview.php
More file actions
executable file
·79 lines (62 loc) · 2.62 KB
/
view.php
File metadata and controls
executable file
·79 lines (62 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
require_once("../../config.php");
require_once("lib.php");
$id = optional_param('id', 0, PARAM_INT); // Course Module ID, or
$a = optional_param('a', 0, PARAM_INT); // newmodule ID
if ($id) {
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 (! $mindmap = get_record("mindmap", "id", $cm->instance)) {
error("Course module is incorrect");
}
} else {
if (! $mindmap = get_record("mindmap", "id", $a)) {
error("Course module is incorrect");
}
if (! $course = get_record("course", "id", $mindmap->course)) {
error("Course is misconfigured");
}
if (! $cm = get_coursemodule_from_instance("mindmap", $mindmap->id, $course->id)) {
error("Course Module ID was incorrect");
}
}
require_login($course->id);
add_to_log($course->id, "mindmap", "view", "view.php?id=$cm->id", "$mindmap->id");
/// Print the page header
$strmindmaps = get_string("modulenameplural", "mindmap");
$strmindmap = get_string("modulename", "mindmap");
$navlinks = array();
$navlinks[] = array('name' => $strmindmaps, 'link' => "index.php?id=$course->id", 'type' => 'activity');
$navlinks[] = array('name' => format_string($mindmap->name), 'link' => '', 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
print_header_simple(format_string($mindmap->name), "", $navigation, "", "", true,
update_module_button($cm->id, $course->id, $strmindmap), navmenu($course, $cm));
?>
<br /> <br />
<div id="flashcontent" style="margin:0 auto; padding:0px; text-align:center; border:1px black solid; width:900px;">
</div>
<script type="text/javascript" src="./swfobject.js"></script>
<script type="text/javascript">
// <![CDATA[
function mm_save(str)
{
alert(decodeURI(str));
}
var so = new SWFObject("./viewer43.swf", "viewer", 900, 600, "9", "#FFFFFF");
so.addVariable("load_url", "./xml.php?id=<?php echo $mindmap->id;?>");
<?php if((!empty($USER->id) && $mindmap->userid == $USER->id) || $mindmap->editable == '1'):?>
so.addVariable('save_url', "./save.php?id=<?php echo $mindmap->id;?>");
so.addVariable('auto_node_url', "./auto_node.php");
so.addVariable('editable', "true");
<?php endif;?>
so.addVariable("lang", "en");
so.write("flashcontent");
// ]]>
</script>
<?php
print_footer($course);
?>