1 | <!--{* |
---|
2 | /* |
---|
3 | * This file is part of EC-CUBE |
---|
4 | * |
---|
5 | * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved. |
---|
6 | * |
---|
7 | * http://www.lockon.co.jp/ |
---|
8 | * |
---|
9 | * This program is free software; you can redistribute it and/or |
---|
10 | * modify it under the terms of the GNU General Public License |
---|
11 | * as published by the Free Software Foundation; either version 2 |
---|
12 | * of the License, or (at your option) any later version. |
---|
13 | * |
---|
14 | * This program is distributed in the hope that it will be useful, |
---|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | * GNU General Public License for more details. |
---|
18 | * |
---|
19 | * You should have received a copy of the GNU General Public License |
---|
20 | * along with this program; if not, write to the Free Software |
---|
21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
22 | */ |
---|
23 | *}--> |
---|
24 | <script type="text/javascript"> |
---|
25 | <!-- |
---|
26 | |
---|
27 | function func_regist(url) { |
---|
28 | res = confirm('この内容で<!--{if $edit_mode eq "on"}-->編集<!--{else}-->登録<!--{/if}-->しても宜しいですか?'); |
---|
29 | if(res == true) { |
---|
30 | document.form1.mode.value = 'regist'; |
---|
31 | document.form1.submit(); |
---|
32 | return false; |
---|
33 | } |
---|
34 | return false; |
---|
35 | } |
---|
36 | |
---|
37 | function func_edit(news_id) { |
---|
38 | document.form1.mode.value = "search"; |
---|
39 | document.form1.news_id.value = news_id; |
---|
40 | document.form1.submit(); |
---|
41 | } |
---|
42 | |
---|
43 | function func_del(news_id) { |
---|
44 | res = confirm('この新着情報を削除しても宜しいですか?'); |
---|
45 | if(res == true) { |
---|
46 | document.form1.mode.value = "delete"; |
---|
47 | document.form1.news_id.value = news_id; |
---|
48 | document.form1.submit(); |
---|
49 | } |
---|
50 | return false; |
---|
51 | } |
---|
52 | |
---|
53 | function func_rankMove(term,news_id) { |
---|
54 | document.form1.mode.value = "move"; |
---|
55 | document.form1.news_id.value = news_id; |
---|
56 | document.form1.term.value = term; |
---|
57 | document.form1.submit(); |
---|
58 | } |
---|
59 | |
---|
60 | function moving(news_id,rank, max_rank) { |
---|
61 | |
---|
62 | var val; |
---|
63 | var ml; |
---|
64 | var len; |
---|
65 | |
---|
66 | ml = document.move; |
---|
67 | len = document.move.elements.length; |
---|
68 | j = 0; |
---|
69 | for( var i = 0 ; i < len ; i++) { |
---|
70 | if ( ml.elements[i].name == 'position' && ml.elements[i].value != "" ) { |
---|
71 | val = ml.elements[i].value; |
---|
72 | j ++; |
---|
73 | } |
---|
74 | } |
---|
75 | |
---|
76 | if ( j > 1) { |
---|
77 | alert( '移動順位は1つだけ入力してください。' ); |
---|
78 | return false; |
---|
79 | } else if( ! val ) { |
---|
80 | alert( '移動順位を入力してください。' ); |
---|
81 | return false; |
---|
82 | } else if( val.length > 4){ |
---|
83 | alert( '移動順位は4桁以内で入力してください。' ); |
---|
84 | return false; |
---|
85 | } else if( val.match(/[0-9]+/g) != val){ |
---|
86 | alert( '移動順位は数字で入力してください。' ); |
---|
87 | return false; |
---|
88 | } else if( val == rank ){ |
---|
89 | alert( '移動させる番号が重複しています。' ); |
---|
90 | return false; |
---|
91 | } else if( val == 0 ){ |
---|
92 | alert( '移動順位は0以上で入力してください。' ); |
---|
93 | return false; |
---|
94 | } else if( val > max_rank ){ |
---|
95 | alert( '入力された順位は、登録数の最大値を超えています。' ); |
---|
96 | return false; |
---|
97 | } else { |
---|
98 | ml.moveposition.value = val; |
---|
99 | ml.rank.value = rank; |
---|
100 | ml.news_id.value = news_id; |
---|
101 | ml.submit(); |
---|
102 | return false; |
---|
103 | } |
---|
104 | } |
---|
105 | |
---|
106 | //--> |
---|
107 | </script> |
---|
108 | |
---|
109 | |
---|
110 | <div id="admin-contents" class="contents-main"> |
---|
111 | <form name="form1" id="form1" method="post" action="?"> |
---|
112 | <input type="hidden" name="mode" value="" /> |
---|
113 | <input type="hidden" name="news_id" value="<!--{$arrForm.news_id|h}-->" /> |
---|
114 | <input type="hidden" name="term" value="" /> |
---|
115 | <!--{* ▼登録テーブルここから *}--> |
---|
116 | <table> |
---|
117 | <tr> |
---|
118 | <th>日付<span class="attention"> *</span></th> |
---|
119 | <td> |
---|
120 | <!--{if $arrErr.year || $arrErr.month || $arrErr.day}--><span class="attention"><!--{$arrErr.year}--><!--{$arrErr.month}--><!--{$arrErr.day}--></span><!--{/if}--> |
---|
121 | <select name="year" <!--{if $arrErr.year}-->style="background-color:<!--{$smarty.const.ERR_COLOR|h}-->"<!--{/if}-->> |
---|
122 | <option value="" selected>----</option> |
---|
123 | <!--{html_options options=$arrYear selected=$arrForm.year}--> |
---|
124 | </select>年 |
---|
125 | <select name="month" <!--{if $arrErr.month}-->style="background-color:<!--{$smarty.const.ERR_COLOR|h}-->"<!--{/if}-->> |
---|
126 | <option value="" selected>--</option> |
---|
127 | <!--{html_options options=$arrMonth selected=$arrForm.month}--> |
---|
128 | </select>月 |
---|
129 | <select name="day" <!--{if $arrErr.day}-->style="background-color:<!--{$smarty.const.ERR_COLOR|h}-->"<!--{/if}-->> |
---|
130 | <option value="" selected>--</option> |
---|
131 | <!--{html_options options=$arrDay selected=$arrForm.day}--> |
---|
132 | </select>日 |
---|
133 | </td> |
---|
134 | </tr> |
---|
135 | <tr> |
---|
136 | <th>タイトル<span class="attention"> *</span></th> |
---|
137 | <td> |
---|
138 | <!--{if $arrErr.news_title}--><span class="attention"><!--{$arrErr.news_title}--></span><!--{/if}--> |
---|
139 | <textarea name="news_title" cols="60" rows="8" class="area60" maxlength="<!--{$smarty.const.MTEXT_LEN}-->" <!--{if $arrErr.news_title}-->style="background-color:<!--{$smarty.const.ERR_COLOR|h}-->"<!--{/if}-->><!--{$arrForm.news_title|h}--></textarea><br /> |
---|
140 | <span class="attention"> (上限<!--{$smarty.const.MTEXT_LEN}-->文字)</span> |
---|
141 | </td> |
---|
142 | </tr> |
---|
143 | <tr> |
---|
144 | <th>URL</th> |
---|
145 | <td> |
---|
146 | <span class="attention"><!--{$arrErr.news_url}--></span> |
---|
147 | <input type="text" name="news_url" size="60" class="box60" value="<!--{$arrForm.news_url|h}-->" <!--{if $arrErr.news_url}-->style="background-color:<!--{$smarty.const.ERR_COLOR|h}-->"<!--{/if}--> maxlength="<!--{$smarty.const.URL_LEN}-->" /> |
---|
148 | <span class="attention"> (上限<!--{$smarty.const.URL_LEN}-->文字)</span> |
---|
149 | </td> |
---|
150 | </tr> |
---|
151 | <tr> |
---|
152 | <th>リンク</th> |
---|
153 | <td><label><input type="checkbox" name="link_method" value="2" <!--{if $arrForm.link_method eq 2}--> checked <!--{/if}--> /> 別ウィンドウで開く</label></td> |
---|
154 | </tr> |
---|
155 | <tr> |
---|
156 | <th>本文作成</th> |
---|
157 | <td> |
---|
158 | <!--{if $arrErr.news_comment}--><span class="attention"><!--{$arrErr.news_comment}--></span><!--{/if}--> |
---|
159 | <textarea name="news_comment" cols="60" rows="8" wrap="soft" class="area60" maxlength="<!--{$smarty.const.LTEXT_LEN}-->" style="background-color:<!--{if $arrErr.news_comment}--><!--{$smarty.const.ERR_COLOR|h}--><!--{/if}-->"><!--{$arrForm.news_comment|h}--></textarea><br /> |
---|
160 | <span class="attention"> (上限3000文字)</span> |
---|
161 | </td> |
---|
162 | </tr> |
---|
163 | </table> |
---|
164 | <!--{* ▲登録テーブルここまで *}--> |
---|
165 | |
---|
166 | <div class="btn"><a class="btn-normal" href="javascript:;" onclick="return func_regist();"><span>この内容で登録する</span></a></div> |
---|
167 | </form> |
---|
168 | |
---|
169 | <h2>新着情報一覧</h2> |
---|
170 | <!--{if $arrErr.moveposition}--> |
---|
171 | <p><span class="attention"><!--{$arrErr.moveposition}--></span></p> |
---|
172 | <!--{/if}--> |
---|
173 | <!--{* ▼一覧表示エリアここから *}--> |
---|
174 | <form name="move" id="move" method="post" action="?"> |
---|
175 | <input type="hidden" name="mode" value="moveRankSet" /> |
---|
176 | <input type="hidden" name="term" value="setposition" /> |
---|
177 | <input type="hidden" name="news_id" value="" /> |
---|
178 | <input type="hidden" name="moveposition" value="" /> |
---|
179 | <input type="hidden" name="rank" value="" /> |
---|
180 | <table class="list"> |
---|
181 | <tr> |
---|
182 | <th>順位</th> |
---|
183 | <th>日付</th> |
---|
184 | <th>タイトル</th> |
---|
185 | <th>編集</th> |
---|
186 | <th>削除</th> |
---|
187 | <th>移動</th> |
---|
188 | </tr> |
---|
189 | <!--{section name=data loop=$list_data}--> |
---|
190 | <tr style="background:<!--{if $list_data[data].news_id eq $news_id}--><!--{$smarty.const.SELECT_RGB}--><!--{else}-->#ffffff<!--{/if}-->;" class="center"> |
---|
191 | <!--{assign var=db_rank value="`$list_data[data].rank`"}--> |
---|
192 | <!--{assign var=rank value="`$line_max-$db_rank+1`"}--> |
---|
193 | <td><!--{$rank|h}--></td> |
---|
194 | <td><!--{$list_data[data].cast_news_date|date_format:"%Y/%m/%d"}--></td> |
---|
195 | <td class="left"> |
---|
196 | <!--{if $list_data[data].link_method eq 1 && $list_data[data].news_url != ""}--><a href="<!--{$list_data[data].news_url|h}-->" ><!--{$list_data[data].news_title|h|nl2br}--></a> |
---|
197 | <!--{elseif $list_data[data].link_method eq 1 && $list_data[data].news_url == ""}--><!--{$list_data[data].news_title|h|nl2br}--> |
---|
198 | <!--{elseif $list_data[data].link_method eq 2 && $list_data[data].news_url != ""}--><a href="<!--{$list_data[data].news_url|h}-->" target="_blank" ><!--{$list_data[data].news_title|h|nl2br}--></a> |
---|
199 | <!--{else}--><!--{$list_data[data].news_title|h|nl2br}--> |
---|
200 | <!--{/if}--> |
---|
201 | </td> |
---|
202 | <td><a href="#" onclick="return func_edit('<!--{$list_data[data].news_id|h}-->');">編集</a></td> |
---|
203 | <td><a href="#" onclick="return func_del('<!--{$list_data[data].news_id|h}-->');">削除</a></td> |
---|
204 | <td> |
---|
205 | <!--{if count($list_data) != 1}--> |
---|
206 | <input type="text" name="pos-<!--{$list_data[data].news_id|h}-->" size="3" class="box3" />番目へ<a href="?" onclick="fnFormModeSubmit('move', 'moveRankSet','news_id', '<!--{$list_data[data].news_id|h}-->'); return false;">移動</a><br /> |
---|
207 | <!--{/if}--> |
---|
208 | <!--{if $list_data[data].rank ne $max_rank}--><a href="#" onclick="return func_rankMove('up', '<!--{$list_data[data].news_id|h}-->', '<!--{$max_rank|h}-->');">上へ</a><!--{/if}--> <!--{if $list_data[data].rank ne 1}--><a href="#" onclick="return func_rankMove('down', '<!--{$list_data[data].news_id|h}-->', '<!--{$max_rank|h}-->');">下へ</a><!--{/if}--> |
---|
209 | </td> |
---|
210 | </tr> |
---|
211 | <!--{sectionelse}--> |
---|
212 | <tr class="center"> |
---|
213 | <td colspan="6">現在データはありません。</td> |
---|
214 | </tr> |
---|
215 | <!--{/section}--> |
---|
216 | </table> |
---|
217 | </form> |
---|
218 | <!--{* ▲一覧表示エリアここまで *}--> |
---|
219 | |
---|
220 | </div> |
---|