source: branches/comu-ver2/data/Smarty/templates/default/admin/design/index.tpl @ 17605

Revision 17605, 9.7 KB checked in by Seasoft, 16 years ago (diff)

/index.php にリンクやリダイレクトしている箇所の「index.php」を定数化。

  • 定数「DIR_INDEX_FILE」… DirectoryIndex? の実ファイル名。現状の EC-CUBE は、「index.php」。/html/define.php で定義するが、定義が無い場合 SC_Initial::defineDirectoryIndex() で「index.php」と定義。本来は、プログラム中で実ファイルとしての index.php を指すときとは、この定数を使うのが良い気がするが、今回はそこまでは書き換えていない。
  • 定数「USE_FILENAME_DIR_INDEX」… DIR_INDEX_FILE にアクセスするときにファイル名を使用するか。/html/define.php で定義。
  • 定数「DIR_INDEX_URL」… /index.php にリンクやリダイレクトしている箇所の「index.php」部分を示す。この定数は SC_Initial::defineDirectoryIndex() で自動生成する。

・$_SERVERPHP_SELF? や自身をあらわすファイル名を利用している箇所を文字列「?」に書き換え。これにより、/ が自己URLにリンクするときに /index.php となることを防ぐ。RFC3986 を参考にする。モバイル端末がこのRFCに準拠しているのか確信が無いので、モバイルではこの変更は見送った。
・従来 / にリンクしていた箇所に、定数「DIR_INDEX_URL」を付加。漏れがあると予測される。

  • Property svn:eol-style set to LF
  • Property svn:mime-type set to text/html; charset=UTF-8
Line 
1<script type="text/javascript">
2
3function doPreview(){
4  document.form1.mode.value="preview"
5  document.form1.target = "_blank";
6  document.form1.submit();
7}
8function fnTargetSelf(){
9  document.form1.target = "_self";
10}
11
12</script>
13
14<script type="text/javascript" src="<!--{$TPL_DIR}-->js/ui.core.js"></script>
15<script type="text/javascript" src="<!--{$TPL_DIR}-->js/ui.sortable.js"></script>
16<script type="text/javascript" src="<!--{$TPL_DIR}-->js/layout_design.js"></script>
17
18
19<form name="form1" id="form1" method="post" action="?">
20<input type="hidden" name="mode" value="" />
21<input type="hidden" name="page_id" value="<!--{$page_id}-->" />
22<input type="hidden" name="bloc_cnt" value="<!--{$bloc_cnt}-->" />
23<div id="design" class="contents-main">
24  <!--{* ▼レイアウト編集ここから *}-->
25  <table id="design-layout-wrap">
26    <thead>
27      <tr>
28        <th id="design-layout-wrap-edit">レイアウト編集</th>
29        <th id="design-layout-wrap-unused">未使用ブロック</th>
30      </tr>
31    </thead>
32    <tbody>
33    <tr>
34      <!--{* ▼レイアウトここから *}-->
35      <td>
36        <table id="design-layout-body">
37          <tr>
38            <td colspan="3" id="layout-header">ヘッダー部</td>
39          </tr>
40          <tr>
41            <!--{* 左ナビテーブルここから *}-->
42            <td rowspan="3" id="layout-left">
43              <div id="LeftNavi" class="ui-sortable" style="position: relative; width: 145px; height: 100px;">
44                <!--{assign var="firstflg" value=false}-->
45                <!--{foreach key=key item=item from=$tpl_arrBloc name="bloc_loop"}-->
46                <!--{if $item.target_id == "LeftNavi"}-->
47                <div class="sort<!--{if !$firstflg}--> first<!--{/if}-->">
48                  <!--{$item.name}-->
49                  <input type="hidden" class="name" name="name_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.name}-->" />
50                  <input type="hidden" class="id" name="id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_id}-->" />
51                  <input type="hidden" class="target-id" name="target_id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.target_id}-->" />
52                  <input type="hidden" class="top" name="top_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_row}-->" />
53                </div>
54                <!--{assign var="firstflg" value=true}-->
55                <!--{/if}-->
56                <!--{/foreach}-->
57              </div>
58            </td>
59            <!--{* 左ナビテーブルここまで *}-->
60            <!--{* メイン上部テーブルここから *}-->
61            <td id="layout-main-head">
62              <div id="MainHead" class="ui-sortable" style="position: relative; width: 145px; height: 100px;">
63                <!--{assign var="firstflg" value=false}-->
64                <!--{foreach key=key item=item from=$tpl_arrBloc name="bloc_loop"}-->
65                <!--{if $item.target_id == "MainHead"}-->
66                <div class="sort<!--{if !$firstflg}--> first<!--{/if}-->">
67                  <!--{$item.name}-->
68                  <input type="hidden" class="name" name="name_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.name}-->" />
69                  <input type="hidden" class="id" name="id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_id}-->" />
70                  <input type="hidden" class="target-id" name="target_id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.target_id}-->" />
71                  <input type="hidden" class="top" name="top_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_row}-->" />
72                </div>
73                <!--{assign var="firstflg" value=true}-->
74                <!--{/if}-->
75                <!--{/foreach}-->
76              </div>
77            </td>
78            <!--{* メイン上部テーブルここまで *}-->
79            <!--{* 右ナビここから *}-->
80            <td rowspan="3" id="layout-right">
81              <div id="RightNavi" class="ui-sortable" style="position: relative; width: 145px; height: 100px;">
82                <!--{assign var="firstflg" value=false}-->
83                <!--{foreach key=key item=item from=$tpl_arrBloc name="bloc_loop"}-->
84                <!--{if $item.target_id == "RightNavi"}-->
85                <div class="sort<!--{if !$firstflg}--> first<!--{/if}-->">
86                  <!--{$item.name}-->
87                  <input type="hidden" class="name" name="name_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.name}-->" />
88                  <input type="hidden" class="id" name="id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_id}-->" />
89                  <input type="hidden" class="target-id" name="target_id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.target_id}-->" />
90                  <input type="hidden" class="top" name="top_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_row}-->" />
91                </div>
92                <!--{assign var="firstflg" value=true}-->
93                <!--{/if}-->
94                <!--{/foreach}-->
95              </div>
96            </td>
97            <!--{* 右ナビここまで *}-->
98          </tr>
99          <!--{* メインここから *}-->
100          <tr>
101            <td id="layout-main">メイン</td>
102          </tr>
103          <!--{* メインここまで *}-->
104          <!--{* メイン下部ここから *}-->
105          <tr>
106            <td id="layout-main-foot">
107              <div id="MainFoot" class="ui-sortable" style="position: relative; width: 145px; height: 100px;">
108                <!--{assign var="firstflg" value=false}-->
109                <!--{foreach key=key item=item from=$tpl_arrBloc name="bloc_loop"}-->
110                <!--{if $item.target_id == "MainFoot"}-->
111                <div class="sort<!--{if !$firstflg}--> first<!--{/if}-->">
112                  <!--{$item.name}-->
113                  <input type="hidden" class="name" name="name_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.name}-->" />
114                  <input type="hidden" class="id" name="id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_id}-->" />
115                  <input type="hidden" class="target-id" name="target_id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.target_id}-->" />
116                  <input type="hidden" class="top" name="top_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_row}-->" />
117                </div>
118                <!--{assign var="firstflg" value=true}-->
119                <!--{/if}-->
120                <!--{/foreach}-->
121              </div>
122            </td>
123          </tr>
124          <!--{* メイン下部ここまで *}-->
125          <tr>
126            <td colspan="3" id="layout-footer">フッター部</td>
127          </tr>
128        </table>
129      </td>
130      <!--{* ▲レイアウトここまで *}-->
131
132      <!--{* ▼未使用ブロックここから *}-->
133      <td>
134        <div id="Unused" class="ui-sortable" style="position: relative; width: 145px; height: 500px;">
135          <!--{assign var="firstflg" value=false}-->
136          <!--{foreach key=key item=item from=$tpl_arrBloc name="bloc_loop"}-->
137          <!--{if $item.target_id == "Unused"}-->
138          <div class="sort<!--{if !$firstflg}--> first<!--{/if}-->">
139            <!--{$item.name}-->
140            <input type="hidden" class="name" name="name_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.name}-->" />
141            <input type="hidden" class="id" name="id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_id}-->" />
142            <input type="hidden" class="target-id" name="target_id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.target_id}-->" />
143            <input type="hidden" class="top" name="top_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_row}-->" />
144          </div>
145          <!--{assign var="firstflg" value=true}-->
146          <!--{/if}-->
147          <!--{/foreach}-->
148        </div>
149        <div class="btn"><button type='button' onclick="fnTargetSelf(); fnFormModeSubmit('form1','new_bloc','','');"><span>新規ブロック作成</span></button></div>
150      </td>
151      <!--{* ▲未使用ブロックここまで *}-->
152    </tr>
153    </tbody>
154  </table>
155  <div class="btn">
156    <button type='button' name='subm' onclick="fnTargetSelf(); fnFormModeSubmit('form1','confirm','','');"><span>保存</span></button>
157    <button type='button' name='preview' onclick="doPreview();"<!--{if $page_id == "0" or $exists_page == "0" }--> DISABLED<!--{/if}-->><span>プレビュー</span></button>
158  </div>
159  <!--▲レイアウト編集 ここまで-->
160
161
162  <!--▼ページ一覧 ここから-->
163  <h2>編集可能ページ</h2>
164  <table class="list center">
165  <!--{foreach key=key item=item from=$arrEditPage}-->
166    <tr style="background-color:<!--{if $item.page_id == $page_id}--><!--{$smarty.const.SELECT_RGB}--><!--{else}-->#ffffff<!--{/if}-->;">
167      <td>
168        <a href="<!--{$smarty.server.PHP_SELF|escape}-->?page_id=<!--{$item.page_id}-->" ><!--{$item.page_name}--></a>
169      </td>
170      <td>
171        <button type='button' onclick="location.href='./main_edit.php?page_id=<!--{$item.page_id}-->'"><span>メイン編集</span></button>
172      </td>
173      <td>
174        <!--{if $item.edit_flg == 1}-->
175        <button type='button' onclick="fnTargetSelf(); fnFormModeSubmit('form1','delete','','');"><span>削除</span></button>
176        <!--{/if}-->
177      </td>
178    </tr>
179  <!--{/foreach}-->
180  </table>
181  <div class="btn">
182    <button type='button' onclick="fnTargetSelf(); fnFormModeSubmit('form1','new_page','','');"><span>新規ページ作成</span></button>
183  </div>
184  <!--▲ページ一覧 ここまで-->
185</div>
186</form>
Note: See TracBrowser for help on using the repository browser.