| 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 | $(function(){ |
---|
| 108 | |
---|
| 109 | $( "#datepicker" ).datepicker({ |
---|
| 110 | beforeShowDay: function(date) { |
---|
| 111 | if(date.getDay() == 0) { |
---|
| 112 | return [true,"date-sunday"]; |
---|
| 113 | } else if(date.getDay() == 6){ |
---|
| 114 | return [true,"date-saturday"]; |
---|
| 115 | } else { |
---|
| 116 | return [true]; |
---|
| 117 | } |
---|
| 118 | },changeMonth: 'true' |
---|
| 119 | ,changeYear: 'true' |
---|
| 120 | ,onSelect: function(dateText, inst){ |
---|
| 121 | setDate(dateText); |
---|
| 122 | }, |
---|
| 123 | showButtonPanel: true, |
---|
| 124 | beforeShow: showAdditionalButton, |
---|
| 125 | onChangeMonthYear: showAdditionalButton |
---|
| 126 | }); |
---|
| 127 | |
---|
| 128 | $("#datepicker").blur( function() { |
---|
| 129 | var dateText = $(this).val(); |
---|
| 130 | setDate(dateText); |
---|
| 131 | }); |
---|
| 132 | |
---|
| 133 | }); |
---|
| 134 | |
---|
| 135 | var btn = $('<button class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" type="button">Clear</button>'); |
---|
| 136 | |
---|
| 137 | var showAdditionalButton = function (input) { |
---|
| 138 | setTimeout(function () { |
---|
| 139 | var buttonPane = $(input) |
---|
| 140 | .datepicker("widget") |
---|
| 141 | .find(".ui-datepicker-buttonpane"); |
---|
| 142 | btn |
---|
| 143 | .unbind("click") |
---|
| 144 | .bind("click", function () { |
---|
| 145 | $.datepicker._clearDate(input); |
---|
| 146 | $("*[name=year]").val(""); |
---|
| 147 | $("*[name=month]").val(""); |
---|
| 148 | $("*[name=day]").val(""); |
---|
| 149 | }); |
---|
| 150 | btn.appendTo(buttonPane); |
---|
| 151 | }, 1); |
---|
| 152 | }; |
---|
| 153 | |
---|
| 154 | function setDate(dateText){ |
---|
| 155 | var dates = dateText.split('/'); |
---|
| 156 | $("*[name=year]").val(dates[0]); |
---|
| 157 | $("*[name=month]").val(dates[1]); |
---|
| 158 | $("*[name=day]").val(dates[2]); |
---|
| 159 | } |
---|
| 160 | |
---|
| 161 | //--> |
---|
| 162 | </script> |
---|
| 163 | |
---|
| 164 | |
---|
| 165 | <div id="admin-contents" class="contents-main"> |
---|
| 166 | <form name="form1" id="form1" method="post" action="?"> |
---|
| 167 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
| 168 | <input type="hidden" name="mode" value="" /> |
---|
| 169 | <input type="hidden" name="news_id" value="<!--{$arrForm.news_id|h}-->" /> |
---|
| 170 | <input type="hidden" name="term" value="" /> |
---|
| 171 | <!--{* ▼登録テーブルここから *}--> |
---|
| 172 | <table> |
---|
| 173 | <tr> |
---|
| 174 | <th><!--{t string="tpl_024_1" escape="none"}--></th> |
---|
| 175 | <td> |
---|
| 176 | <!--{if $arrErr.year || $arrErr.month || $arrErr.day}--><span class="attention"><!--{$arrErr.year}--><!--{$arrErr.month}--><!--{$arrErr.day}--></span><!--{/if}--> |
---|
| 177 | <input id="datepicker" type="text" value="<!--{if $arrForm.year != "" && $arrForm.month != "" && $arrForm.day != ""}--><!--{$arrForm.year|h}-->/<!--{$arrForm.month|h|string_format:'%02d'}-->/<!--{$arrForm.day|h|string_format:'%02d'}--><!--{/if}-->" <!--{if $arrErr.year != ""}--><!--{sfSetErrorStyle}--><!--{/if}--> /> |
---|
| 178 | <input type="hidden" name="year" value="<!--{$arrForm.year}-->" /> |
---|
| 179 | <input type="hidden" name="month" value="<!--{$arrForm.month}-->" /> |
---|
| 180 | <input type="hidden" name="day" value="<!--{$arrForm.day}-->" /> |
---|
| 181 | </td> |
---|
| 182 | </tr> |
---|
| 183 | <tr> |
---|
| 184 | <th><!--{t string="tpl_022_1" escape="none"}--></th> |
---|
| 185 | <td> |
---|
| 186 | <!--{if $arrErr.news_title}--><span class="attention"><!--{$arrErr.news_title}--></span><!--{/if}--> |
---|
| 187 | <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}-->><!--{"\n"}--><!--{$arrForm.news_title|h}--></textarea><br /> |
---|
| 188 | <span class="attention"> <!--{t string="tpl_023" T_FIELD=$smarty.const.MTEXT_LEN}--></span> |
---|
| 189 | </td> |
---|
| 190 | </tr> |
---|
| 191 | <tr> |
---|
| 192 | <th><!--{t string="tpl_109"}--></th> |
---|
| 193 | <td> |
---|
| 194 | <span class="attention"><!--{$arrErr.news_url}--></span> |
---|
| 195 | <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}-->" /> |
---|
| 196 | <span class="attention"> <!--{t string="tpl_023" T_FIELD=$smarty.const.URL_LEN}--></span> |
---|
| 197 | </td> |
---|
| 198 | </tr> |
---|
| 199 | <tr> |
---|
| 200 | <th><!--{t string="tpl_110"}--></th> |
---|
| 201 | <td><label><input type="checkbox" name="link_method" value="2" <!--{if $arrForm.link_method eq 2}--> checked <!--{/if}--> /> <!--{t string="tpl_112"}--></label></td> |
---|
| 202 | </tr> |
---|
| 203 | <tr> |
---|
| 204 | <th><!--{t string="tpl_111"}--></th> |
---|
| 205 | <td> |
---|
| 206 | <!--{if $arrErr.news_comment}--><span class="attention"><!--{$arrErr.news_comment}--></span><!--{/if}--> |
---|
| 207 | <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}-->"><!--{"\n"}--><!--{$arrForm.news_comment|h}--></textarea><br /> |
---|
| 208 | <span class="attention"> <!--{t string="tpl_113"}--></span> |
---|
| 209 | </td> |
---|
| 210 | </tr> |
---|
| 211 | </table> |
---|
| 212 | <!--{* ▲登録テーブルここまで *}--> |
---|
| 213 | |
---|
| 214 | <div class="btn-area"> |
---|
| 215 | <ul> |
---|
| 216 | <li><a class="btn-action" href="javascript:;" onclick="return func_regist();"><span class="btn-next"><!--{t string="tpl_021"}--></span></a></li> |
---|
| 217 | </ul> |
---|
| 218 | </div> |
---|
| 219 | </form> |
---|
| 220 | |
---|
| 221 | <h2><!--{t string="tpl_114"}--></h2> |
---|
| 222 | <!--{if $arrErr.moveposition}--> |
---|
| 223 | <p><span class="attention"><!--{$arrErr.moveposition}--></span></p> |
---|
| 224 | <!--{/if}--> |
---|
| 225 | <!--{* ▼一覧表示エリアここから *}--> |
---|
| 226 | <form name="move" id="move" method="post" action="?"> |
---|
| 227 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
| 228 | <input type="hidden" name="mode" value="moveRankSet" /> |
---|
| 229 | <input type="hidden" name="term" value="setposition" /> |
---|
| 230 | <input type="hidden" name="news_id" value="" /> |
---|
| 231 | <input type="hidden" name="moveposition" value="" /> |
---|
| 232 | <input type="hidden" name="rank" value="" /> |
---|
| 233 | <table class="list"> |
---|
| 234 | <col width="5%" /> |
---|
| 235 | <col width="15%" /> |
---|
| 236 | <col width="45%" /> |
---|
| 237 | <col width="5%" /> |
---|
| 238 | <col width="5%" /> |
---|
| 239 | <col width="25%" /> |
---|
| 240 | <tr> |
---|
| 241 | <th><!--{t string="tpl_115"}--></th> |
---|
| 242 | <th><!--{t string="tpl_024"}--></th> |
---|
| 243 | <th><!--{t string="tpl_022"}--></th> |
---|
| 244 | <th class="edit"><!--{t string="tpl_003"}--></th> |
---|
| 245 | <th class="delete"><!--{t string="tpl_004"}--></th> |
---|
| 246 | <th><!--{t string="tpl_005"}--></th> |
---|
| 247 | </tr> |
---|
| 248 | <!--{section name=data loop=$arrNews}--> |
---|
| 249 | <tr style="background:<!--{if $arrNews[data].news_id != $tpl_news_id}-->#ffffff<!--{else}--><!--{$smarty.const.SELECT_RGB}--><!--{/if}-->;" class="center"> |
---|
| 250 | <!--{assign var=db_rank value="`$arrNews[data].rank`"}--> |
---|
| 251 | <td><!--{math equation="$line_max - $db_rank + 1"}--></td> |
---|
| 252 | <td><!--{$arrNews[data].cast_news_date|date_format:"%Y/%m/%d"}--></td> |
---|
| 253 | <td class="left"> |
---|
| 254 | <!--{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> |
---|
| 255 | <!--{elseif $arrNews[data].link_method eq 1 && $arrNews[data].news_url == ""}--><!--{$arrNews[data].news_title|h|nl2br}--> |
---|
| 256 | <!--{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> |
---|
| 257 | <!--{else}--><!--{$arrNews[data].news_title|h|nl2br}--> |
---|
| 258 | <!--{/if}--> |
---|
| 259 | </td> |
---|
| 260 | <td> |
---|
| 261 | <!--{if $arrNews[data].news_id != $tpl_news_id}--> |
---|
| 262 | <a href="#" onclick="return func_edit('<!--{$arrNews[data].news_id|h}-->');"><!--{t string="tpl_003"}--></a> |
---|
| 263 | <!--{else}--> |
---|
| 264 | <!--{t string="tpl_026"}--> |
---|
| 265 | <!--{/if}--> |
---|
| 266 | </td> |
---|
| 267 | <td><a href="#" onclick="return func_del('<!--{$arrNews[data].news_id|h}-->');"><!--{t string="tpl_004"}--></a></td> |
---|
| 268 | <td> |
---|
| 269 | <!--{if count($arrNews) != 1}--> |
---|
| 270 | <input type="text" name="pos-<!--{$arrNews[data].news_id|h}-->" size="3" class="box3" /><!--{t string="tpl_713"}--> <a href="?" onclick="fnFormModeSubmit('move', 'moveRankSet','news_id', '<!--{$arrNews[data].news_id|h}-->'); return false;"><!--{t string="tpl_005"}--></a><br /> |
---|
| 271 | <!--{/if}--> |
---|
| 272 | <!--{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}--> |
---|
| 273 | </td> |
---|
| 274 | </tr> |
---|
| 275 | <!--{sectionelse}--> |
---|
| 276 | <tr class="center"> |
---|
| 277 | <td colspan="6"><!--{t string="tpl_182"}--></td> |
---|
| 278 | </tr> |
---|
| 279 | <!--{/section}--> |
---|
| 280 | </table> |
---|
| 281 | </form> |
---|
| 282 | <!--{* ▲一覧表示エリアここまで *}--> |
---|
| 283 | |
---|
| 284 | </div> |
---|