Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
alading2018
ShopXO
提交
f4f59e4b
ShopXO
项目概览
alading2018
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f4f59e4b
编写于
8月 15, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
上传主题、插件+细节优化
上级
b1c8c916
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
44 addition
and
11 deletion
+44
-11
application/admin/view/default/pluginsadmin/upload.html
application/admin/view/default/pluginsadmin/upload.html
+2
-2
application/admin/view/default/theme/index.html
application/admin/view/default/theme/index.html
+3
-3
application/admin/view/default/theme/upload.html
application/admin/view/default/theme/upload.html
+3
-3
application/service/PluginsAdminService.php
application/service/PluginsAdminService.php
+18
-0
application/service/ThemeService.php
application/service/ThemeService.php
+16
-2
public/static/admin/default/css/theme.css
public/static/admin/default/css/theme.css
+1
-1
public/static/common/css/common.css
public/static/common/css/common.css
+1
-0
未找到文件。
application/admin/view/default/pluginsadmin/upload.html
浏览文件 @
f4f59e4b
...
...
@@ -9,7 +9,7 @@
<!-- form start -->
<form
class=
"am-form form-validation view-save am-margin-top-sm"
action=
"{{:MyUrl('admin/pluginsadmin/upload')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/pluginsadmin/index')}}"
enctype=
"multipart/form-data"
>
<div
class=
"am-
padding-xs
am-form-file"
>
<div
class=
"am-
form-group am-form-group-refreshing am-margin-bottom-0
am-form-file"
>
<button
type=
"button"
class=
"am-btn am-btn-default am-btn-sm am-radius"
>
<i
class=
"am-icon-cloud-upload"
></i>
选择文件
</button>
<input
type=
"file"
name=
"file"
class=
"file-event"
data-tips-tag=
"#form-file-tips"
data-validation-message=
"请选择需要上传的文件"
accept=
".zip"
multiple
required
/>
...
...
@@ -17,7 +17,7 @@
<div
id=
"form-file-tips"
class=
"am-margin-top-xs"
></div>
</div>
<div
class=
"am-form-group am-form-group-refreshing"
>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm"
data-am-loading=
"{loadingText:'上传中...'}"
>
上传
</button>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm"
data-am-loading=
"{loadingText:'上传中...'}"
>
确认
上传
</button>
</div>
</form>
<!-- form end -->
...
...
application/admin/view/default/theme/index.html
浏览文件 @
f4f59e4b
...
...
@@ -12,12 +12,12 @@
<ul
data-am-widget=
"gallery"
class=
"am-gallery am-avg-sm-2 am-avg-md-3 am-avg-lg-4 am-gallery-bordered data-list"
data-am-gallery=
"{}"
data-select-url=
"{{:MyUrl('admin/theme/save')}}"
>
{{foreach $data_list as $v}}
<li
id=
"data-list-{{$v.theme}}"
>
<div
class=
"am-gallery-item am-radius {{if $v['theme'] eq $theme}}theme-active{{/if}}"
>
<a
href=
"javascript:;"
class=
"select-theme"
data-theme=
"{{$v.theme}}"
>
<div
class=
"am-gallery-item am-radius
am-padding-0
{{if $v['theme'] eq $theme}}theme-active{{/if}}"
>
<a
href=
"javascript:;"
class=
"select-theme
am-block
"
data-theme=
"{{$v.theme}}"
>
<img
src=
"{{$v.preview}}"
alt=
"{{$v.name}}"
/>
</a>
<div
class=
"am-gallery-item-bottom"
>
<h3
class=
"am-gallery-title"
>
<h3
class=
"am-gallery-title
am-margin-top-0
"
>
{{$v.name}}
<div
class=
"am-fr am-text-right"
>
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
...
...
application/admin/view/default/theme/upload.html
浏览文件 @
f4f59e4b
...
...
@@ -9,15 +9,15 @@
<!-- form start -->
<form
class=
"am-form form-validation view-save am-margin-top-sm"
action=
"{{:MyUrl('admin/theme/upload')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/theme/index')}}"
enctype=
"multipart/form-data"
>
<div
class=
"am-form-group am-form-file"
>
<div
class=
"am-form-group am-form-
group-refreshing am-margin-bottom-0 am-form-
file"
>
<button
type=
"button"
class=
"am-btn am-btn-default am-btn-sm am-radius"
>
<i
class=
"am-icon-cloud-upload"
></i>
选择文件
</button>
<input
type=
"file"
name=
"theme"
class=
"file-event"
data-tips-tag=
"#form-theme-tips"
data-validation-message=
"请选择需要上传的文件"
accept=
".zip"
multiple
required
/>
<span
class=
"tips am-text-xs"
>
上传一个zip压缩格式的主题安装包
</span>
<div
id=
"form-theme-tips"
class=
"am-margin-top-xs"
></div>
</div>
<div
class=
"am-form-group"
>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm"
data-am-loading=
"{loadingText:'上传中...'}"
>
上传
</button>
<div
class=
"am-form-group
am-form-group-refreshing
"
>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm"
data-am-loading=
"{loadingText:'上传中...'}"
>
确认
上传
</button>
</div>
</form>
<!-- form end -->
...
...
application/service/PluginsAdminService.php
浏览文件 @
f4f59e4b
...
...
@@ -26,6 +26,9 @@ class PluginsAdminService
// 排除不能使用的名称
public
static
$plugins_exclude_verification
=
[
'view'
,
'shopxo'
,
'www'
];
// 排除的文件后缀
private
static
$exclude_ext
=
[
'.php'
];
/**
* 列表
* @author Devil
...
...
@@ -1059,6 +1062,21 @@ php;
{
if
(
strpos
(
$file
,
$dir_key
)
!==
false
)
{
// 仅控制器模块支持php文件
if
(
$dir_key
!=
'_controller_'
)
{
// 排除后缀文件
$pos
=
strripos
(
$file
,
'.'
);
if
(
$pos
!==
false
)
{
if
(
in_array
(
substr
(
$file
,
$pos
),
self
::
$exclude_ext
))
{
continue
;
}
}
}
// 匹配成功文件路径处理、跳出循环
$file
=
str_replace
(
$plugins_name
.
'/'
.
$dir_key
.
'/'
,
''
,
$dir_value
.
$file
);
$is_has_find
=
true
;
break
;
...
...
application/service/ThemeService.php
浏览文件 @
f4f59e4b
...
...
@@ -25,6 +25,9 @@ class ThemeService
private
static
$html_path
=
'application'
.
DS
.
'index'
.
DS
.
'view'
.
DS
;
private
static
$static_path
=
'public'
.
DS
.
'static'
.
DS
.
'index'
.
DS
;
// 排除的文件后缀
private
static
$exclude_ext
=
[
'.php'
];
/**
* 获取模板列表
* @author Devil
...
...
@@ -109,11 +112,11 @@ class ThemeService
// 目录是否有权限
if
(
!
is_writable
(
ROOT
.
self
::
$html_path
))
{
return
DataReturn
(
'视图目录没权限'
,
-
10
);
return
DataReturn
(
'视图目录没权限
['
.
ROOT
.
self
::
$html_path
.
']
'
,
-
10
);
}
if
(
!
is_writable
(
ROOT
.
self
::
$static_path
))
{
return
DataReturn
(
'资源目录没权限'
,
-
10
);
return
DataReturn
(
'资源目录没权限
['
.
self
::
$static_path
.
']
'
,
-
10
);
}
// 资源目录
...
...
@@ -140,6 +143,7 @@ class ThemeService
{
if
(
strpos
(
$file
,
$dir_key
)
!==
false
)
{
// 匹配成功文件路径处理、跳出循环
$file
=
str_replace
(
$dir_key
.
'/'
,
''
,
$dir_value
.
$file
);
$is_has_find
=
true
;
break
;
...
...
@@ -152,6 +156,16 @@ class ThemeService
continue
;
}
// 排除后缀文件
$pos
=
strripos
(
$file
,
'.'
);
if
(
$pos
!==
false
)
{
if
(
in_array
(
substr
(
$file
,
$pos
),
self
::
$exclude_ext
))
{
continue
;
}
}
// 截取文件路径
$file_path
=
substr
(
$file
,
0
,
strrpos
(
$file
,
'/'
));
...
...
public/static/admin/default/css/theme.css
浏览文件 @
f4f59e4b
.am-gallery-item-bottom
{
background
:
#
f7f7f7
;
padding
:
0px
8px
5px
8px
;
}
.am-gallery-item-bottom
{
background
:
#
e6e6e6
;
padding
:
5px
8px
;
}
.am-gallery-desc
*
{
font-size
:
12px
;
}
.am-gallery-item
:hover
{
border
:
1px
solid
#f60
;
}
.theme-active
{
border
:
3px
solid
#5eb95e
!important
;
}
...
...
public/static/common/css/common.css
浏览文件 @
f4f59e4b
...
...
@@ -528,6 +528,7 @@ button.colorpicker-submit img {
line-height
:
20px
;
min-width
:
160px
;
max-width
:
160px
;
word-break
:
break-all
;
}
.am-table-scrollable-horizontal
.am-table
.am-nowrap-initial
{
white-space
:
initial
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录