mirror of https://gitee.com/karson/fastadmin.git
修复插件基类Controller被调用两次的BUG
添加插件初始化的行为 修复表格始终显示排序按钮的BUG 优化部分视图的权限判断 优化本地上传插件的提示pull/9/head
parent
3b295553a6
commit
6b4cb9c52a
|
|
@ -89,7 +89,7 @@ function build_category_select($name, $type, $selected = null, $attr = [], $head
|
||||||
function build_toolbar($btns = NULL, $attr = [])
|
function build_toolbar($btns = NULL, $attr = [])
|
||||||
{
|
{
|
||||||
$auth = \app\admin\library\Auth::instance();
|
$auth = \app\admin\library\Auth::instance();
|
||||||
$controller = strtolower(think\Request::instance()->controller());
|
$controller = str_replace('.','/',strtolower(think\Request::instance()->controller()));
|
||||||
$btns = $btns ? $btns : ['refresh', 'add', 'edit', 'del'];
|
$btns = $btns ? $btns : ['refresh', 'add', 'edit', 'del'];
|
||||||
$btns = is_array($btns) ? $btns : explode(',', $btns);
|
$btns = is_array($btns) ? $btns : explode(',', $btns);
|
||||||
$index = array_search('delete', $btns);
|
$index = array_search('delete', $btns);
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,8 @@ class Addon extends Backend
|
||||||
*/
|
*/
|
||||||
public function local()
|
public function local()
|
||||||
{
|
{
|
||||||
|
Config::set('default_return_type', 'json');
|
||||||
|
|
||||||
$file = $this->request->file('file');
|
$file = $this->request->file('file');
|
||||||
$addonTmpDir = RUNTIME_PATH . 'addons' . DS;
|
$addonTmpDir = RUNTIME_PATH . 'addons' . DS;
|
||||||
if (!is_dir($addonTmpDir))
|
if (!is_dir($addonTmpDir))
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,11 @@
|
||||||
<div id="toolbar" class="toolbar">
|
<div id="toolbar" class="toolbar">
|
||||||
{:build_toolbar('refresh,add,delete')}
|
{:build_toolbar('refresh,add,delete')}
|
||||||
</div>
|
</div>
|
||||||
<table id="table" class="table table-striped table-bordered table-hover" width="100%">
|
<table id="table" class="table table-striped table-bordered table-hover"
|
||||||
|
data-operate-edit="{:$auth->check('auth/admin/edit')}"
|
||||||
|
data-operate-del="{:$auth->check('auth/admin/del')}"
|
||||||
|
width="100%">
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,11 @@
|
||||||
<div id="toolbar" class="toolbar">
|
<div id="toolbar" class="toolbar">
|
||||||
{:build_toolbar('refresh,delete')}
|
{:build_toolbar('refresh,delete')}
|
||||||
</div>
|
</div>
|
||||||
<table id="table" class="table table-striped table-bordered table-hover" width="100%">
|
<table id="table" class="table table-striped table-bordered table-hover"
|
||||||
|
data-operate-detail="{:$auth->check('auth/adminlog/index')}"
|
||||||
|
data-operate-del="{:$auth->check('auth/adminlog/del')}"
|
||||||
|
width="100%">
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,10 @@
|
||||||
<div id="toolbar" class="toolbar">
|
<div id="toolbar" class="toolbar">
|
||||||
{:build_toolbar('refresh,add,delete')}
|
{:build_toolbar('refresh,add,delete')}
|
||||||
</div>
|
</div>
|
||||||
<table id="table" class="table table-striped table-bordered table-hover" width="100%">
|
<table id="table" class="table table-striped table-bordered table-hover"
|
||||||
|
data-operate-edit="{:$auth->check('auth/group/edit')}"
|
||||||
|
data-operate-del="{:$auth->check('auth/group/del')}"
|
||||||
|
width="100%">
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,10 @@
|
||||||
{:build_toolbar()}
|
{:build_toolbar()}
|
||||||
<a href="javascript:;" class="btn btn-danger btn-toggle-all"><i class="fa fa-plus"></i> {:__('Toggle all')}</a>
|
<a href="javascript:;" class="btn btn-danger btn-toggle-all"><i class="fa fa-plus"></i> {:__('Toggle all')}</a>
|
||||||
</div>
|
</div>
|
||||||
<table id="table" class="table table-bordered table-hover" width="100%">
|
<table id="table" class="table table-bordered table-hover"
|
||||||
|
data-operate-edit="{:$auth->check('auth/rule/edit')}"
|
||||||
|
data-operate-del="{:$auth->check('auth/rule/del')}"
|
||||||
|
width="100%">
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<div class="widget-body no-padding">
|
<div class="widget-body no-padding">
|
||||||
<div id="toolbar" class="toolbar">
|
<div id="toolbar" class="toolbar">
|
||||||
{:build_toolbar()}
|
{:build_toolbar()}
|
||||||
<div class="dropdown btn-group">
|
<div class="dropdown btn-group {:$auth->check('category/multi')?'':'hide'}">
|
||||||
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
|
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
|
||||||
<ul class="dropdown-menu text-left" role="menu">
|
<ul class="dropdown-menu text-left" role="menu">
|
||||||
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
|
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
|
||||||
|
|
@ -15,7 +15,10 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<table id="table" class="table table-striped table-bordered table-hover" width="100%">
|
<table id="table" class="table table-striped table-bordered table-hover"
|
||||||
|
data-operate-edit="{:$auth->check('category/edit')}"
|
||||||
|
data-operate-del="{:$auth->check('category/del')}"
|
||||||
|
width="100%">
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
<!-- Bootstrap Core CSS -->
|
<!-- Bootstrap Core CSS -->
|
||||||
<link href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
|
<link href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link href="/assets/css/index.css" rel="stylesheet">
|
<link href="__CDN__/assets/css/index.css" rel="stylesheet">
|
||||||
|
|
||||||
<!-- Plugin CSS -->
|
<!-- Plugin CSS -->
|
||||||
<link href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
|
<link href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-menu">
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-menu">
|
||||||
<span class="sr-only">Toggle navigation</span><i class="fa fa-bars"></i>
|
<span class="sr-only">Toggle navigation</span><i class="fa fa-bars"></i>
|
||||||
</button>
|
</button>
|
||||||
<a class="navbar-brand page-scroll" href="#page-top"><img src="/assets/img/logo.png" style="width:200px;" alt=""></a>
|
<a class="navbar-brand page-scroll" href="#page-top"><img src="__CDN__/assets/img/logo.png" style="width:200px;" alt=""></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="collapse navbar-collapse" id="navbar-collapse-menu">
|
<div class="collapse navbar-collapse" id="navbar-collapse-menu">
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,10 @@ return [
|
||||||
'module_init' => [
|
'module_init' => [
|
||||||
'app\\common\\behavior\\Common',
|
'app\\common\\behavior\\Common',
|
||||||
],
|
],
|
||||||
|
// 模块初始化
|
||||||
|
'addons_init' => [
|
||||||
|
'app\\common\\behavior\\Common',
|
||||||
|
],
|
||||||
// 操作开始执行
|
// 操作开始执行
|
||||||
'action_begin' => [],
|
'action_begin' => [],
|
||||||
// 视图内容过滤
|
// 视图内容过滤
|
||||||
|
|
|
||||||
|
|
@ -7992,11 +7992,6 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
auth: {
|
|
||||||
check: function (name) {
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 单元格数据格式化
|
// 单元格数据格式化
|
||||||
formatter: {
|
formatter: {
|
||||||
icon: function (value, row, index) {
|
icon: function (value, row, index) {
|
||||||
|
|
@ -8087,8 +8082,11 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
|
||||||
buttons.push({name: 'del', icon: 'fa fa-trash', classname: 'btn btn-xs btn-danger btn-delone'});
|
buttons.push({name: 'del', icon: 'fa fa-trash', classname: 'btn btn-xs btn-danger btn-delone'});
|
||||||
var html = [];
|
var html = [];
|
||||||
$.each(buttons, function (i, j) {
|
$.each(buttons, function (i, j) {
|
||||||
|
if (j.name === 'dragsort' && typeof row[Table.config.dragsortfield] === 'undefined') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
var attr = table.data("operate-" + j.name);
|
var attr = table.data("operate-" + j.name);
|
||||||
if ((typeof attr === 'undefined' || attr) || (j.name === 'dragsort' && typeof row[Table.config.dragsortfield] == 'undefined')) {
|
if (typeof attr === 'undefined' || attr) {
|
||||||
if (['add', 'edit', 'del', 'multi'].indexOf(j.name) > -1 && !options.extend[j.name + "_url"]) {
|
if (['add', 'edit', 'del', 'multi'].indexOf(j.name) > -1 && !options.extend[j.name + "_url"]) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -287,11 +287,6 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
auth: {
|
|
||||||
check: function (name) {
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 单元格数据格式化
|
// 单元格数据格式化
|
||||||
formatter: {
|
formatter: {
|
||||||
icon: function (value, row, index) {
|
icon: function (value, row, index) {
|
||||||
|
|
@ -382,8 +377,11 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
||||||
buttons.push({name: 'del', icon: 'fa fa-trash', classname: 'btn btn-xs btn-danger btn-delone'});
|
buttons.push({name: 'del', icon: 'fa fa-trash', classname: 'btn btn-xs btn-danger btn-delone'});
|
||||||
var html = [];
|
var html = [];
|
||||||
$.each(buttons, function (i, j) {
|
$.each(buttons, function (i, j) {
|
||||||
|
if (j.name === 'dragsort' && typeof row[Table.config.dragsortfield] === 'undefined') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
var attr = table.data("operate-" + j.name);
|
var attr = table.data("operate-" + j.name);
|
||||||
if ((typeof attr === 'undefined' || attr) || (j.name === 'dragsort' && typeof row[Table.config.dragsortfield] == 'undefined')) {
|
if (typeof attr === 'undefined' || attr) {
|
||||||
if (['add', 'edit', 'del', 'multi'].indexOf(j.name) > -1 && !options.extend[j.name + "_url"]) {
|
if (['add', 'edit', 'del', 'multi'].indexOf(j.name) > -1 && !options.extend[j.name + "_url"]) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue