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

Revision 19965, 9.4 KB checked in by uemoto, 13 years ago (diff)

#382(管理画面XHTMLに変更)

  • 細部調整
  • Property svn:eol-style set to LF
  • 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-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
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="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-area">
167    <ul>
168      <li><a class="btn-action" href="javascript:;" onclick="return func_regist();"><span class="btn-next">この内容で登録する</span></a></li>
169    </ul>
170  </div>
171</form>
172
173  <h2>新着情報一覧</h2>
174  <!--{if $arrErr.moveposition}-->
175  <p><span class="attention"><!--{$arrErr.moveposition}--></span></p>
176  <!--{/if}-->
177  <!--{* ▼一覧表示エリアここから *}-->
178  <form name="move" id="move" method="post" action="?">
179  <input type="hidden" name="mode" value="moveRankSet" />
180  <input type="hidden" name="term" value="setposition" />
181  <input type="hidden" name="news_id" value="" />
182  <input type="hidden" name="moveposition" value="" />
183  <input type="hidden" name="rank" value="" />
184  <table class="list">
185    <colgroup width="5%">
186    <colgroup width="15%">
187    <colgroup width="45%">
188    <colgroup width="5%">
189    <colgroup width="5%">
190    <colgroup width="25%">
191    <tr>
192      <th>順位</th>
193      <th>日付</th>
194      <th>タイトル</th>
195      <th class="edit">編集</th>
196      <th class="delete">削除</th>
197      <th>移動</th>
198    </tr>
199    <!--{section name=data loop=$list_data}-->
200    <tr style="background:<!--{if $list_data[data].news_id eq $news_id}--><!--{$smarty.const.SELECT_RGB}--><!--{else}-->#ffffff<!--{/if}-->;" class="center">
201      <!--{assign var=db_rank value="`$list_data[data].rank`"}-->
202      <!--{assign var=rank value="`$line_max-$db_rank+1`"}-->
203      <td><!--{$rank|h}--></td>
204      <td><!--{$list_data[data].cast_news_date|date_format:"%Y/%m/%d"}--></td>
205      <td class="left">
206        <!--{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>
207        <!--{elseif $list_data[data].link_method eq 1 && $list_data[data].news_url == ""}--><!--{$list_data[data].news_title|h|nl2br}-->
208        <!--{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>
209        <!--{else}--><!--{$list_data[data].news_title|h|nl2br}-->
210        <!--{/if}-->
211      </td>
212      <td><a href="#" onclick="return func_edit('<!--{$list_data[data].news_id|h}-->');">編集</a></td>
213      <td><a href="#" onclick="return func_del('<!--{$list_data[data].news_id|h}-->');">削除</a></td>
214      <td>
215      <!--{if count($list_data) != 1}-->
216      <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 />
217      <!--{/if}-->
218      <!--{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}-->
219      </td>
220    </tr>
221    <!--{sectionelse}-->
222    <tr class="center">
223      <td colspan="6">現在データはありません。</td>
224    </tr>
225    <!--{/section}-->
226  </table>
227  </form>
228  <!--{* ▲一覧表示エリアここまで *}-->
229
230</div>
Note: See TracBrowser for help on using the repository browser.