modcp_announcement.htm
5.87 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
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
127
128
129
130
131
<div class="bm bw0 mdcp">
<!--{if $op == 'edit'}-->
<h1 class="mt">{lang mod_announce_edit}</h1>
<!--{else}-->
<h1 class="mt">{lang announcement}</h1>
<!--{/if}-->
<div class="exfm">
<script type="text/javascript" src="{$_G[setting][jspath]}calendar.js?{VERHASH}"></script>
<form method="post" autocomplete="off" action="{$cpscript}?mod=modcp&action=announcement&op={if $op == 'edit'}edit{else}add{/if}">
<input type="hidden" name="formhash" value="{FORMHASH}">
<input type="hidden" name="id" value="$announce[id]">
<input type="hidden" name="displayorder" value="$announce[displayorder]">
<table cellspacing="0" cellpadding="0">
<tr>
<th width="15%">{lang title}:</th>
<td width="35%"><input type="text" name="subject" value="$announce[subject]" class="px" /></td>
<th width="15%">{lang mod_announce_type}:</th>
<td width="35%">
<span class="ftid">
<select name="type" id="type" change="changeinput($('type').value)" class="ps">
<option value="0" $announce[checked][0]>{lang mod_announce_type_text}</option>
<option value="1" $announce[checked][1]>{lang mod_announce_type_url}</option>
</select>
</span>
<script type="text/javascript">
function changeinput(v){
if(v == 0) {
$('annomessage').style.display = $('annomessage_editor').style.display = '';
$('anno_type_url').style.display = 'none';
} else {
$('annomessage').style.display = $('annomessage_editor').style.display = 'none';
$('anno_type_url').style.display = '';
}
}
</script>
</td>
</tr>
<tr>
<th width="15%">{lang starttime}:</th>
<td width="35%" class="hasd">
<input type="text" onclick="showcalendar(event, this, false)" id="starttime" name="starttime" autocomplete="off" value="$announce[starttime]" class="px" tabindex="1" />
<a href="javascript:;" class="dpbtn" onclick="showselect(this, 'starttime', 1)">^</a>
</td>
<th width="15%">{lang endtime}:</th>
<td width="35%" class="hasd cl">
<input type="text" onclick="showcalendar(event, this, false)" id="endtime" name="endtime" autocomplete="off" value="$announce[endtime]" class="px" tabindex="1" />
<a href="javascript:;" class="dpbtn" onclick="showselect(this, 'endtime', 1)">^</a>
</td>
</tr>
<tr>
<th> </th>
<td colspan="3">
<div class="tedt" id="annomessage_editor" {if $announce[checked][1]} style="display:none"{/if}>
<div class="bar">
<!--{eval $seditor = array('anno', array('bold', 'color', 'img', 'link'));}-->
<!--{subtemplate common/seditor}-->
</div>
<div class="area">
<textarea name="message[0]" id="annomessage" class="pt" {if $announce[checked][1]} style="display:none"{/if} />$announce[message]</textarea>
</div>
</div>
<input name="message[1]" id="anno_type_url" value="$announce[message]" class="px"{if $announce[checked][0]} style="display:none"{/if} />
</td>
</tr>
<tr>
<th> </th>
<td colspan="3">
<!--{if $op == 'edit'}-->
<button type="submit" name="submit" id="submit" class="pn" value="true"><strong>{lang edit}</strong></button>
<button type="button" class="pn" onclick="location.href='{$cpscript}?mod=modcp&action=announcement'"><strong>{lang return}</strong></button>
<!--{else}-->
<button type="submit" name="submit" id="submit" class="pn" value="true"><strong>{lang mod_announce_add}</strong></button>
<!--{/if}-->
<!--{if $edit_successed}-->
{lang mod_message_announce_edit}<script type="text/JavaScript">setTimeout("window.location.replace('{$cpscript}?mod=modcp&action=announcement')", 2000);</script>
<!--{elseif $add_successed}-->
{lang mod_message_announce_add}
<!--{/if}-->
</td>
</tr>
</tbody>
</table>
</form>
</div>
<!--{if $op != 'edit'}-->
<h2 class="mtm mbm">{lang mod_announce_list}</h2>
<form method="post" autocomplete="off" action="{$cpscript}?mod=modcp&action=announcement&op=manage">
<input type="hidden" name="formhash" value="{FORMHASH}">
<table id="list_announce" cellspacing="0" cellpadding="0" class="dt">
<thead>
<tr>
<th class="c"> </th>
<th>{lang displayorder}</th>
<th>{lang author}</th>
<th>{lang title}</th>
<th>{lang mod_announce_type}</th>
<th>{lang starttime}</th>
<th>{lang endtime}</th>
<th>{lang action}</th>
</tr>
</thead>
<!--{loop $annlist $ann}-->
<tr $ann['disabled']>
<td><input type="checkbox" name="delete[]" class="pc" value="$ann[id]" $ann['disabled'] /></td>
<td><input type="text" name="order[{$ann[id]}]" class="px" value="$ann[displayorder]" size="3" $ann['disabled'] /></td>
<td>$ann[author]</td>
<td>$ann[subject]</td>
<td><!--{if $ann[type] == 1}-->{lang link}<!--{else}-->{lang text}<!--{/if}--></td>
<td>$ann[starttime]</td>
<td>$ann[endtime]</td>
<td><a href="$cpscript?mod=modcp&action=announcement&op=edit&id=$ann[id]" class="xi2">{lang edit}</a></td>
</tr>
<!--{/loop}-->
<tr class="bw0_all">
<td><label for="chkall" onclick="checkall(this.form)"><input type="checkbox" name="chkall" id="chkall" class="pc" />{lang delete_check}</label></td>
<td colspan="7">
<button type="submit" name="submit" id="submit" class="pn" value="true"><strong>{lang submit}</strong></button>
<!--{if !empty($delids)}-->
{lang mod_message_announce_del}
<!--{/if}-->
</td>
</tr>
</table>
</form>
<!--{/if}-->
</div>
<script type="text/javascript" reload="1">
simulateSelect('type');
</script>