1 | <!--{* |
---|
2 | /* |
---|
3 | * This file is part of EC-CUBE |
---|
4 | * |
---|
5 | * Copyright(c) 2000-2012 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 | |
---|
25 | <script type="text/javascript"> |
---|
26 | <!-- |
---|
27 | |
---|
28 | function func_regist(url) { |
---|
29 | res = confirm('<!--{if $edit_mode eq "on"}--><!--{t string="tpl_172"}--><!--{else}--><!--{t string="tpl_173"}--><!--{/if}-->'); |
---|
30 | if(res == true) { |
---|
31 | document.form1.mode.value = 'regist'; |
---|
32 | document.form1.submit(); |
---|
33 | return false; |
---|
34 | } |
---|
35 | return false; |
---|
36 | } |
---|
37 | |
---|
38 | function func_edit(news_id) { |
---|
39 | document.form1.mode.value = "search"; |
---|
40 | document.form1.news_id.value = news_id; |
---|
41 | document.form1.submit(); |
---|
42 | } |
---|
43 | |
---|
44 | function func_del(news_id) { |
---|
45 | res = confirm('<!--{t string="tpl_174"}-->'); |
---|
46 | if(res == true) { |
---|
47 | document.form1.mode.value = "delete"; |
---|
48 | document.form1.news_id.value = news_id; |
---|
49 | document.form1.submit(); |
---|
50 | } |
---|
51 | return false; |
---|
52 | } |
---|
53 | |
---|
54 | function func_rankMove(term,news_id) { |
---|
55 | document.form1.mode.value = "move"; |
---|
56 | document.form1.news_id.value = news_id; |
---|
57 | document.form1.term.value = term; |
---|
58 | document.form1.submit(); |
---|
59 | } |
---|
60 | |
---|
61 | function moving(news_id,rank, max_rank) { |
---|
62 | |
---|
63 | var val; |
---|
64 | var ml; |
---|
65 | var len; |
---|
66 | |
---|
67 | ml = document.move; |
---|
68 | len = document.move.elements.length; |
---|
69 | j = 0; |
---|
70 | for( var i = 0 ; i < len ; i++) { |
---|
71 | if ( ml.elements[i].name == 'position' && ml.elements[i].value != "" ) { |
---|
72 | val = ml.elements[i].value; |
---|
73 | j ++; |
---|
74 | } |
---|
75 | } |
---|
76 | |
---|
77 | if ( j > 1) { |
---|
78 | alert( '<!--{t string="tpl_175"}-->' ); |
---|
79 | return false; |
---|
80 | } else if( ! val ) { |
---|
81 | alert( '<!--{t string="tpl_176"}-->' ); |
---|
82 | return false; |
---|
83 | } else if( val.length > 4){ |
---|
84 | alert( '<!--{t string="tpl_177"}-->' ); |
---|
85 | return false; |
---|
86 | } else if( val.match(/[0-9]+/g) != val){ |
---|
87 | alert( '<!--{t string="tpl_178"}-->' ); |
---|
88 | return false; |
---|
89 | } else if( val == rank ){ |
---|
90 | alert( '<!--{t string="tpl_179"}-->' ); |
---|
91 | return false; |
---|
92 | } else if( val == 0 ){ |
---|
93 | alert( '<!--{t string="tpl_180"}-->' ); |
---|
94 | return false; |
---|
95 | } else if( val > max_rank ){ |
---|
96 | alert( '<!--{t string="tpl_181"}-->' ); |
---|
97 | return false; |
---|
98 | } else { |
---|
99 | ml.moveposition.value = val; |
---|
100 | ml.rank.value = rank; |
---|
101 | ml.news_id.value = news_id; |
---|
102 | ml.submit(); |
---|
103 | return false; |
---|
104 | } |
---|
105 | } |
---|
106 | |
---|
107 | //--> |
---|
108 | </script> |
---|
109 | |
---|
110 | |
---|
111 | <div id="admin-contents" class="contents-main"> |
---|
112 | <form name="form1" id="form1" method="post" action="?"> |
---|
113 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
114 | <input type="hidden" name="mode" value="" /> |
---|
115 | <input type="hidden" name="news_id" value="<!--{$arrForm.news_id|h}-->" /> |
---|
116 | <input type="hidden" name="term" value="" /> |
---|
117 | <!--{* ▼登録テーブルここから *}--> |
---|
118 | <table> |
---|
119 | <tr> |
---|
120 | <th><!--{t string="tpl_024"}--><span class="attention"> *</span></th> |
---|
121 | <td> |
---|
122 | <!--{if $arrErr.year || $arrErr.month || $arrErr.day}--><span class="attention"><!--{$arrErr.year}--><!--{$arrErr.month}--><!--{$arrErr.day}--></span><!--{/if}--> |
---|
123 | <select name="year" <!--{if $arrErr.year || $arrErr.month || $arrErr.day }-->style="background-color:<!--{$smarty.const.ERR_COLOR|h}-->"<!--{/if}-->> |
---|
124 | <option value="" selected="selected">----</option> |
---|
125 | <!--{html_options options=$arrYear selected=$arrForm.year}--> |
---|
126 | </select>年 |
---|
127 | <select name="month" <!--{if $arrErr.year || $arrErr.month || $arrErr.day}-->style="background-color:<!--{$smarty.const.ERR_COLOR|h}-->"<!--{/if}-->> |
---|
128 | <option value="" selected="selected">--</option> |
---|
129 | <!--{html_options options=$arrMonth selected=$arrForm.month}--> |
---|
130 | </select>月 |
---|
131 | <select name="day" <!--{if $arrErr.year || $arrErr.month || $arrErr.day}-->style="background-color:<!--{$smarty.const.ERR_COLOR|h}-->"<!--{/if}-->> |
---|
132 | <option value="" selected="selected">--</option> |
---|
133 | <!--{html_options options=$arrDay selected=$arrForm.day}--> |
---|
134 | </select>日 |
---|
135 | </td> |
---|
136 | </tr> |
---|
137 | <tr> |
---|
138 | <th><!--{t string="tpl_022"}--><span class="attention"> *</span></th> |
---|
139 | <td> |
---|
140 | <!--{if $arrErr.news_title}--><span class="attention"><!--{$arrErr.news_title}--></span><!--{/if}--> |
---|
141 | <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 /> |
---|
142 | <span class="attention"> <!--{t string="tpl_023" T_FIELD=$smarty.const.MTEXT_LEN}--></span> |
---|
143 | </td> |
---|
144 | </tr> |
---|
145 | <tr> |
---|
146 | <th><!--{t string="tpl_109"}--></th> |
---|
147 | <td> |
---|
148 | <span class="attention"><!--{$arrErr.news_url}--></span> |
---|
149 | <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}-->" /> |
---|
150 | <span class="attention"> <!--{t string="tpl_023" T_FIELD=$smarty.const.URL_LEN}--></span> |
---|
151 | </td> |
---|
152 | </tr> |
---|
153 | <tr> |
---|
154 | <th><!--{t string="tpl_110"}--></th> |
---|
155 | <td><label><input type="checkbox" name="link_method" value="2" <!--{if $arrForm.link_method eq 2}--> checked <!--{/if}--> /> <!--{t string="tpl_112"}--></label></td> |
---|
156 | </tr> |
---|
157 | <tr> |
---|
158 | <th><!--{t string="tpl_111"}--></th> |
---|
159 | <td> |
---|
160 | <!--{if $arrErr.news_comment}--><span class="attention"><!--{$arrErr.news_comment}--></span><!--{/if}--> |
---|
161 | <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 /> |
---|
162 | <span class="attention"> (<!--{t string="tpl_113"}-->)</span> |
---|
163 | </td> |
---|
164 | </tr> |
---|
165 | </table> |
---|
166 | <!--{* ▲登録テーブルここまで *}--> |
---|
167 | |
---|
168 | <div class="btn-area"> |
---|
169 | <ul> |
---|
170 | <li><a class="btn-action" href="javascript:;" onclick="return func_regist();"><span class="btn-next"><!--{t string="tpl_021"}--></span></a></li> |
---|
171 | </ul> |
---|
172 | </div> |
---|
173 | </form> |
---|
174 | |
---|
175 | <h2><!--{t string="tpl_114"}--></h2> |
---|
176 | <!--{if $arrErr.moveposition}--> |
---|
177 | <p><span class="attention"><!--{$arrErr.moveposition}--></span></p> |
---|
178 | <!--{/if}--> |
---|
179 | <!--{* ▼一覧表示エリアここから *}--> |
---|
180 | <form name="move" id="move" method="post" action="?"> |
---|
181 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
182 | <input type="hidden" name="mode" value="moveRankSet" /> |
---|
183 | <input type="hidden" name="term" value="setposition" /> |
---|
184 | <input type="hidden" name="news_id" value="" /> |
---|
185 | <input type="hidden" name="moveposition" value="" /> |
---|
186 | <input type="hidden" name="rank" value="" /> |
---|
187 | <table class="list"> |
---|
188 | <col width="5%" /> |
---|
189 | <col width="15%" /> |
---|
190 | <col width="45%" /> |
---|
191 | <col width="5%" /> |
---|
192 | <col width="5%" /> |
---|
193 | <col width="25%" /> |
---|
194 | <tr> |
---|
195 | <th><!--{t string="tpl_115"}--></th> |
---|
196 | <th><!--{t string="tpl_024"}--></th> |
---|
197 | <th><!--{t string="tpl_022"}--></th> |
---|
198 | <th class="edit"><!--{t string="tpl_003"}--></th> |
---|
199 | <th class="delete"><!--{t string="tpl_004"}--></th> |
---|
200 | <th><!--{t string="tpl_005"}--></th> |
---|
201 | </tr> |
---|
202 | <!--{section name=data loop=$arrNews}--> |
---|
203 | <tr style="background:<!--{if $arrNews[data].news_id != $tpl_news_id}-->#ffffff<!--{else}--><!--{$smarty.const.SELECT_RGB}--><!--{/if}-->;" class="center"> |
---|
204 | <!--{assign var=db_rank value="`$arrNews[data].rank`"}--> |
---|
205 | <td><!--{math equation="$line_max - $db_rank + 1"}--></td> |
---|
206 | <td><!--{$arrNews[data].cast_news_date|date_format:"%Y/%m/%d"}--></td> |
---|
207 | <td class="left"> |
---|
208 | <!--{if $arrNews[data].link_method eq 1 && $arrNews[data].news_url != ""}--><a href="<!--{$arrNews[data].news_url|h}-->" ><!--{$arrNews[data].news_title|h|nl2br}--></a> |
---|
209 | <!--{elseif $arrNews[data].link_method eq 1 && $arrNews[data].news_url == ""}--><!--{$arrNews[data].news_title|h|nl2br}--> |
---|
210 | <!--{elseif $arrNews[data].link_method eq 2 && $arrNews[data].news_url != ""}--><a href="<!--{$arrNews[data].news_url|h}-->" target="_blank" ><!--{$arrNews[data].news_title|h|nl2br}--></a> |
---|
211 | <!--{else}--><!--{$arrNews[data].news_title|h|nl2br}--> |
---|
212 | <!--{/if}--> |
---|
213 | </td> |
---|
214 | <td> |
---|
215 | <!--{if $arrNews[data].news_id != $tpl_news_id}--> |
---|
216 | <a href="#" onclick="return func_edit('<!--{$arrNews[data].news_id|h}-->');"><!--{t string="tpl_003"}--></a> |
---|
217 | <!--{else}--> |
---|
218 | <!--{t string="tpl_026"}--> |
---|
219 | <!--{/if}--> |
---|
220 | </td> |
---|
221 | <td><a href="#" onclick="return func_del('<!--{$arrNews[data].news_id|h}-->');"><!--{t string="tpl_004"}--></a></td> |
---|
222 | <td> |
---|
223 | <!--{if count($arrNews) != 1}--> |
---|
224 | <input type="text" name="pos-<!--{$arrNews[data].news_id|h}-->" size="3" class="box3" />番目へ<a href="?" onclick="fnFormModeSubmit('move', 'moveRankSet','news_id', '<!--{$arrNews[data].news_id|h}-->'); return false;"><!--{t string="tpl_005"}--></a><br /> |
---|
225 | <!--{/if}--> |
---|
226 | <!--{if $arrNews[data].rank ne $max_rank}--><a href="#" onclick="return func_rankMove('up', '<!--{$arrNews[data].news_id|h}-->', '<!--{$max_rank|h}-->');"><!--{t string="tpl_077"}--></a><!--{/if}--> <!--{if $arrNews[data].rank ne 1}--><a href="#" onclick="return func_rankMove('down', '<!--{$arrNews[data].news_id|h}-->', '<!--{$max_rank|h}-->');"><!--{t string="tpl_078"}--></a><!--{/if}--> |
---|
227 | </td> |
---|
228 | </tr> |
---|
229 | <!--{sectionelse}--> |
---|
230 | <tr class="center"> |
---|
231 | <td colspan="6"><!--{t string="tpl_182"}--></td> |
---|
232 | </tr> |
---|
233 | <!--{/section}--> |
---|
234 | </table> |
---|
235 | </form> |
---|
236 | <!--{* ▲一覧表示エリアここまで *}--> |
---|
237 | |
---|
238 | </div> |
---|