切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
Karson
8 years ago
提交
a5355f4d5db157882c00df105a32022529452510
1 个父辈
25c8177b
修复权限节点添加编辑的错误
修复权限节点语言包
隐藏空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
36 行增加
和
6 行删除
application/admin/controller/auth/Rule.php
application/admin/lang/zh-cn.php
application/admin/lang/zh-cn/auth/rule.php
application/admin/view/auth/rule/add.html
application/admin/view/auth/rule/edit.html
public/assets/js/backend/auth/rule.js
application/admin/controller/auth/Rule.php
查看文件 @
a5355f4
...
...
@@ -29,6 +29,8 @@ class Rule extends Backend
$ruledata
=
[
0
=>
__
(
'None'
)];
foreach
(
$this
->
rulelist
as
$k
=>
$v
)
{
if
(
!
$v
[
'ismenu'
])
continue
;
$ruledata
[
$v
[
'id'
]]
=
$v
[
'title'
];
}
$this
->
view
->
assign
(
'ruledata'
,
$ruledata
);
...
...
@@ -62,6 +64,11 @@ class Rule extends Backend
$params
=
$this
->
request
->
post
(
"row/a"
);
if
(
$params
)
{
if
(
!
$params
[
'ismenu'
]
&&
!
$params
[
'pid'
])
{
$this
->
msg
=
__
(
'The non-menu rule must have parent'
);
return
;
}
$this
->
model
->
create
(
$params
);
AdminLog
::
record
(
__
(
'Add'
),
$this
->
model
->
getLastInsID
());
Cache
::
rm
(
'__menu__'
);
...
...
@@ -87,6 +94,11 @@ class Rule extends Backend
$params
=
$this
->
request
->
post
(
"row/a"
);
if
(
$params
)
{
if
(
!
$params
[
'ismenu'
]
&&
!
$params
[
'pid'
])
{
$this
->
msg
=
__
(
'The non-menu rule must have parent'
);
return
;
}
$row
->
save
(
$params
);
AdminLog
::
record
(
__
(
'Edit'
),
$ids
);
Cache
::
rm
(
'__menu__'
);
...
...
application/admin/lang/zh-cn.php
查看文件 @
a5355f4
...
...
@@ -30,6 +30,8 @@ return [
'Cancel'
=>
'取消'
,
'Loading'
=>
'加载中'
,
'More'
=>
'更多'
,
'Yes'
=>
'是'
,
'No'
=>
'否'
,
'Normal'
=>
'正常'
,
'Hidden'
=>
'隐藏'
,
'Submit'
=>
'提交'
,
...
...
application/admin/lang/zh-cn/auth/rule.php
查看文件 @
a5355f4
...
...
@@ -2,9 +2,12 @@
return
[
'Toggle all'
=>
'显示全部'
,
'Condition'
=>
'条件'
,
'Condition'
=>
'
规则
条件'
,
'Remark'
=>
'备注'
,
'Icon'
=>
'图标'
,
'Alert'
=>
'警告'
,
'If not necessary, use the command line to build rule'
=>
'非必要情况下请使用命令行来生成'
,
'Name'
=>
'规则URL'
,
'Ismenu'
=>
'菜单'
,
'The non-menu rule must have parent'
=>
'非菜单规则节点必须有父级'
,
'If not necessary, use the command line to build rule'
=>
'非必要情况下请直接使用命令行php think menu来生成'
,
];
...
...
application/admin/view/auth/rule/add.html
查看文件 @
a5355f4
...
...
@@ -4,6 +4,12 @@
</div>
<form
id=
"add-form"
class=
"form-horizontal form-ajax"
role=
"form"
data-toggle=
"validator"
method=
"POST"
action=
""
>
<div
class=
"form-group"
>
<label
for=
"content"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Ismenu')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
{:build_radios('row[ismenu]', ['1'=>__('Yes'), '0'=>__('No')])}
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"pid"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Parent')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
{:build_select('row[pid]', $ruledata, null, ['class'=>'form-control selectpicker', 'required'=>''])}
...
...
application/admin/view/auth/rule/edit.html
查看文件 @
a5355f4
<form
id=
"edit-form"
class=
"form-horizontal form-ajax"
role=
"form"
method=
"POST"
action=
""
>
<div
class=
"form-group"
>
<label
for=
"
pid"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Parent
')}:
</label>
<label
for=
"
content"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Ismenu
')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
{:build_
select('row[pid]', $ruledata, $row['pid'], ['class'=>'form-control selectpicker', 'required'=>'
'])}
{:build_
radios('row[ismenu]', ['1'=>__('Yes'), '0'=>__('No')], $row['ismenu
'])}
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"
action"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Title
')}:
</label>
<label
for=
"
pid"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Parent
')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
type=
"text"
class=
"form-control"
id=
"title"
name=
"row[title]"
value=
"{$row.title}"
required=
"required"
/>
{:build_select('row[pid]', $ruledata, $row['pid'], ['class'=>'form-control selectpicker', 'required'=>''])}
</div>
</div>
<div
class=
"form-group"
>
...
...
@@ -18,6 +18,12 @@
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"action"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Title')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
type=
"text"
class=
"form-control"
id=
"title"
name=
"row[title]"
value=
"{$row.title}"
required=
"required"
/>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"icon"
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Icon')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"input-group input-groupp-md"
>
...
...
public/assets/js/backend/auth/rule.js
查看文件 @
a5355f4
...
...
@@ -30,6 +30,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
{
field
:
'title'
,
title
:
__
(
'Title'
),
align
:
'left'
},
{
field
:
'icon'
,
title
:
__
(
'Icon'
),
formatter
:
Controller
.
api
.
formatter
.
icon
},
{
field
:
'name'
,
title
:
__
(
'Name'
),
align
:
'left'
},
{
field
:
'ismenu'
,
title
:
__
(
'Ismenu'
),
align
:
'left'
},
{
field
:
'weigh'
,
title
:
__
(
'Weigh'
)},
{
field
:
'status'
,
title
:
__
(
'Status'
),
formatter
:
Table
.
api
.
formatter
.
status
},
{
field
:
'id'
,
title
:
'<a href="javascript:;" class="btn btn-primary btn-xs btn-toggle"><i class="fa fa-chevron-down"></i></a>'
,
formatter
:
Controller
.
api
.
formatter
.
subnode
},
...
...
请
注册
或
登录
后发表评论