source: branches/version-2_5-dev/data/Smarty/templates/admin/contents/index.tpl @ 20764

Revision 20764, 10.6 KB checked in by nanasess, 13 years ago (diff)

#601 (コピーライトの更新)

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-smarty-template; charset=UTF-8
Line 
1<!--{*
2/*
3 * This file is part of EC-CUBE
4 *
5 * Copyright(c) 2000-2011 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
27function 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
37function func_edit(news_id) {
38    document.form1.mode.value = "search";
39    document.form1.news_id.value = news_id;
40    document.form1.submit();
41}
42
43function 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
53function 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
60function 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="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
113<input type="hidden" name="mode" value="" />
114<input type="hidden" name="news_id" value="<!--{$arrForm.news_id|h}-->" />
115<input type="hidden" name="term" value="" />
116    <!--{* ▼登録テーブルここから *}-->
117    <table>
118        <tr>
119            <th>日付<span class="attention"> *</span></th>
120            <td>
121                <!--{if $arrErr.year || $arrErr.month || $arrErr.day}--><span class="attention"><!--{$arrErr.year}--><!--{$arrErr.month}--><!--{$arrErr.day}--></span><!--{/if}-->
122                <select name="year" <!--{if $arrErr.year || $arrErr.month || $arrErr.day }-->style="background-color:<!--{$smarty.const.ERR_COLOR|h}-->"<!--{/if}-->>
123                    <option value="" selected="selected">----</option>
124                    <!--{html_options options=$arrYear selected=$arrForm.year}-->
125                </select>年
126                <select name="month" <!--{if $arrErr.year || $arrErr.month || $arrErr.day}-->style="background-color:<!--{$smarty.const.ERR_COLOR|h}-->"<!--{/if}-->>
127                    <option value="" selected="selected">--</option>
128                    <!--{html_options options=$arrMonth selected=$arrForm.month}-->
129                </select>月
130                <select name="day" <!--{if $arrErr.year || $arrErr.month || $arrErr.day}-->style="background-color:<!--{$smarty.const.ERR_COLOR|h}-->"<!--{/if}-->>
131                    <option value="" selected="selected">--</option>
132                    <!--{html_options options=$arrDay selected=$arrForm.day}-->
133                </select>日
134            </td>
135        </tr>
136        <tr>
137            <th>タイトル<span class="attention"> *</span></th>
138            <td>
139                <!--{if $arrErr.news_title}--><span class="attention"><!--{$arrErr.news_title}--></span><!--{/if}-->
140                <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 />
141                <span class="attention"> (上限<!--{$smarty.const.MTEXT_LEN}-->文字)</span>
142            </td>
143        </tr>
144        <tr>
145            <th>URL</th>
146            <td>
147                <span class="attention"><!--{$arrErr.news_url}--></span>
148                <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}-->" />
149                <span class="attention"> (上限<!--{$smarty.const.URL_LEN}-->文字)</span>
150            </td>
151        </tr>
152        <tr>
153            <th>リンク</th>
154            <td><label><input type="checkbox" name="link_method" value="2" <!--{if $arrForm.link_method eq 2}--> checked <!--{/if}--> /> 別ウィンドウで開く</label></td>
155        </tr>
156        <tr>
157            <th>本文作成</th>
158            <td>
159                <!--{if $arrErr.news_comment}--><span class="attention"><!--{$arrErr.news_comment}--></span><!--{/if}-->
160                <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 />
161                <span class="attention"> (上限3000文字)</span>
162            </td>
163        </tr>
164    </table>
165    <!--{* ▲登録テーブルここまで *}-->
166
167    <div class="btn-area">
168        <ul>
169            <li><a class="btn-action" href="javascript:;" onclick="return func_regist();"><span class="btn-next">この内容で登録する</span></a></li>
170        </ul>
171    </div>
172</form>
173
174    <h2>新着情報一覧</h2>
175    <!--{if $arrErr.moveposition}-->
176    <p><span class="attention"><!--{$arrErr.moveposition}--></span></p>
177    <!--{/if}-->
178    <!--{* ▼一覧表示エリアここから *}-->
179    <form name="move" id="move" method="post" action="?">
180    <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
181    <input type="hidden" name="mode" value="moveRankSet" />
182    <input type="hidden" name="term" value="setposition" />
183    <input type="hidden" name="news_id" value="" />
184    <input type="hidden" name="moveposition" value="" />
185    <input type="hidden" name="rank" value="" />
186    <table class="list">
187        <colgroup width="5%">
188        <colgroup width="15%">
189        <colgroup width="45%">
190        <colgroup width="5%">
191        <colgroup width="5%">
192        <colgroup width="25%">
193        <tr>
194            <th>順位</th>
195            <th>日付</th>
196            <th>タイトル</th>
197            <th class="edit">編集</th>
198            <th class="delete">削除</th>
199            <th>移動</th>
200        </tr>
201        <!--{section name=data loop=$arrNews}-->
202        <tr style="background:<!--{if $arrNews[data].news_id != $tpl_news_id}-->#ffffff<!--{else}--><!--{$smarty.const.SELECT_RGB}--><!--{/if}-->;" class="center">
203            <!--{assign var=db_rank value="`$arrNews[data].rank`"}-->
204            <td><!--{math equation="$line_max - $db_rank + 1"}--></td>
205            <td><!--{$arrNews[data].cast_news_date|date_format:"%Y/%m/%d"}--></td>
206            <td class="left">
207                <!--{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>
208                <!--{elseif $arrNews[data].link_method eq 1 && $arrNews[data].news_url == ""}--><!--{$arrNews[data].news_title|h|nl2br}-->
209                <!--{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>
210                <!--{else}--><!--{$arrNews[data].news_title|h|nl2br}-->
211                <!--{/if}-->
212            </td>
213            <td>
214                <!--{if $arrNews[data].news_id != $tpl_news_id}-->
215                <a href="#" onclick="return func_edit('<!--{$arrNews[data].news_id|h}-->');">編集</a>
216                <!--{else}-->
217                編集中
218                <!--{/if}-->
219            </td>
220            <td><a href="#" onclick="return func_del('<!--{$arrNews[data].news_id|h}-->');">削除</a></td>
221            <td>
222            <!--{if count($arrNews) != 1}-->
223            <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;">移動</a><br />
224            <!--{/if}-->
225            <!--{if $arrNews[data].rank ne $max_rank}--><a href="#" onclick="return func_rankMove('up', '<!--{$arrNews[data].news_id|h}-->', '<!--{$max_rank|h}-->');">上へ</a><!--{/if}--> <!--{if $arrNews[data].rank ne 1}--><a href="#" onclick="return func_rankMove('down', '<!--{$arrNews[data].news_id|h}-->', '<!--{$max_rank|h}-->');">下へ</a><!--{/if}-->
226            </td>
227        </tr>
228        <!--{sectionelse}-->
229        <tr class="center">
230            <td colspan="6">現在データはありません。</td>
231        </tr>
232        <!--{/section}-->
233    </table>
234    </form>
235    <!--{* ▲一覧表示エリアここまで *}-->
236
237</div>
Note: See TracBrowser for help on using the repository browser.