-
Notifications
You must be signed in to change notification settings - Fork 1
/
suggestions.htm
executable file
·126 lines (93 loc) · 4.14 KB
/
suggestions.htm
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<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>
<?php
$linktoexistent = get_string('linktoexistent', 'hiperbook');
$newitem= get_string('newitem', 'hiperbook');
if ($suggestion == 0) { ?>
<input type="radio" name="tipo" value="new" onClick="toggleBox('real_chapter',1);toggleBox('link_chapter',0);" ><?php echo $newitem; ?>
<input type="radio" name="tipo" value="link" onClick="toggleBox('link_chapter',1);toggleBox('real_chapter',0);" >
<?php
echo $linktoexistent;
} ?>
<? if ($backbtn) { ?><a href="suggestions.php?chapterid=<?= $chapterid ?>&edit=<?= $edit ?>&id=<?= $cm->id ?>&pageid=<?php echo $pageid ?>&groupid=<?php echo $groupid?>" > voltar </a>
<? } if ((($edit==1)||($add==1))&&!$view) {
if($suggestion->id){ ?>
<a href="suggestions.php?suggestionid=<?=$suggestion->id?>&id=<?=$cm->id?>&delete=1&edit=1&chapterid=<?=$chapterid?>&pageid=<?php echo $pageid ?>&groupid=<?php echo $groupid?>"><img src="<?= $CFG->pixpath?>/t/delete.gif" border="0"> </a>
<? } ?>
<form name="suggestioneditform" method="post" action="suggestions.php?groupid=<?php echo $groupid ?>">
<div id='real_chapter' <?php if ($suggestion == 0) { ?> class="hidden" <?php } ?>>
suggestion:
<input type="text" value="<?= $suggestion->title ?>" name="title">
<br>
Conteúdo:
<?
if ($suggestion > 0) {
print_textarea($usehtmleditor, 14, 64, 320, 150, 'content', $suggestion->content, $course->id);
}else{
print_textarea($usehtmleditor, 14, 64, 320, 150, 'content', $book->template_hw, $course->id);
}
?>
<input type="submit" value="<?php print_string('savechanges') ?>" />
<input type="reset" value="<?php print_string('revert') ?>"/>
</div>
<div id='link_chapter' class="hidden">
<select name="suggestionid_existent">
<option value="0" selected="selected"> </option>
<?php
//$suggestions = get_records_sql('select * from '.$CFG->prefix.'hiperbook_pages_suggestions ph, '.$CFG->prefix.'hiperbook_chapters_suggestions ch where ph.idpage = '.$page->id.' and ph.idsuggestion= ch.id');
// se grupos separados, mostra apenas todos os participantes e do grupo
if($cm->groupmode == SEPARATEGROUPS){
$sqlaux = ' and (groupid = 0 or groupid = '.$groupid.' )';
}
$suggestions = get_records_sql('select * from '.$CFG->prefix.'hiperbook_chapters_suggestions where idhiperbook ='.$book->id.' '. $sqlaux);
foreach($suggestions as $hw){
?>
<option value="<?php echo $hw->id;?>"><?php echo $hw->title;?> </option>
<?php
}
?>
</select>
<input type="submit" value="<?php print_string('savechanges') ?>" />
<input type="reset" value="<?php print_string('revert') ?>"/>
</div>
<input type="hidden" name="groupid" value="<?= $groupid ?>" />
<input type="hidden" name="pageid" value="<?= $pageid ?>" />
<input type="hidden" name="chapterid" value="<?= $chapterid ?>" />
<input type="hidden" name="suggestionid" value="<?= $suggestionid ?>" />
<input type="hidden" name="suggestionnum" value="<?= $suggestionnum ?>" />
<input type="hidden" name="id" value="<?php p($cm->id) ?>" />
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
<input type="hidden" name="edit" value="<?= $edit?>" />
<? }else{ ?>
<div class="corpotexto"><b><? echo $suggestion->title; ?></b>
<br>
<?
echo $suggestion->content;
}?></div>
</form>