forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
export_basic.html
66 lines (63 loc) · 3.49 KB
/
export_basic.html
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
<fieldset>
<legend><?php print_string('commontasks', 'calendar'); ?></legend>
<form method="get" action="export_execute.php">
<div><?php print_string('iwanttoexport', 'calendar'); ?>:</div>
<div class="indent">
<input type="radio" name="preset_what" id="pw_all" value="all" checked="checked"/><label for="pw_all"><?php print_string('eventsall', 'calendar'); ?></label><br />
<input type="radio" name="preset_what" id="pw_course" value="courses" /><label for="pw_course"><?php print_string('eventsrelatedtocourses', 'calendar'); ?></label><br />
</div>
<div><?php print_string('for', 'calendar'); ?>:</div>
<div class="indent">
<?php if($allowthisweek) { ?>
<input type="radio" name="preset_time" id="pt_wknow" value="weeknow" checked="checked"/><label for="pt_wknow"><?php print_string('weekthis', 'calendar'); ?></label><br />
<?php } ?>
<?php if($allownextweek) { ?>
<input type="radio" name="preset_time" id="pt_wknext" value="weeknext" /><label for="pt_wknext"><?php print_string('weeknext', 'calendar'); ?></label><br />
<?php } ?>
<input type="radio" name="preset_time" id="pt_monnow" value="monthnow" /><label for="pt_monnow"><?php print_string('monththis', 'calendar'); ?></label><br />
<?php if($allownextmonth) { ?>
<input type="radio" name="preset_time" id="pt_monnext" value="monthnext" /><label for="pt_monnext"><?php print_string('monthnext', 'calendar'); ?></label><br />
<?php } ?>
<input type="radio" name="preset_time" id="pt_recupc" value="recentupcoming" /><label for="pt_recupc"><?php print_string('recentupcoming', 'calendar'); ?></label><br />
</div>
<div style="text-align: right;">
<input type="hidden" name="cal_d" value="" />
<input type="hidden" name="cal_m" value="" />
<input type="hidden" name="cal_y" value="" />
<input type="hidden" name="username" value="<?php echo $username; ?>" />
<input type="hidden" name="authtoken" value="<?php echo $authtoken; ?>" />
<script type="text/javascript">
//<![CDATA[
function generate_url() {
if (document.getElementById("pw_course").checked) {
preset_what = "courses";
} else {
preset_what = "all";
}
if (<?php echo (int) $allowthisweek; ?> && document.getElementById("pt_wknow").checked) {
preset_time = "weeknow";
} else if (<?php echo (int) $allownextweek; ?> && document.getElementById("pt_wknext").checked) {
preset_time = "weeknext";
} else if (<?php echo (int) $allownextmonth; ?> && document.getElementById("pt_monnext").checked) {
preset_time = "monthnext";
} else if (document.getElementById("pt_monnow").checked) {
preset_time = "monthnow";
} else {
preset_time = "recentupcoming";
}
urlstr = "<?php echo $CFG->wwwroot; ?>/calendar/export_execute.php?preset_what=" + preset_what + "&preset_time=" + preset_time + "&username=<?php echo $usernameencoded; ?>&authtoken=<?php echo $authtoken; ?>";
document.getElementById("url").innerText = urlstr;
document.getElementById("url").innerHTML = urlstr; //Need this as well, for Firefox
document.getElementById("urlbox").style.display = "block";
}
//]]>
</script>
<input type="button" value="<?php print_string('generateurlbutton', 'calendar'); ?>" onclick="javascript:generate_url()" />
<input type="submit" value="<?php print_string('exportbutton', 'calendar'); ?>" />
</div>
</form>
</fieldset>
<div id="urlbox" style="display: none; ">
<p><?php print_string('urlforical', 'calendar'); ?>:</p>
<div id="url" style="overflow: scroll; width: 650px; "></div>
</div>