-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathedit.html
executable file
·104 lines (91 loc) · 3.85 KB
/
edit.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!-- $Id: edit.html,v 1.5 2004/11/15 22:01:05 skodak Exp $ //-->
<script type="text/javascript">
<!--
function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
if(document.layers) //NN4+
{
document.layers[szDivID].visibility = iState ? "show" : "hide";
document.layers[szDivID].display = iState ? "block" : "none";
}
else if(document.getElementById) //gecko(NN6) + IE 5+
{
var obj = document.getElementById(szDivID);
obj.style.visibility = iState ? "visible" : "hidden";
obj.style.display = iState ? "block" : "none";
}
else if(document.all) // IE 4
{
document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
document.all[szDivID].style.display = iState ? "block" : "none";
}
}
// -->
</script>
<style type="text/css">
<!--
.hidden { z-index:99; visibility:hidden; display:none;}
-->
</style>
<form name="chaptereditform" method="post" action="edit.php">
<table align="center" cellpadding="5">
<? if ($chapter->id == 0) { ?>
<input type="radio" name="tipo" value="new" onClick="toggleBox('real_chapter',1);toggleBox('link_chapter',0);" checked="checked"><?php print_string('newchapter','hiperbook') ?>
<input type="radio" name="tipo" value="link" onClick="toggleBox('link_chapter',1);toggleBox('real_chapter',0);" ><?php print_string('linktoexistent','hiperbook') ?>
<? } ?>
<tr valign="top">
<td align="right">
<b><?php print_string("chaptertitle", "hiperbook") ?>:</b>
</td>
<td align="left" valign="top"><div id='link_chapter' class="hidden">
<select name="targetchapterid">
<?php
global $db;
//$db->debug =true;
if ($isteacher){
$select = ' and hidden=1';
}else{ // stdudents
$select = ' and hidden =0';
if($groupmode == 1){ // separate groups
$select .= ' and groupid ='.$groupid;
}
}
// var_dump($groupid);
$lchapters = get_records_select('hiperbook_chapters', 'bookid='.$cm->instance . $select, 'id');
foreach($lchapters as $lchapter){
if($link->targetchapterid == $lchapter->id){
echo "<option value=\"". $lchapter->id."\" selected>". $lchapter->title."</option>";
}else{
echo "<option value=\"". $lchapter->id."\" >". $lchapter->title."</option>";
}
}
?>
</select>
</div>
<div id='real_chapter' class="hidden">
<br />
<input type="text" name="title" size="30" value="<?php p($chapter->title) ?>">
</div>
</td>
</tr>
</table>
<center>
<input type="submit" value="<?php print_string('savechanges') ?>" />
<input type="reset" value="<?php print_string('revert') ?>" />
<?php
if($chapter->id == -1) {
echo '<font size="-1"> (<a href="import.php?id='.$cm->id.'">'.get_string('doimport', 'book').'</a>)</font>';
}
?>
</center>
<input type="hidden" name="id" value="<?php p($cm->id) ?>" />
<input type="hidden" name="groupid" value="<?php p($groupid) ?>" />
<input type="hidden" name="chapternum" value="<?php p($chapternum) ?>" />
<input type="hidden" name="parentnavchapterid" value="<?php p($parentnavchapterid) ?>" />
<input type="hidden" name="target_navigation_chapter" value="<?php p($target_navigation_chapter) ?>" />
<input type="hidden" name="navigationnum" value="<?php p($navigationnum) ?>" />
<? if ($chapter->id) { ?> <input type="hidden" name="chapterid" value="<?php p($chapter->id) ?>" /> <? } ?>
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
</form>
<script> toggleBox('real_chapter',1);
toggleBox('link_chapter',0); </script>