如何使用 Opencart 打开特定文件夹中的文件管理器?
How to open the filemanager in a specific folder using Opencart?
我正在我的电子商务中创建一个多卖家,我想在每个卖家中都有一个文件夹。
所以我需要一个这样的目录。
catalog/
image/
seller/
1/
/profile
/banner
/products
2/
/profile
/banner
/products
其中 1 和 2 表示为卖家 ID。在 Opencart 默认设置中,它总是位于图像的根文件夹中。
如何控制目录?还有如何防止文件管理器返回到根目录?
我应该在哪里编辑这些部分?
通常文件管理器在此代码中。
<a href="" id="thumb-image<?php echo $image_row; ?>" data-toggle="image" class="img-thumbnail">
<img src="<?php echo $product_image['thumb']; ?>" alt="" title="" data-placeholder="<?php echo $placeholder; ?>" />
</a>
我正在使用 Opencart 版本 2.0.1.1
您可以在 ajax 调用中将查询字符串中的目录作为 directory=example
传递。 url 本身在 admin/view/javascript/common.js
中指定。您将需要修改此处的代码以捕获登录用户的 ID 并使用它来指定路径。像这样:
url: 'index.php?route=common/filemanager&token=' + getURLVar('token') + '&target=' + $(element).parent().find('input').attr('id') + '&thumb=' + $(element).attr('id') + '&directory=<?php $this->user->getId(); ?>',
我正在我的电子商务中创建一个多卖家,我想在每个卖家中都有一个文件夹。
所以我需要一个这样的目录。
catalog/
image/
seller/
1/
/profile
/banner
/products
2/
/profile
/banner
/products
其中 1 和 2 表示为卖家 ID。在 Opencart 默认设置中,它总是位于图像的根文件夹中。
如何控制目录?还有如何防止文件管理器返回到根目录?
我应该在哪里编辑这些部分?
通常文件管理器在此代码中。
<a href="" id="thumb-image<?php echo $image_row; ?>" data-toggle="image" class="img-thumbnail">
<img src="<?php echo $product_image['thumb']; ?>" alt="" title="" data-placeholder="<?php echo $placeholder; ?>" />
</a>
我正在使用 Opencart 版本 2.0.1.1
您可以在 ajax 调用中将查询字符串中的目录作为 directory=example
传递。 url 本身在 admin/view/javascript/common.js
中指定。您将需要修改此处的代码以捕获登录用户的 ID 并使用它来指定路径。像这样:
url: 'index.php?route=common/filemanager&token=' + getURLVar('token') + '&target=' + $(element).parent().find('input').attr('id') + '&thumb=' + $(element).attr('id') + '&directory=<?php $this->user->getId(); ?>',