作者 Karson

新增Table.api.closetabs关闭选项卡的方法

新增表单提交成功后callback功能
新增mb_ucfirst函数
修复CRUD在ENUM中文字符下的乱码错误
修复快速查询在关联模型下的错误
修复filter过滤在部分情况不生效的BUG
... ... @@ -255,7 +255,7 @@ class Crud extends Command
$controller = str_replace('_', '', $controller);
$controllerArr = !$controller ? explode('_', strtolower($table)) : explode('/', strtolower($controller));
$controllerUrl = implode('/', $controllerArr);
$controllerName = ucfirst(array_pop($controllerArr));
$controllerName = mb_ucfirst(array_pop($controllerArr));
$controllerDir = implode(DS, $controllerArr);
$controllerFile = ($controllerDir ? $controllerDir . DS : '') . $controllerName . '.php';
$viewDir = $adminPath . 'view' . DS . $controllerUrl . DS;
... ... @@ -810,10 +810,10 @@ class Crud extends Command
if (!in_array($inputType, ['datetime', 'select', 'multiple', 'checkbox', 'radio']))
return;
$fieldList = $this->getFieldListName($field);
$methodName = 'get' . ucfirst($fieldList);
$methodName = 'get' . mb_ucfirst($fieldList);
foreach ($itemArr as $k => &$v)
{
$v = "__('" . ucfirst($v) . "')";
$v = "__('" . mb_ucfirst($v) . "')";
}
unset($v);
$itemString = $this->getArrayString($itemArr);
... ... @@ -832,7 +832,7 @@ EOD;
{
if (!in_array($inputType, ['datetime', 'select', 'multiple', 'checkbox', 'radio']))
return;
$attrField = ucfirst($this->getCamelizeName($field));
$attrField = mb_ucfirst($this->getCamelizeName($field));
$getAttr[] = $this->getReplacedStub("mixins" . DS . $inputType, ['field' => $field, 'methodName' => "get{$attrField}TextAttr", 'listMethodName' => "get{$attrField}List"]);
}
... ... @@ -840,7 +840,7 @@ EOD;
{
if ($inputType != 'datetime')
return;
$attrField = ucfirst($this->getCamelizeName($field));
$attrField = mb_ucfirst($this->getCamelizeName($field));
if ($inputType == 'datetime')
{
$return = <<<EOD
... ... @@ -868,13 +868,13 @@ EOD;
{
$modelarr = explode('_', strtolower($table));
foreach ($modelarr as $k => &$v)
$v = ucfirst($v);
$v = mb_ucfirst($v);
unset($v);
$modelName = implode('', $modelarr);
}
else
{
$modelName = ucfirst($model);
$modelName = mb_ucfirst($model);
}
return $modelName;
}
... ... @@ -960,7 +960,7 @@ EOD;
$resultArr = [];
foreach ($itemArr as $k => $v)
{
$resultArr[] = " '" . ucfirst($k) . "' => '{$v}'";
$resultArr[] = " '" . mb_ucfirst($k) . "' => '{$v}'";
}
return implode(",\n", $resultArr);
}
... ... @@ -980,7 +980,7 @@ EOD;
$langArr = [];
foreach ($arr as $k => $v)
{
$langArr[(is_numeric($k) ? $v : $k)] = is_numeric($k) ? ($withTpl ? "{:" : "") . "__('" . ucfirst($v) . "')" . ($withTpl ? "}" : "") : $v;
$langArr[(is_numeric($k) ? $v : $k)] = is_numeric($k) ? ($withTpl ? "{:" : "") . "__('" . mb_ucfirst($v) . "')" . ($withTpl ? "}" : "") : $v;
}
return $langArr;
}
... ... @@ -1129,7 +1129,7 @@ EOD;
*/
protected function getFormGroup($field, $content)
{
$langField = ucfirst($field);
$langField = mb_ucfirst($field);
return<<<EOD
<div class="form-group">
<label for="c-{$field}" class="control-label col-xs-12 col-sm-2">{:__('{$langField}')}:</label>
... ... @@ -1175,7 +1175,7 @@ EOD;
*/
protected function getJsColumn($field, $datatype = '', $extend = '')
{
$lang = ucfirst($field);
$lang = mb_ucfirst($field);
$formatter = '';
foreach ($this->fieldFormatterSuffix as $k => $v)
{
... ...
... ... @@ -154,7 +154,7 @@ CREATE TABLE `fa_auth_rule` (
-- Records of `fa_auth_rule`
-- ----------------------------
BEGIN;
INSERT INTO `fa_auth_rule` VALUES ('1', 'file', '0', 'dashboard', '控制台', 'fa fa-dashboard\r', '', '用于展示当前系统中的统计数据、统计报表及重要实时数据\r', '1', '1497429920', '1497429920', '143', 'normal'), ('2', 'file', '0', 'general', '常规管理', 'fa fa-cogs', '', '', '1', '1497429920', '1497430169', '137', 'normal'), ('3', 'file', '0', 'category', '分类管理', 'fa fa-list\r', '', '用于统一管理网站的所有分类,分类可进行无限级分类\r', '1', '1497429920', '1497429920', '119', 'normal'), ('4', 'file', '0', 'addon', '插件管理', 'fa fa-rocket', '', '可在线安装、卸载、禁用、启用插件,同时支持添加本地插件', '1', '1502035509', '1502035509', '0', 'normal'), ('5', 'file', '0', 'auth', '权限管理', 'fa fa-group', '', '', '1', '1497429920', '1497430092', '99', 'normal'), ('6', 'file', '2', 'general/config', '系统配置', 'fa fa-cog', '', '', '1', '1497429920', '1497430683', '60', 'normal'), ('7', 'file', '2', 'general/attachment', '附件管理', 'fa fa-file-image-o', '', '主要用于管理上传到又拍云的数据或上传至本服务的上传数据\r\n', '1', '1497429920', '1497430699', '53', 'normal'), ('8', 'file', '2', 'general/profile', '个人配置', 'fa fa-user\r', '', '', '1', '1497429920', '1497429920', '34', 'normal'), ('9', 'file', '5', 'auth/admin', '管理员管理', 'fa fa-user', '', '一个管理员可以有多个角色组,左侧的菜单根据管理员所拥有的权限进行生成', '1', '1497429920', '1497430320', '118', 'normal'), ('10', 'file', '5', 'auth/adminlog', '管理员日志', 'fa fa-list-alt', '', '管理员可以查看自己所拥有的权限的管理员日志', '1', '1497429920', '1497430307', '113', 'normal'), ('11', 'file', '5', 'auth/group', '角色组', 'fa fa-group', '', '角色组可以有多个,角色有上下级层级关系,如果子角色有角色组和管理员的权限则可以派生属于自己组别下级的角色组或管理员', '1', '1497429920', '1497429920', '109', 'normal'), ('12', 'file', '5', 'auth/rule', '规则管理', 'fa fa-bars', '', '规则通常对应一个控制器的方法,同时左侧的菜单栏数据也从规则中体现,通常建议通过控制台进行生成规则节点', '1', '1497429920', '1497430581', '104', 'normal'), ('13', 'file', '1', 'dashboard/index', '查看', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '136', 'normal'), ('14', 'file', '1', 'dashboard/add', '添加', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '135', 'normal'), ('15', 'file', '1', 'dashboard/del', '删除', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '133', 'normal'), ('16', 'file', '1', 'dashboard/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '134', 'normal'), ('17', 'file', '1', 'dashboard/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '132', 'normal'), ('18', 'file', '6', 'general/config/index', '查看', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '52', 'normal'), ('19', 'file', '6', 'general/config/add', '添加', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '51', 'normal'), ('20', 'file', '6', 'general/config/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '50', 'normal'), ('21', 'file', '6', 'general/config/del', '删除', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '49', 'normal'), ('22', 'file', '6', 'general/config/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '48', 'normal'), ('23', 'file', '7', 'general/attachment/index', '查看', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '59', 'normal'), ('24', 'file', '7', 'general/attachment/select', '选择附件', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '58', 'normal'), ('25', 'file', '7', 'general/attachment/add', '添加', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '57', 'normal'), ('26', 'file', '7', 'general/attachment/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '56', 'normal'), ('27', 'file', '7', 'general/attachment/del', '删除', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '55', 'normal'), ('28', 'file', '7', 'general/attachment/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '54', 'normal'), ('29', 'file', '8', 'general/profile/index', '查看', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '33', 'normal'), ('30', 'file', '8', 'general/profile/update', '更新个人信息', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '32', 'normal'), ('31', 'file', '8', 'general/profile/add', '添加', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '31', 'normal'), ('32', 'file', '8', 'general/profile/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '30', 'normal'), ('33', 'file', '8', 'general/profile/del', '删除', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '29', 'normal'), ('34', 'file', '8', 'general/profile/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '28', 'normal'), ('35', 'file', '3', 'category/index', '查看', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '142', 'normal'), ('36', 'file', '3', 'category/add', '添加', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '141', 'normal'), ('37', 'file', '3', 'category/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '140', 'normal'), ('38', 'file', '3', 'category/del', '删除', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '139', 'normal'), ('39', 'file', '3', 'category/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '138', 'normal'), ('40', 'file', '9', 'auth/admin/index', '查看', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '117', 'normal'), ('41', 'file', '9', 'auth/admin/add', '添加', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '116', 'normal'), ('42', 'file', '9', 'auth/admin/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '115', 'normal'), ('43', 'file', '9', 'auth/admin/del', '删除', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '114', 'normal'), ('44', 'file', '10', 'auth/adminlog/index', '查看', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '112', 'normal'), ('45', 'file', '10', 'auth/adminlog/detail', '详情', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '111', 'normal'), ('46', 'file', '10', 'auth/adminlog/del', '删除', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '110', 'normal'), ('47', 'file', '11', 'auth/group/index', '查看', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '108', 'normal'), ('48', 'file', '11', 'auth/group/add', '添加', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '107', 'normal'), ('49', 'file', '11', 'auth/group/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '106', 'normal'), ('50', 'file', '11', 'auth/group/del', '删除', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '105', 'normal'), ('51', 'file', '12', 'auth/rule/index', '查看', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '103', 'normal'), ('52', 'file', '12', 'auth/rule/add', '添加', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '102', 'normal'), ('53', 'file', '12', 'auth/rule/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '101', 'normal'), ('54', 'file', '12', 'auth/rule/del', '删除', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '100', 'normal'), ('55', 'file', '4', 'addon/index', '查看', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('56', 'file', '4', 'addon/add', '添加', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('57', 'file', '4', 'addon/edit', '修改', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('58', 'file', '4', 'addon/del', '删除', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('59', 'file', '4', 'addon/local', '本地安装', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('60', 'file', '4', 'addon/state', '禁用启用', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('61', 'file', '4', 'addon/install', '安装', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('62', 'file', '4', 'addon/uninstall', '卸载', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('63', 'file', '4', 'addon/config', '配置', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('64', 'file', '4', 'addon/refresh', '刷新', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('65', 'file', '4', 'addon/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal');
INSERT INTO `fa_auth_rule` VALUES ('1', 'file', '0', 'dashboard', '控制台', 'fa fa-dashboard\r', '', '用于展示当前系统中的统计数据、统计报表及重要实时数据\r', '1', '1497429920', '1497429920', '143', 'normal'), ('2', 'file', '0', 'general', '常规管理', 'fa fa-cogs', '', '', '1', '1497429920', '1497430169', '137', 'normal'), ('3', 'file', '0', 'category', '分类管理', 'fa fa-list\r', '', '用于统一管理网站的所有分类,分类可进行无限级分类\r', '1', '1497429920', '1497429920', '119', 'normal'), ('4', 'file', '0', 'addon', '插件管理', 'fa fa-rocket', '', '可在线安装、卸载、禁用、启用插件,同时支持添加本地插件。FastAdmin已上线插件商店 ,你可以发布你的免费或付费插件:<a href="http://www.fastadmin.net/store.html" target="_blank">http://www.fastadmin.net/store.html</a>', '1', '1502035509', '1502035509', '0', 'normal'), ('5', 'file', '0', 'auth', '权限管理', 'fa fa-group', '', '', '1', '1497429920', '1497430092', '99', 'normal'), ('6', 'file', '2', 'general/config', '系统配置', 'fa fa-cog', '', '', '1', '1497429920', '1497430683', '60', 'normal'), ('7', 'file', '2', 'general/attachment', '附件管理', 'fa fa-file-image-o', '', '主要用于管理上传到又拍云的数据或上传至本服务的上传数据\r\n', '1', '1497429920', '1497430699', '53', 'normal'), ('8', 'file', '2', 'general/profile', '个人配置', 'fa fa-user\r', '', '', '1', '1497429920', '1497429920', '34', 'normal'), ('9', 'file', '5', 'auth/admin', '管理员管理', 'fa fa-user', '', '一个管理员可以有多个角色组,左侧的菜单根据管理员所拥有的权限进行生成', '1', '1497429920', '1497430320', '118', 'normal'), ('10', 'file', '5', 'auth/adminlog', '管理员日志', 'fa fa-list-alt', '', '管理员可以查看自己所拥有的权限的管理员日志', '1', '1497429920', '1497430307', '113', 'normal'), ('11', 'file', '5', 'auth/group', '角色组', 'fa fa-group', '', '角色组可以有多个,角色有上下级层级关系,如果子角色有角色组和管理员的权限则可以派生属于自己组别下级的角色组或管理员', '1', '1497429920', '1497429920', '109', 'normal'), ('12', 'file', '5', 'auth/rule', '规则管理', 'fa fa-bars', '', '规则通常对应一个控制器的方法,同时左侧的菜单栏数据也从规则中体现,通常建议通过控制台进行生成规则节点', '1', '1497429920', '1497430581', '104', 'normal'), ('13', 'file', '1', 'dashboard/index', '查看', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '136', 'normal'), ('14', 'file', '1', 'dashboard/add', '添加', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '135', 'normal'), ('15', 'file', '1', 'dashboard/del', '删除', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '133', 'normal'), ('16', 'file', '1', 'dashboard/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '134', 'normal'), ('17', 'file', '1', 'dashboard/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '132', 'normal'), ('18', 'file', '6', 'general/config/index', '查看', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '52', 'normal'), ('19', 'file', '6', 'general/config/add', '添加', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '51', 'normal'), ('20', 'file', '6', 'general/config/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '50', 'normal'), ('21', 'file', '6', 'general/config/del', '删除', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '49', 'normal'), ('22', 'file', '6', 'general/config/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '48', 'normal'), ('23', 'file', '7', 'general/attachment/index', '查看', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '59', 'normal'), ('24', 'file', '7', 'general/attachment/select', '选择附件', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '58', 'normal'), ('25', 'file', '7', 'general/attachment/add', '添加', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '57', 'normal'), ('26', 'file', '7', 'general/attachment/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '56', 'normal'), ('27', 'file', '7', 'general/attachment/del', '删除', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '55', 'normal'), ('28', 'file', '7', 'general/attachment/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '54', 'normal'), ('29', 'file', '8', 'general/profile/index', '查看', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '33', 'normal'), ('30', 'file', '8', 'general/profile/update', '更新个人信息', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '32', 'normal'), ('31', 'file', '8', 'general/profile/add', '添加', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '31', 'normal'), ('32', 'file', '8', 'general/profile/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '30', 'normal'), ('33', 'file', '8', 'general/profile/del', '删除', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '29', 'normal'), ('34', 'file', '8', 'general/profile/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '28', 'normal'), ('35', 'file', '3', 'category/index', '查看', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '142', 'normal'), ('36', 'file', '3', 'category/add', '添加', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '141', 'normal'), ('37', 'file', '3', 'category/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '140', 'normal'), ('38', 'file', '3', 'category/del', '删除', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '139', 'normal'), ('39', 'file', '3', 'category/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '138', 'normal'), ('40', 'file', '9', 'auth/admin/index', '查看', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '117', 'normal'), ('41', 'file', '9', 'auth/admin/add', '添加', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '116', 'normal'), ('42', 'file', '9', 'auth/admin/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '115', 'normal'), ('43', 'file', '9', 'auth/admin/del', '删除', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '114', 'normal'), ('44', 'file', '10', 'auth/adminlog/index', '查看', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '112', 'normal'), ('45', 'file', '10', 'auth/adminlog/detail', '详情', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '111', 'normal'), ('46', 'file', '10', 'auth/adminlog/del', '删除', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '110', 'normal'), ('47', 'file', '11', 'auth/group/index', '查看', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '108', 'normal'), ('48', 'file', '11', 'auth/group/add', '添加', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '107', 'normal'), ('49', 'file', '11', 'auth/group/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '106', 'normal'), ('50', 'file', '11', 'auth/group/del', '删除', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '105', 'normal'), ('51', 'file', '12', 'auth/rule/index', '查看', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '103', 'normal'), ('52', 'file', '12', 'auth/rule/add', '添加', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '102', 'normal'), ('53', 'file', '12', 'auth/rule/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '101', 'normal'), ('54', 'file', '12', 'auth/rule/del', '删除', 'fa fa-circle-o', '', '', '0', '1497429920', '1497429920', '100', 'normal'), ('55', 'file', '4', 'addon/index', '查看', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('56', 'file', '4', 'addon/add', '添加', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('57', 'file', '4', 'addon/edit', '修改', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('58', 'file', '4', 'addon/del', '删除', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('59', 'file', '4', 'addon/local', '本地安装', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('60', 'file', '4', 'addon/state', '禁用启用', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('61', 'file', '4', 'addon/install', '安装', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('62', 'file', '4', 'addon/uninstall', '卸载', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('63', 'file', '4', 'addon/config', '配置', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('64', 'file', '4', 'addon/refresh', '刷新', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal'), ('65', 'file', '4', 'addon/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1502035509', '1502035509', '0', 'normal');
COMMIT;
-- ----------------------------
... ...
... ... @@ -30,9 +30,9 @@
<ul class="sidebar-menu">
{$menulist}
<li class="header">相关链接</li>
<li><a href="http://doc.fastadmin.net"><i class="fa fa-list text-red"></i> <span>官方文档</span></a></li>
<li><a href="http://forum.fastadmin.net"><i class="fa fa-comment text-yellow"></i> <span>社区交流</span></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=487PNBb"><i class="fa fa-qq text-aqua"></i> <span>QQ交流群</span></a></li>
<li><a href="http://doc.fastadmin.net" target="_blank"><i class="fa fa-list text-red"></i> <span>官方文档</span></a></li>
<li><a href="http://forum.fastadmin.net" target="_blank"><i class="fa fa-comment text-yellow"></i> <span>社区交流</span></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=487PNBb" target="_blank"><i class="fa fa-qq text-aqua"></i> <span>QQ交流群</span></a></li>
</ul>
</section>
<!-- /.sidebar -->
\ No newline at end of file
... ...
... ... @@ -198,3 +198,13 @@ if (!function_exists('copydirs'))
}
}
if (!function_exists('mb_ucfirst'))
{
function mb_ucfirst($string)
{
return mb_strtoupper(mb_substr($string, 0, 1)) . mb_strtolower(mb_substr($string, 1));
}
}
\ No newline at end of file
... ...
... ... @@ -192,7 +192,7 @@ class Backend extends Controller
/**
* 生成查询所需要的条件,排序方式
* @param mixed $searchfields 查询条件
* @param mixed $searchfields 快速查询的字段
* @param boolean $relationSearch 是否关联查询
* @return array
*/
... ... @@ -220,17 +220,14 @@ class Backend extends Controller
$name = basename(str_replace('\\', '/', $class));
$tableName = $this->model->getQuery()->getTable($name) . ".";
}
if (stripos($sort, ".") === false)
{
$sort = $tableName . $sort;
}
$sort = stripos($sort, ".") === false ? $tableName . $sort : $sort;
}
if ($search)
{
$searcharr = is_array($searchfields) ? $searchfields : explode(',', $searchfields);
foreach ($searcharr as $k => &$v)
{
$v = $tableName . $v;
$v = stripos($v, ".") === false ? $tableName . $v : $v;
}
unset($v);
$where[] = [implode("|", $searcharr), "LIKE", "%{$search}%"];
... ... @@ -249,7 +246,7 @@ class Backend extends Controller
case '!=':
case 'LIKE':
case 'NOT LIKE':
$where[] = [$k, $sym, $v];
$where[] = [$k, $sym, (string) $v];
break;
case '>':
case '>=':
... ... @@ -257,7 +254,9 @@ class Backend extends Controller
case '<=':
$where[] = [$k, $sym, intval($v)];
break;
case 'IN':
case 'IN(...)':
case 'NOT IN':
case 'NOT IN(...)':
$where[] = [$k, str_replace('(...)', '', $sym), explode(',', $v)];
break;
... ... @@ -265,10 +264,13 @@ class Backend extends Controller
case 'NOT BETWEEN':
$where[] = [$k, $sym, array_slice(explode(',', $v), 0, 2)];
break;
case 'LIKE':
case 'LIKE %...%':
$where[] = [$k, 'LIKE', "%{$v}%"];
break;
case 'NULL':
case 'IS NULL':
case 'NOT NULL':
case 'IS NOT NULL':
$where[] = [$k, strtolower(str_replace('IS ', '', $sym))];
break;
... ...
... ... @@ -50,7 +50,7 @@ define(['fast', 'moment'], function (Fast, Moment) {
title = typeof title !== 'undefined' ? title : leftlink.find("span:first").text();
leftlink.trigger("fa.event.toggleitem");
}
var navnode = $(".nav-tabs ul li a[node-url='" + url + "']");
var navnode = top.window.$(".nav-tabs ul li a[node-url='" + url + "']");
if (navnode.size() > 0) {
navnode.trigger("click");
} else {
... ... @@ -63,6 +63,30 @@ define(['fast', 'moment'], function (Fast, Moment) {
}
}
},
closetabs: function (url) {
if (typeof url === 'undefined') {
top.window.$("ul.nav-addtabs li.active .close-tab").trigger("click");
} else {
var dom = "a[url='{url}']"
var navlink = top.window.$(dom.replace(/\{url\}/, url));
if (navlink.size() === 0) {
url = Fast.api.fixurl(url);
navlink = top.window.$(dom.replace(/\{url\}/, url));
if (navlink.size() === 0) {
} else {
var baseurl = url.substr(0, url.indexOf("?") > -1 ? url.indexOf("?") : url.length);
navlink = top.window.$(dom.replace(/\{url\}/, baseurl));
//能找到相对地址
if (navlink.size() === 0) {
navlink = top.window.$(".nav-tabs ul li a[node-url='" + url + "']");
}
}
}
if (navlink.size() > 0 && navlink.attr('addtabs')) {
top.window.$("ul.nav-addtabs li#tab_" + navlink.attr('addtabs') + " .close-tab").trigger("click");
}
}
},
replaceids: function (elem, url) {
//如果有需要替换ids的
if (url.indexOf("{ids}") > -1) {
... ...
... ... @@ -6761,7 +6761,7 @@ define('backend',['fast', 'moment'], function (Fast, Moment) {
title = typeof title !== 'undefined' ? title : leftlink.find("span:first").text();
leftlink.trigger("fa.event.toggleitem");
}
var navnode = $(".nav-tabs ul li a[node-url='" + url + "']");
var navnode = top.window.$(".nav-tabs ul li a[node-url='" + url + "']");
if (navnode.size() > 0) {
navnode.trigger("click");
} else {
... ... @@ -6774,6 +6774,30 @@ define('backend',['fast', 'moment'], function (Fast, Moment) {
}
}
},
closetabs: function (url) {
if (typeof url === 'undefined') {
top.window.$("ul.nav-addtabs li.active .close-tab").trigger("click");
} else {
var dom = "a[url='{url}']"
var navlink = top.window.$(dom.replace(/\{url\}/, url));
if (navlink.size() === 0) {
url = Fast.api.fixurl(url);
navlink = top.window.$(dom.replace(/\{url\}/, url));
if (navlink.size() === 0) {
} else {
var baseurl = url.substr(0, url.indexOf("?") > -1 ? url.indexOf("?") : url.length);
navlink = top.window.$(dom.replace(/\{url\}/, baseurl));
//能找到相对地址
if (navlink.size() === 0) {
navlink = top.window.$(".nav-tabs ul li a[node-url='" + url + "']");
}
}
}
if (navlink.size() > 0 && navlink.attr('addtabs')) {
top.window.$("ul.nav-addtabs li#tab_" + navlink.attr('addtabs') + " .close-tab").trigger("click");
}
}
},
replaceids: function (elem, url) {
//如果有需要替换ids的
if (url.indexOf("{ids}") > -1) {
... ... @@ -10953,8 +10977,15 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator'], function ($, undef
}
}, function (data, ret) {
$('.form-group', form).removeClass('has-feedback has-success has-error');
if (data && typeof data === 'object' && typeof data.token !== 'undefined') {
$("input[name='__token__']", form).val(data.token);
if (data && typeof data === 'object') {
//刷新客户端token
if (typeof data.token !== 'undefined') {
$("input[name='__token__']", form).val(data.token);
}
//调用客户端事件
if (typeof data.callback !== 'undefined' && typeof data.callback === 'function') {
data.callback.call(form, data);
}
}
if (typeof success === 'function') {
if (!success.call(form, data, ret)) {
... ... @@ -11486,21 +11517,24 @@ $.fn.addtabs = function (options) {
});
_add = function (opts) {
id = 'tab_' + opts.id;
var id, tabid, conid, url;
id = opts.id;
tabid = 'tab_' + opts.id;
conid = 'con_' + opts.id;
url = opts.url;
url += (opts.url.indexOf("?") > -1 ? "&addtabs=1" : "?addtabs=1");
navobj.find("[role='presentation']").removeClass('active');
tabobj.find("[role='tabpanel']").removeClass('active');
//如果TAB不存在,创建一个新的TAB
if ($("#" + id).size() == 0) {
if ($("#" + tabid).size() == 0) {
//创建新TAB的title
title = $('<li role="presentation" id="tab_' + id + '"><a href="#' + id + '" node-id="' + opts.id + '" aria-controls="' + id + '" role="tab" data-toggle="tab">' + opts.title + '</a></li>');
title = $('<li role="presentation" id="' + tabid + '"><a href="#' + conid + '" node-id="' + opts.id + '" aria-controls="' + id + '" role="tab" data-toggle="tab">' + opts.title + '</a></li>');
//是否允许关闭
if (options.close && $("li", navobj).size() > 0) {
title.append(' <i class="close-tab fa fa-remove"></i>');
}
//创建新TAB的内容
content = $('<div role="tabpanel" class="tab-pane" id="' + id + '"></div>');
content = $('<div role="tabpanel" class="tab-pane" id="' + conid + '"></div>');
//是否指定TAB内容
if (opts.content) {
content.append(opts.content);
... ... @@ -11522,23 +11556,25 @@ $.fn.addtabs = function (options) {
}
//激活TAB
$("#tab_" + id).addClass('active');
$("#" + id).addClass("active");
$("#" + tabid).addClass('active');
$("#" + conid).addClass("active");
_drop();
};
_close = function (id) {
var tabid = 'tab_'+id;
var conid = 'con_'+id;
//如果关闭的是当前激活的TAB,激活他的前一个TAB
if (obj.find("li.active").attr('id') == "tab_" + id) {
if ($("#tab_" + id).prev().not(".tabdrop").size() > 0) {
$("#tab_" + id).prev().not(".tabdrop").find("a").trigger("click");
} else if ($("#tab_" + id).next().size() > 0) {
$("#tab_" + id).next().trigger("click");
if (obj.find("li.active").attr('id') == tabid) {
if ($("#" + tabid).prev().not(".tabdrop").size() > 0) {
$("#" + tabid).prev().not(".tabdrop").find("a").trigger("click");
} else if ($("#" + tabid).next().size() > 0) {
$("#" + tabid).next().trigger("click");
}
}
//关闭TAB
$("#tab_" + id).remove();
$("#" + id).remove();
$("#" + tabid).remove();
$("#" + conid).remove();
_drop();
options.callback();
};
... ...
... ... @@ -186,8 +186,15 @@ define(['jquery', 'bootstrap', 'upload', 'validator'], function ($, undefined, U
}
}, function (data, ret) {
$('.form-group', form).removeClass('has-feedback has-success has-error');
if (data && typeof data === 'object' && typeof data.token !== 'undefined') {
$("input[name='__token__']", form).val(data.token);
if (data && typeof data === 'object') {
//刷新客户端token
if (typeof data.token !== 'undefined') {
$("input[name='__token__']", form).val(data.token);
}
//调用客户端事件
if (typeof data.callback !== 'undefined' && typeof data.callback === 'function') {
data.callback.call(form, data);
}
}
if (typeof success === 'function') {
if (!success.call(form, data, ret)) {
... ...