Skip to content

Commit

Permalink
Merge pull request #687 from chihiro-adachi/patch/2.17.2-p1
Browse files Browse the repository at this point in the history
Patch/2.17.2-p1
  • Loading branch information
dotani1111 authored Mar 30, 2023
2 parents eb43f49 + bfc4a5f commit 073dbc8
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 26 deletions.
61 changes: 54 additions & 7 deletions data/Smarty/templates/admin/contents/file_manager.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,58 @@
var total = bread_crumbs.length;
for (var i in bread_crumbs) {
file_path += bread_crumbs[i] + '/';
$('<a href="javascript:;" onclick="eccube.fileManager.openFolder(\'' + file_path + '\'); return false;" />')
$('<a href="javascript:;" />')
.attr('data-filepath', file_path)
.text(bread_crumbs[i])
.addClass('open')
.appendTo($node);
if (i < total - 1) $node.append($delimiter);
}
$('a.open[data-filepath]').on('click', function() {
var filepath = $(this).data('filepath');
eccube.fileManager.openFolder(filepath);
return false;
});
$('a.cd[data-filepath]').on('click', function() {
var filepath = $(this).data('filepath');
var id = $(this).data('id');
eccube.setValue('tree_select_file', filepath, 'form1');
eccube.fileManager.selectFile(id, '#808080');
eccube.setModeAndSubmit('move','','');
return false;
});
$('a.view[data-filepath]').on('click', function() {
var filepath = $(this).data('filepath');
var id = $(this).data('id');
eccube.setValue('select_file', filepath, 'form1');
eccube.fileManager.selectFile(id, '#808080');
filepath = filepath.replace(/<!--{$smarty.const.USER_DIR|preg_quote:"/"}-->/, '');
eccube.openWindow('./file_view.php?file='+ filepath, 'user_data', '600', '400');
return false;
});
$('a.download[data-filepath]').on('click', function () {
var filepath = $(this).data('filepath');
var id = $(this).data('id');
eccube.setValue('select_file', filepath, 'form1');
eccube.fileManager.selectFile(id, '#808080');
eccube.fileManager.setTreeStatus('tree_status');
eccube.setModeAndSubmit('download','','');
return false;
});
$('a.delete[data-filepath]').on('click', function () {
var filepath = $(this).data('filepath');
var id = $(this).data('id');
eccube.setValue('select_file', filepath, 'form1');
eccube.fileManager.selectFile(id, '#808080');
eccube.fileManager.setTreeStatus('tree_status');
eccube.setModeAndSubmit('delete','','');
return false;
});
});
eccube.fileManager.IMG_FOLDER_CLOSE = "<!--{$TPL_URLPATH}-->img/contents/folder_close.gif"; // フォルダクローズ時画像
Expand Down Expand Up @@ -84,7 +131,7 @@
<th class="delete">削除</th>
</tr>
<!--{if !$tpl_is_top_dir}-->
<tr id="parent_dir" onclick="eccube.setValue('select_file', '<!--{$tpl_parent_dir|h}-->', 'form1'); eccube.fileManager.selectFile('parent_dir', '#808080');" onDblClick="eccube.fileManager.setTreeStatus('tree_status');eccube.fileManager.toggleTreeMenu('tree'+cnt, 'rank_img'+cnt, arrTree[cnt][2]);eccube.fileManager.doubleClick(arrTree, '<!--{$tpl_parent_dir|h}-->', true, '<!--{$tpl_now_dir|h}-->', true)" style="">
<tr id="parent_dir">
<td>
<img src="<!--{$TPL_URLPATH}-->img/contents/folder_parent.gif" alt="フォルダ">&nbsp;..
</td>
Expand All @@ -98,7 +145,7 @@
<!--{section name=cnt loop=$arrFileList}-->
<!--{assign var="id" value="select_file`$smarty.section.cnt.index`"}-->
<tr id="<!--{$id}-->" style="">
<td class="file-name" onDblClick="eccube.fileManager.setTreeStatus('tree_status');eccube.fileManager.doubleClick(arrTree, '<!--{$arrFileList[cnt].file_path|h}-->', <!--{if $arrFileList[cnt].is_dir|h}-->true<!--{else}-->false<!--{/if}-->, '<!--{$tpl_now_dir|h}-->', false)">
<td class="file-name">
<!--{if $arrFileList[cnt].is_dir}-->
<img src="<!--{$TPL_URLPATH}-->img/contents/folder_close.gif" alt="フォルダ" />
<!--{else}-->
Expand All @@ -114,23 +161,23 @@
</td>
<!--{if $arrFileList[cnt].is_dir}-->
<td class="center">
<a href="javascript:;" onclick="eccube.setValue('tree_select_file', '<!--{$arrFileList[cnt].file_path}-->', 'form1'); eccube.fileManager.selectFile('<!--{$id}-->', '#808080');eccube.setModeAndSubmit('move','',''); return false;">表示</a>
<a href="javascript:;" class="cd" data-filepath="<!--{$arrFileList[cnt].file_path|h}-->" data-id="<!--{$id|h}-->">表示</a>
</td>
<!--{else}-->
<td class="center">
<a href="javascript:;" onclick="eccube.setValue('select_file', '<!--{$arrFileList[cnt].file_path|h}-->', 'form1');eccube.fileManager.selectFile('<!--{$id}-->', '#808080');eccube.setModeAndSubmit('view','',''); return false;">表示</a>
<a href="javascript:;" class="view" data-filepath="<!--{$arrFileList[cnt].file_path|h}-->" data-id="<!--{$id|h}-->">表示</a>
</td>
<!--{/if}-->
<!--{if $arrFileList[cnt].is_dir}-->
<!--{* ディレクトリはダウンロード不可 *}-->
<td class="center">-</td>
<!--{else}-->
<td class="center">
<a href="javascript:;" onclick="eccube.setValue('select_file', '<!--{$arrFileList[cnt].file_path|h}-->', 'form1');eccube.fileManager.selectFile('<!--{$id}-->', '#808080');eccube.fileManager.setTreeStatus('tree_status');eccube.setModeAndSubmit('download','',''); return false;">ダウンロード</a>
<a href="javascript:;" class="download" data-filepath="<!--{$arrFileList[cnt].file_path|h}-->" data-id="<!--{$id|h}-->">ダウンロード</a>
</td>
<!--{/if}-->
<td class="center">
<a href="javascript:;" onclick="eccube.setValue('select_file', '<!--{$arrFileList[cnt].file_path|h}-->', 'form1');eccube.fileManager.selectFile('<!--{$id}-->', '#808080');eccube.fileManager.setTreeStatus('tree_status');eccube.setModeAndSubmit('delete','',''); return false;">削除</a>
<a href="javascript:;" class="delete" data-filepath="<!--{$arrFileList[cnt].file_path|h}-->" data-id="<!--{$id|h}-->">削除</a>
</td>
</tr>
<!--{/section}-->
Expand Down
2 changes: 1 addition & 1 deletion data/class/SC_Initial.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SC_Initial
public function __construct()
{
/** EC-CUBEのバージョン */
define('ECCUBE_VERSION', '2.17.2');
define('ECCUBE_VERSION', '2.17.2-p1');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,6 @@ public function action()
}
break;

// ファイル表示
case 'view':
$objFormParam = new SC_FormParam_Ex();
$this->lfInitParamModeView($objFormParam);
$objFormParam->setParam($this->createSetParam($_POST));
$objFormParam->convParam();

$this->arrErr = $objFormParam->checkError();
if (SC_Utils_Ex::isBlank($this->arrErr)) {
if ($this->tryView($objFormParam)) {
$pattern = '/' . preg_quote($objFormParam->getValue('top_dir'), '/') . '/';
$file_url = htmlspecialchars(preg_replace($pattern, '', $objFormParam->getValue('select_file')));
$tpl_onload = "eccube.openWindow('./file_view.php?file=". $file_url ."', 'user_data', '600', '400');";
$this->setTplOnLoad($tpl_onload);
}
}
break;

// ファイルダウンロード
case 'download':
$objFormParam = new SC_FormParam_Ex();
Expand Down

0 comments on commit 073dbc8

Please sign in to comment.