mirror of https://gitee.com/karson/fastadmin.git
新增buttons的extend参数
新增overtrue/pinyin包依赖 修复cdnurl函数获取不了配置的BUG 优化buttons的url参数 优化插件前端文件addons.js,移除backend依赖 优化php think min在Win下可能导致压缩失败的问题 优化后台菜单获取拼音字母可能导致的错误 优化mbstring编码问题,默认为utf-8pull/16/head
parent
d911792d02
commit
37937f1665
|
|
@ -58,7 +58,7 @@ class Min extends Command
|
|||
{
|
||||
if (IS_WIN)
|
||||
{
|
||||
throw new Exception("node environment not found!please check http://doc.fastadmin.net/faq.html !");
|
||||
throw new Exception("node environment not found!please check http://doc.fastadmin.net/docs/faq.html !");
|
||||
}
|
||||
|
||||
try
|
||||
|
|
@ -85,8 +85,8 @@ class Min extends Command
|
|||
'jsBaseUrl' => $this->options['jsBaseUrl'],
|
||||
'cssBaseName' => str_replace('{module}', $mod, $this->options['cssBaseName']),
|
||||
'cssBaseUrl' => $this->options['cssBaseUrl'],
|
||||
'jsBasePath' => str_replace('\\', '/', ROOT_PATH) . $this->options['jsBaseUrl'],
|
||||
'cssBasePath' => str_replace('\\', '/', ROOT_PATH) . $this->options['cssBaseUrl'],
|
||||
'jsBasePath' => str_replace('/', DS, ROOT_PATH . $this->options['jsBaseUrl']),
|
||||
'cssBasePath' => str_replace('/', DS, ROOT_PATH . $this->options['cssBaseUrl']),
|
||||
'ds' => DS,
|
||||
];
|
||||
|
||||
|
|
@ -156,7 +156,7 @@ class Min extends Command
|
|||
*/
|
||||
protected function getStub($name)
|
||||
{
|
||||
return __DIR__ . '/Min/stubs/' . $name . '.stub';
|
||||
return __DIR__ . DS . 'Min' . DS . 'stubs' . DS . $name . '.stub';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -269,6 +269,7 @@ class Auth extends \fast\Auth
|
|||
// 读取管理员当前拥有的权限节点
|
||||
$userRule = $this->getRuleList();
|
||||
$select_id = 0;
|
||||
$pinyin = new \Overtrue\Pinyin\Pinyin('Overtrue\Pinyin\MemoryFileDictLoader');
|
||||
// 必须将结果集转换为数组
|
||||
$ruleList = collection(model('AuthRule')->where('ismenu', 1)->order('weigh', 'desc')->cache("__menu__")->select())->toArray();
|
||||
foreach ($ruleList as $k => &$v)
|
||||
|
|
@ -281,8 +282,8 @@ class Auth extends \fast\Auth
|
|||
$select_id = $v['name'] == $fixedPage ? $v['id'] : $select_id;
|
||||
$v['url'] = '/' . $module . '/' . $v['name'];
|
||||
$v['badge'] = isset($badgeList[$v['name']]) ? $badgeList[$v['name']] : '';
|
||||
$v['py'] = \fast\Pinyin::get($v['title'], true);
|
||||
$v['pinyin'] = \fast\Pinyin::get($v['title']);
|
||||
$v['py'] = $pinyin->abbr($v['title'], '');
|
||||
$v['pinyin'] = $pinyin->permalink($v['title'], '');
|
||||
}
|
||||
// 构造菜单数据
|
||||
Tree::instance()->init($ruleList);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<!-- Logo -->
|
||||
<a href="javascript:;" class="logo">
|
||||
<!-- 迷你模式下Logo的大小为50X50 -->
|
||||
<span class="logo-mini">{$site.name|mb_substr=0,4,'utf-8'|strtoupper}</span>
|
||||
<span class="logo-mini">{$site.name|mb_substr=0,4,'utf-8'|mb_strtoupper='utf-8'}</span>
|
||||
<!-- 普通模式下Logo -->
|
||||
<span class="logo-lg"><b>{$site.name|mb_substr=0,4,'utf-8'}</b>{$site.name|mb_substr=4,null,'utf-8'}</span>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ if (!function_exists('cdnurl'))
|
|||
*/
|
||||
function cdnurl($url)
|
||||
{
|
||||
return preg_match("/^https?:\/\/(.*)/i", $url) ? $url : think\Config::get('cdnurl') . $url;
|
||||
return preg_match("/^https?:\/\/(.*)/i", $url) ? $url : think\Config::get('site.cdnurl') . $url;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ class Common
|
|||
|
||||
public function run(&$request)
|
||||
{
|
||||
// 设置mbstring字符编码
|
||||
mb_internal_encoding("UTF-8");
|
||||
|
||||
// 如果修改了index.php入口地址,则需要手动修改cdnurl的值
|
||||
$cdnurl = preg_replace("/\/(\w+)\.php$/i", '', $request->root());
|
||||
// 如果未设置__CDN__则自动匹配得出
|
||||
|
|
@ -31,7 +34,7 @@ class Common
|
|||
// 如果是调试模式将version置为当前的时间戳可避免缓存
|
||||
Config::set('site.version', time());
|
||||
// 如果是开发模式那么将异常模板修改成官方的
|
||||
Config::set('exception_tmpl',THINK_PATH . 'tpl' . DS . 'think_exception.tpl');
|
||||
Config::set('exception_tmpl', THINK_PATH . 'tpl' . DS . 'think_exception.tpl');
|
||||
}
|
||||
// 如果是trace模式且Ajax的情况下关闭trace
|
||||
if (Config::get('app_trace') && $request->isAjax())
|
||||
|
|
|
|||
|
|
@ -40,14 +40,13 @@
|
|||
<div class="collapse navbar-collapse" id="navbar-collapse-menu">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a href="http://www.fastadmin.net">首页</a></li>
|
||||
<li><a href="http://www.fastadmin.net#features">特性</a></li>
|
||||
<li><a href="http://doc.fastadmin.net">文档</a></li>
|
||||
<li><a href="http://forum.fastadmin.net">论坛</a></li>
|
||||
<li><a href="http://www.fastadmin.net#donate">打赏</a></li>
|
||||
<li><a href="http://www.fastadmin.net#contact">联系</a></li>
|
||||
<li><a href="http://html.fastadmin.net" target="_blank">HTML版</a></li>
|
||||
<li><a href="http://demo.fastadmin.net?ref=nav" target="_blank">演示</a></li>
|
||||
|
||||
<li><a href="http://www.fastadmin.net/store.html" title="FastAdmin插件市场">插件市场</a></li>
|
||||
<li><a href="http://www.fastadmin.net/service.html" title="FastAdmin增值服务">服务</a></li>
|
||||
<li><a href="http://www.fastadmin.net/download.html" title="FastAdmin下载">下载</a></li>
|
||||
<li><a href="http://www.fastadmin.net/demo.html" title="FastAdmin演示">演示</a></li>
|
||||
<li><a href="http://forum.fastadmin.net" title="FastAdmin交流社区">社区</a></li>
|
||||
<li><a href="http://doc.fastadmin.net" title="FastAdmin官方文档">文档</a></li>
|
||||
<li><a href="http://html.fastadmin.net" title="FastAdmin的HTML版">HTML版</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- /.navbar-collapse -->
|
||||
|
|
|
|||
|
|
@ -22,7 +22,8 @@
|
|||
"topthink/think-captcha": "^1.0",
|
||||
"mtdowling/cron-expression": "^1.2",
|
||||
"phpmailer/phpmailer": "^5.2",
|
||||
"karsonzhang/fastadmin-addons": "dev-master"
|
||||
"karsonzhang/fastadmin-addons": "dev-master",
|
||||
"overtrue/pinyin": "~3.0"
|
||||
},
|
||||
"config": {
|
||||
"preferred-install": "dist"
|
||||
|
|
|
|||
|
|
@ -695,4 +695,13 @@ table.table-template {
|
|||
}
|
||||
}
|
||||
/*平板样式*/
|
||||
/*修复radio和checkbox样式对齐*/
|
||||
.radio > label,
|
||||
.checkbox > label {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.radio > label > input,
|
||||
.checkbox > label > input {
|
||||
margin: 2px 0 0;
|
||||
}
|
||||
/*# sourceMappingURL=backend.css.map */
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,3 +1,3 @@
|
|||
define(['backend'], function (Backend) {
|
||||
define([], function () {
|
||||
|
||||
});
|
||||
|
|
@ -8098,7 +8098,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
|
|||
buttons.push({name: 'edit', icon: 'fa fa-pencil', classname: 'btn btn-xs btn-success btn-editone'});
|
||||
buttons.push({name: 'del', icon: 'fa fa-trash', classname: 'btn btn-xs btn-danger btn-delone'});
|
||||
var html = [];
|
||||
var url, classname, icon, text, title;
|
||||
var url, classname, icon, text, title, extend;
|
||||
$.each(buttons, function (i, j) {
|
||||
if (j.name === 'dragsort' && typeof row[Table.config.dragsortfield] === 'undefined') {
|
||||
return true;
|
||||
|
|
@ -8115,7 +8115,8 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
|
|||
icon = j.icon ? j.icon : '';
|
||||
text = j.text ? j.text : '';
|
||||
title = j.title ? j.title : text;
|
||||
html.push('<a href="' + url + '" class="' + classname + '" title="' + title + '"><i class="' + icon + '"></i>' + (text ? ' ' + text : '') + '</a>');
|
||||
extend = j.extend ? j.extend : '';
|
||||
html.push('<a href="' + url + '" class="' + classname + '" ' + extend + ' title="' + title + '"><i class="' + icon + '"></i>' + (text ? ' ' + text : '') + '</a>');
|
||||
}
|
||||
});
|
||||
return html.join(' ');
|
||||
|
|
@ -8127,17 +8128,19 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
|
|||
// 默认按钮组
|
||||
var buttons = $.extend([], this.buttons || []);
|
||||
var html = [];
|
||||
var url, classname, icon, text, title, extend;
|
||||
$.each(buttons, function (i, j) {
|
||||
var attr = table.data("buttons-" + j.name);
|
||||
if (typeof attr === 'undefined' || attr) {
|
||||
//自动加上ids
|
||||
j.url = j.url ? j.url + (j.url.match(/(\?|&)+/) ? "&ids=" : "/ids/") + row[options.pk] : '';
|
||||
url = j.url ? Fast.api.fixurl(j.url) : 'javascript:;';
|
||||
url = j.url ? j.url + (j.url.match(/(\?|&)+/) ? "&ids=" : "/ids/") + row[options.pk] : '';
|
||||
url = url ? Fast.api.fixurl(url) : 'javascript:;';
|
||||
classname = j.classname ? j.classname : 'btn-primary btn-' + name + 'one';
|
||||
icon = j.icon ? j.icon : '';
|
||||
text = j.text ? j.text : '';
|
||||
title = j.title ? j.title : text;
|
||||
html.push('<a href="' + url + '" class="' + classname + '" title="' + title + '"><i class="' + icon + '"></i>' + (text ? ' ' + text : '') + '</a>');
|
||||
extend = j.extend ? j.extend : '';
|
||||
html.push('<a href="' + url + '" class="' + classname + '" ' + extend + ' title="' + title + '"><i class="' + icon + '"></i>' + (text ? ' ' + text : '') + '</a>');
|
||||
}
|
||||
});
|
||||
return html.join(' ');
|
||||
|
|
|
|||
|
|
@ -376,7 +376,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
|||
buttons.push({name: 'edit', icon: 'fa fa-pencil', classname: 'btn btn-xs btn-success btn-editone'});
|
||||
buttons.push({name: 'del', icon: 'fa fa-trash', classname: 'btn btn-xs btn-danger btn-delone'});
|
||||
var html = [];
|
||||
var url, classname, icon, text, title;
|
||||
var url, classname, icon, text, title, extend;
|
||||
$.each(buttons, function (i, j) {
|
||||
if (j.name === 'dragsort' && typeof row[Table.config.dragsortfield] === 'undefined') {
|
||||
return true;
|
||||
|
|
@ -393,7 +393,8 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
|||
icon = j.icon ? j.icon : '';
|
||||
text = j.text ? j.text : '';
|
||||
title = j.title ? j.title : text;
|
||||
html.push('<a href="' + url + '" class="' + classname + '" title="' + title + '"><i class="' + icon + '"></i>' + (text ? ' ' + text : '') + '</a>');
|
||||
extend = j.extend ? j.extend : '';
|
||||
html.push('<a href="' + url + '" class="' + classname + '" ' + extend + ' title="' + title + '"><i class="' + icon + '"></i>' + (text ? ' ' + text : '') + '</a>');
|
||||
}
|
||||
});
|
||||
return html.join(' ');
|
||||
|
|
@ -405,7 +406,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
|||
// 默认按钮组
|
||||
var buttons = $.extend([], this.buttons || []);
|
||||
var html = [];
|
||||
var url, classname, icon, text, title;
|
||||
var url, classname, icon, text, title, extend;
|
||||
$.each(buttons, function (i, j) {
|
||||
var attr = table.data("buttons-" + j.name);
|
||||
if (typeof attr === 'undefined' || attr) {
|
||||
|
|
@ -416,7 +417,8 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
|||
icon = j.icon ? j.icon : '';
|
||||
text = j.text ? j.text : '';
|
||||
title = j.title ? j.title : text;
|
||||
html.push('<a href="' + url + '" class="' + classname + '" title="' + title + '"><i class="' + icon + '"></i>' + (text ? ' ' + text : '') + '</a>');
|
||||
extend = j.extend ? j.extend : '';
|
||||
html.push('<a href="' + url + '" class="' + classname + '" ' + extend + ' title="' + title + '"><i class="' + icon + '"></i>' + (text ? ' ' + text : '') + '</a>');
|
||||
}
|
||||
});
|
||||
return html.join(' ');
|
||||
|
|
|
|||
Loading…
Reference in New Issue