source: branches/version-2_12-dev/data/Smarty/templates/admin/system/plugin.tpl @ 21467

Revision 21467, 10.4 KB checked in by h_yoshimoto, 12 years ago (diff)

#1632 プラグインインストール時、アップデート時のバリデーションを実装しました。

  • 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">//<![CDATA[
25    $(function() {
26
27        $('input[id^=plugin_enable]').change(function(event) {
28            var data = {};
29           
30            // モード(有効 or 無効)
31            data.mode = event.target.name;
32            // プラグインID
33            data.plugin_id = event.target.value;
34            data['<!--{$smarty.const.TRANSACTION_ID_NAME}-->'] = '<!--{$transactionid}-->';
35            $.ajax({
36                type : 'POST',
37                url : location.pathname,
38                dataType : "json",
39                data: data,
40                cache : false,
41                error : remoteException,
42                success : function(data, dataType) {
43                        alert(data.message);
44                        location.href = location.pathname;
45                }
46            });
47        });
48
49        /**
50         * 通信エラー表示.
51         */
52        function remoteException(XMLHttpRequest, textStatus, errorThrown) {
53            alert('通信中にエラーが発生しました。');
54        }
55
56    $('.update_link').click(function(event) {
57        var plugin_id = event.target.name;
58        $('div[id="plugin_update_' + plugin_id + '"]').toggle("slow");
59        });
60    });
61
62
63    function removeUpdateFile(select_id) {
64        $('input[name="update_plugin_file"]').attr("disabled", "disabled");
65        $('input[id="' + select_id + '"]').removeAttr("disabled");
66    }
67//]]>
68</script>
69
70<!--<form name="form1" id="form1" method="post" action="?">-->
71<form name="form1" method="post" action="?" enctype="multipart/form-data">
72<input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
73<input type="hidden" name="mode" value="" />
74<input type="hidden" name="plugin_id" value="" />
75<input type="hidden" name="plugin_code" value="" />
76
77<div id="system" class="contents-main">
78    <h2>プラグイン登録</h2>
79    <table class="form">
80        <tr>
81            <th>プラグイン<span class="attention"> *</span></th>
82            <td>
83                <!--{assign var=key value="plugin_file"}-->
84                <span class="attention"><!--{$arrErr[$key]}--></span>
85                <input type="file" name="<!--{ $key }-->" class="box45" size="43"  style="<!--{$arrErr[$key]|sfGetErrorColor}--> <!--{if $arrErr[$key]}--> background-color:<!--{$smarty.const.ERR_COLOR|h}--><!--{/if}-->">
86                <a class="btn-action" href="javascript:;" onclick="fnModeSubmit('install', '', '');return false;"><span class="btn-next">インストール</span></a>
87            </td>
88        </tr>
89    </table>
90
91    <!--▼プラグイン一覧ここから-->
92    <h2>プラグイン一覧</h2>
93    <!--{if count($plugins) > 0}-->
94        <span class="attention"><!--{$arrErr.plugin_error}--></span>
95        <table class="system-plugin" width="900">
96            <col width="10%" />
97            <col width="80%" />
98            <col width="10%" />
99            <tr>
100                <th colspan="2">機能説明</th>
101                <th>優先度<a class="btn-action" href="javascript:;" onclick="fnModeSubmit('priority','','');return false;"><span class="btn-next">反映</span></a></th>
102            </tr>
103            <!--{section name=data loop=$plugins}-->
104            <!--{assign var=plugin value=$plugins[data]}-->
105            <tr <!--{if $plugin.enable == $smarty.const.PLUGIN_ENABLE_FALSE}--> style="background:#C9C9C9;" <!--{/if}-->>
106                <!--ロゴ-->
107                <td class="center plugin_img">
108                    <!--{if $plugin.plugin_site_url != '' }-->
109                        <a href="?" onclick="win03('<!--{$plugin.plugin_site_url|h}-->','plugin_site_url','620','760'); return false;"><img src="<!--{$smarty.const.ROOT_URLPATH}-->plugin/<!--{$plugin.plugin_code}-->/logo.png"width="65" height="65"/></a>&nbsp;
110                    <!--{else}-->
111                        <img src="<!--{$smarty.const.ROOT_URLPATH}-->plugin/<!--{$plugin.plugin_code}-->/logo.png"/>
112                    <!--{/if}-->
113
114                </td>
115                <!--機能説明-->
116                <td class="plugin_info">
117                        <!-- プラグイン名 -->
118                            <!-- ▼plugin_site_urlが設定されている場合はリンクとして表示 -->
119                            <span class="plugin_name">
120                            <!--{if $plugin.plugin_site_url != '' }-->
121                                <a href="?" onclick="win03('<!--{$plugin.plugin_site_url|h}-->','plugin_site_url','620','760'); return false;"><!--{$plugin.plugin_name|default:$plugin.plugin_code|h}--></a>&nbsp;
122                            <!--{else}-->
123                                <sapn><!--{$plugin.plugin_name|default:$plugin.plugin_code|h}-->&nbsp;</sapn>
124                            <!--{/if}-->
125                            </span>
126                        <!-- プラグインバージョン -->
127                            <!--{if $plugin.plugin_version != ''}--><!--{$plugin.plugin_version|h}--><!--{/if}-->&nbsp;
128                        <!-- 作者 -->
129                            <!--{if $plugin.author != ''}-->
130                                <!-- ▼author_site_urlが設定されている場合はリンクとして表示 -->
131                                <!--{if $plugin.author_site_url != '' }-->
132                                    <span>(by <a href="?" onclick="win03('<!--{$plugin.author_site_url|h}-->','author_site_url','620','760'); return false;"><!--{$plugin.author|default:'-'|h}--></a>)</span>
133                                <!--{else}-->
134                                    <span>(by <!--{$plugin.author|default:'-'|h}-->)</span>
135                                <!--{/if}-->
136                            <!--{/if}-->
137                        <br />
138                        <!-- 説明 -->
139                            <p class="description"><!--{$plugin.plugin_description|default:'-'|h}--></p>
140                        <div>
141                            <span class="ec_cube_version">対応EC-CUBEバージョン :<!--{$plugin.compliant_version|default:'-'|h}--></span><br/>
142                            <span class="attention"><!--{$arrErr[$plugin.plugin_code]}--></span>
143                            <!-- 設定 -->
144                                <!--{if $plugin.config_flg == true && $plugin.status != $smarty.const.PLUGIN_STATUS_UPLOADED}-->
145                                    <a href="?" onclick="win03('<!--{$smarty.const.ROOT_URLPATH}-->plugin/<!--{$plugin.plugin_code}-->/config.php','plugin_setting','620','760'); return false;">プラグイン設定</a>&nbsp;|&nbsp;
146                                <!--{else}-->
147                                    <span>プラグイン設定&nbsp;|&nbsp;</span>
148                                <!--{/if}-->
149                            <!-- アップデート -->
150                                <a class="update_link" href="#" name="<!--{$plugin.plugin_id}-->">アップデート</a>&nbsp;|&nbsp;
151                            <!-- 削除 -->
152                                <a  href="javascript:;" name="uninstall" onclick="fnSetFormValue('plugin_id', '<!--{$plugin.plugin_id}-->'); fnModeSubmit('uninstall','plugin_code','<!--{$plugin.plugin_code}-->'); return false;">削除</a>&nbsp;|&nbsp;
153                            <!-- 有効/無効 -->
154                                <!--{if $plugin.enable == $smarty.const.PLUGIN_ENABLE_TRUE}-->
155                                    <input id="plugin_enable" type="checkbox" name="disable" value="<!--{$plugin.plugin_id}-->" id="login_memory" checked="checked">有効</input><br/>
156                                <!--{else}-->
157                                    <input id="plugin_enable" type="checkbox" name="enable" value="<!--{$plugin.plugin_id}-->" id="login_memory" onclick="fnSetFormValue('plugin_id', '<!--{$plugin.plugin_id}-->'); return false;">有効にする</input><br/>
158                                <!--{/if}-->
159
160                                <!-- アップデートリンク押下時に表示する. -->
161                                <div id="plugin_update_<!--{$plugin.plugin_id}-->" style="display: none">                               
162                                    <input id="update_file_<!--{$plugin.plugin_id}-->" name="<!--{$plugin.plugin_code}-->" type="file" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" class="box30" size="30" <!--{if $arrErr[$key]}-->style="background-color:<!--{$smarty.const.ERR_COLOR|h}-->"<!--{/if}--> />
163                                    <a class="btn-action" href="javascript:;" onclick="removeUpdateFile('update_file_<!--{$plugin.plugin_id}-->'); fnSetFormValue('plugin_id', '<!--{$plugin.plugin_id}-->'); fnModeSubmit('update','plugin_code','<!--{$plugin.plugin_code}-->');return false;"><span class="btn-next">アップデート</span></a>
164                                </div>
165                        </div>
166                </td>
167                <!--優先順位-->
168                <!--{assign var=key value="rank"}-->
169                <td class="center">
170                    <input type="text" name="priority[<!--{$plugin.plugin_id}-->]" value="<!--{$plugin.rank|h}-->" size="1" class="rank" /><br/>
171                </td>
172            </tr>
173            <!--競合アラート-->
174            <!--{if $plugin.conflict_message != ""}-->
175            <tr>
176                <td class="attention_fookpoint" colspan="3">
177                    <p class="attention"><!--{$plugin.conflict_message}--></p>
178                </td>
179            </tr>
180            <!--{/if}-->
181            <!--{/section}-->
182        </table>
183    <!--{else}-->
184        <span>登録されているプラグインはありません。</span>
185    <!--{/if}-->
186</div>
187</form>
Note: See TracBrowser for help on using the repository browser.