Compare commits

..

No commits in common. "V1.6.2.20260323" and "master" have entirely different histories.

78 changed files with 7215 additions and 13289 deletions

View File

@ -7,8 +7,5 @@
"jspdf", "jspdf",
"jspdf-autotable", "jspdf-autotable",
"pdfmake" "pdfmake"
], ]
"scripts":{
"postinstall": "node bower-cleanup.js"
}
} }

1
.gitignore vendored
View File

@ -6,7 +6,6 @@
/public/assets/libs/ /public/assets/libs/
/public/assets/addons/* /public/assets/addons/*
/public/uploads/* /public/uploads/*
.DS_Store
.idea .idea
composer.lock composer.lock
*.log *.log

4
.npmrc
View File

@ -1,4 +0,0 @@
# 使用自定义镜像源
registry=http://mirrors.tencent.com/npm/
#关闭SSL验证
strict-ssl=false

View File

@ -1,139 +0,0 @@
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
copy: {
main: {
files: []
}
}
});
var build = function (module, type, callback) {
var config = {
compile: {
options: type === 'js' ? {
optimizeCss: "standard",
optimize: "uglify", //可使用uglify|closure|none
preserveLicenseComments: true,
removeCombined: false,
baseUrl: "./public/assets/js/", //JS文件所在的基础目录
name: "require-" + module, //来源文件,不包含后缀
out: "./public/assets/js/require-" + module + ".min.js" //目标文件
} : {
optimizeCss: "default",
optimize: "uglify", //可使用uglify|closure|none
cssIn: "./public/assets/css/" + module + ".css", //CSS文件所在的基础目录
out: "./public/assets/css/" + module + ".min.css" //目标文件
}
}
};
var content = grunt.file.read("./public/assets/js/require-" + module + ".js"),
pattern = /^require\.config\(\{[\r\n]?[\n]?(.*?)[\r\n]?[\n]?}\);/is;
var matches = content.match(pattern);
if (matches) {
if (type === 'js') {
var data = matches[1].replaceAll(/(urlArgs|baseUrl):(.*)\n/gi, '');
const parse = require('parse-config-file'), fs = require('fs');
require('jsonminify');
data = JSON.minify("{\n" + data + "\n}");
let options = parse(data);
options.paths.tableexport = "empty:";
Object.assign(config.compile.options, options);
}
let requirejs = require("./application/admin/command/Min/r");
try {
requirejs.optimize(config.compile.options, function (buildResponse) {
// var contents = require('fs').readFileSync(config.compile.options.out, 'utf8');
callback();
}, function (err) {
console.error(err);
callback();
});
} catch (err) {
console.error(err);
callback();
}
}
};
// 加载 "copy" 插件
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('frontend:js', 'build frontend js', function () {
var done = this.async();
build('frontend', 'js', done);
});
grunt.registerTask('backend:js', 'build backend js', function () {
var done = this.async();
build('backend', 'js', done);
});
grunt.registerTask('frontend:css', 'build frontend css', function () {
var done = this.async();
build('frontend', 'css', done);
});
grunt.registerTask('backend:css', 'build frontend css', function () {
var done = this.async();
build('backend', 'css', done);
});
// 注册部署JS和CSS任务
grunt.registerTask('deploy', 'deploy', function () {
const fs = require('fs');
const path = require("path")
const nodeModulesDir = path.resolve(__dirname, "./node_modules");
const getAllFiles = function (dirPath, arrayOfFiles) {
files = fs.readdirSync(dirPath)
arrayOfFiles = arrayOfFiles || []
files.forEach(function (file) {
if (fs.statSync(dirPath + "/" + file).isDirectory()) {
arrayOfFiles = getAllFiles(dirPath + "/" + file, arrayOfFiles)
} else {
arrayOfFiles.push(path.join(__dirname, dirPath, "/", file))
}
});
return arrayOfFiles
};
const mainPackage = grunt.config.get('pkg');
let dists = mainPackage.dists || [];
let files = [];
// 兼容旧版本bower使用的目录
let specialKey = {
'fastadmin-bootstraptable': 'bootstrap-table',
'sortablejs': 'Sortable',
'tableexport.jquery.plugin': 'tableExport.jquery.plugin',
};
Object.keys(dists).forEach(key => {
let src = ["**/*LICENSE*", "**/*license*"];
src = src.concat(Array.isArray(dists[key]) ? dists[key] : [dists[key]]);
files.push({expand: true, cwd: nodeModulesDir + "/" + key, src: src, dest: 'public/assets/libs/' + (specialKey[key] || key) + "/"});
});
// 兼容bower历史路径文件
files = [...files,
{src: nodeModulesDir + "/toastr/build/toastr.min.css", dest: "public/assets/libs/toastr/toastr.min.css"},
{src: nodeModulesDir + "/bootstrap-slider/dist/css/bootstrap-slider.css", dest: "public/assets/libs/bootstrap-slider/slider.css"},
{expand: true, cwd: nodeModulesDir + "/bootstrap-slider/dist", src: ["*.js"], dest: "public/assets/libs/bootstrap-slider/"}
]
grunt.config.set('copy.main.files', files);
grunt.task.run("copy:main");
});
// 注册默认任务
grunt.registerTask('default', ['deploy', 'frontend:js', 'backend:js', 'frontend:css', 'backend:css']);
};

View File

@ -55,9 +55,9 @@ https://demo.fastadmin.net
问答社区: https://ask.fastadmin.net 问答社区: https://ask.fastadmin.net
Github: https://github.com/fastadminnet/fastadmin Github: https://github.com/karsonzhang/fastadmin
Gitee: https://gitee.com/fastadminnet/fastadmin Gitee: https://gitee.com/karson/fastadmin
## 特别鸣谢 ## 特别鸣谢

View File

@ -201,20 +201,16 @@ class Addon extends Command
new \RecursiveDirectoryIterator($addonDir), \RecursiveIteratorIterator::LEAVES_ONLY new \RecursiveDirectoryIterator($addonDir), \RecursiveIteratorIterator::LEAVES_ONLY
); );
$addonDir = str_replace(DS, '/', $addonDir);
$excludeDirRegex = "/\/(\.git|\.svn|\.vscode|\.idea|unpackage)\//i";
foreach ($files as $name => $file) { foreach ($files as $name => $file) {
$filePath = str_replace(DS, '/', $file->getPathname()); if (!$file->isDir()) {
if ($file->isDir() || preg_match($excludeDirRegex, $filePath)) $filePath = $file->getRealPath();
continue; $relativePath = str_replace(DS, '/', substr($filePath, strlen($addonDir)));
$relativePath = substr($filePath, strlen($addonDir)); if (!in_array($file->getFilename(), ['.git', '.DS_Store', 'Thumbs.db'])) {
if (!in_array($file->getFilename(), ['.DS_Store', 'Thumbs.db'])) { $zip->addFile($filePath, $relativePath);
$zip->addFile($filePath, $relativePath); }
} }
} }
$zip->close(); $zip->close();
$output->info("Package Resource Path:" . $addonFile);
$output->info("Package Successed!"); $output->info("Package Successed!");
break; break;
case 'move': case 'move':

View File

@ -18,7 +18,6 @@ class Api extends Command
$this $this
->setName('api') ->setName('api')
->addOption('url', 'u', Option::VALUE_OPTIONAL, 'default api url', '') ->addOption('url', 'u', Option::VALUE_OPTIONAL, 'default api url', '')
->addOption('cdnurl', 'd', Option::VALUE_OPTIONAL, 'default cdn url', '')
->addOption('module', 'm', Option::VALUE_OPTIONAL, 'module name(admin/index/api)', 'api') ->addOption('module', 'm', Option::VALUE_OPTIONAL, 'module name(admin/index/api)', 'api')
->addOption('output', 'o', Option::VALUE_OPTIONAL, 'output index file name', 'api.html') ->addOption('output', 'o', Option::VALUE_OPTIONAL, 'output index file name', 'api.html')
->addOption('template', 'e', Option::VALUE_OPTIONAL, '', 'index.html') ->addOption('template', 'e', Option::VALUE_OPTIONAL, '', 'index.html')
@ -37,7 +36,6 @@ class Api extends Command
$force = $input->getOption('force'); $force = $input->getOption('force');
$url = $input->getOption('url'); $url = $input->getOption('url');
$cdnurl = $input->getOption('cdnurl');
$language = $input->getOption('language'); $language = $input->getOption('language');
$template = $input->getOption('template'); $template = $input->getOption('template');
if (!preg_match("/^([a-z0-9]+)\.html\$/i", $template)) { if (!preg_match("/^([a-z0-9]+)\.html\$/i", $template)) {
@ -100,37 +98,27 @@ class Api extends Command
foreach ($files as $name => $file) { foreach ($files as $name => $file) {
if (!$file->isDir() && $file->getExtension() == 'php') { if (!$file->isDir() && $file->getExtension() == 'php') {
$filePath = $file->getRealPath(); $filePath = $file->getRealPath();
$className = $this->getClassFromFile($filePath); $classes[] = $this->getClassFromFile($filePath);
if ($className) {
$classes[] = $className;
}
} }
} }
} else { } else {
foreach ($controller as $index => $item) { foreach ($controller as $index => $item) {
$filePath = $moduleDir . Config::get('url_controller_layer') . DS . $item . '.php'; $filePath = $moduleDir . Config::get('url_controller_layer') . DS . $item . '.php';
$className = $this->getClassFromFile($filePath); $classes[] = $this->getClassFromFile($filePath);
if ($className) {
$classes[] = $className;
}
} }
} }
$classes = array_unique(array_filter($classes)); $classes = array_unique(array_filter($classes));
$cdnurl = $cdnurl ? : Config::get('site.cdnurl');
$config = [ $config = [
'sitename' => config('site.name'), 'sitename' => config('site.name'),
'title' => $title, 'title' => $title,
'author' => config('site.name'), 'author' => config('site.name'),
'description' => '', 'description' => '',
'apiurl' => $url, 'apiurl' => $url,
'cdnurl' => $cdnurl,
'language' => $language, 'language' => $language,
]; ];
Config::set('view_replace_str.__CDN__', $cdnurl);
$builder = new Builder($classes); $builder = new Builder($classes);
$content = $builder->render($template_file, ['config' => $config, 'lang' => $lang]); $content = $builder->render($template_file, ['config' => $config, 'lang' => $lang]);
@ -195,7 +183,7 @@ class Api extends Command
} }
} }
} }
$className = $namespace . '\\' . $class;
return preg_match('/([a-z0-9_\\]+)([a-z0-9_]+)$/i', $className) ? $className : ''; return $namespace . '\\' . $class;
} }
} }

View File

@ -90,15 +90,14 @@ class Builder
$typeArr = [ $typeArr = [
'integer' => 'number', 'integer' => 'number',
'file' => 'file', 'file' => 'file',
]; ];
$paramslist = array(); $paramslist = array();
foreach ($docs['ApiParams'] as $params) { foreach ($docs['ApiParams'] as $params) {
$type = strtolower($params['type'] ?? 'string'); $inputtype = $params['type'] && isset($typeArr[$params['type']]) ? $typeArr[$params['type']] : ($params['name'] == 'password' ? 'password' : 'text');
$inputtype = $typeArr[$type] ?? ($params['name'] == 'password' ? 'password' : 'text');
$tr = array( $tr = array(
'name' => $params['name'], 'name' => $params['name'],
'type' => $type, 'type' => $params['type'] ?? 'string',
'inputtype' => $inputtype, 'inputtype' => $inputtype,
'sample' => $params['sample'] ?? '', 'sample' => $params['sample'] ?? '',
'required' => $params['required'] ?? true, 'required' => $params['required'] ?? true,
@ -163,7 +162,7 @@ class Builder
'OPTIONS' => 'label-info' 'OPTIONS' => 'label-info'
); );
return $labes[$method] ?? $labes['GET']; return isset($labes[$method]) ? $labes[$method] : $labes['GET'];
} }
public function parse() public function parse()
@ -231,7 +230,7 @@ class Builder
foreach ($docsList as $index => &$methods) { foreach ($docsList as $index => &$methods) {
$methodSectorArr = []; $methodSectorArr = [];
foreach ($methods as $name => $method) { foreach ($methods as $name => $method) {
$methodSectorArr[$name] = $method['weigh'] ?? 0; $methodSectorArr[$name] = isset($method['weigh']) ? $method['weigh'] : 0;
} }
arsort($methodSectorArr); arsort($methodSectorArr);
$methods = array_merge(array_flip(array_keys($methodSectorArr)), $methods); $methods = array_merge(array_flip(array_keys($methodSectorArr)), $methods);
@ -254,6 +253,7 @@ class Builder
public function render($template, $vars = []) public function render($template, $vars = [])
{ {
$docsList = $this->parse(); $docsList = $this->parse();
return $this->view->display(file_get_contents($template), array_merge($vars, ['docsList' => $docsList])); return $this->view->display(file_get_contents($template), array_merge($vars, ['docsList' => $docsList]));
} }
} }

View File

@ -8,10 +8,16 @@
<title>{$config.title}</title> <title>{$config.title}</title>
<!-- Bootstrap Core CSS --> <!-- Bootstrap Core CSS -->
<link href="{$config.cdnurl|default=''}/assets/libs/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
<!-- Plugin CSS --> <!-- Plugin CSS -->
<link href="{$config.cdnurl|default=''}/assets/libs/font-awesome/css/font-awesome.min.css" rel="stylesheet"> <link href="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<style type="text/css"> <style type="text/css">
body { body {
@ -148,8 +154,8 @@
<div id="sidebar"> <div id="sidebar">
<div class="list-group panel"> <div class="list-group panel">
{foreach name="docsList" id="docs"} {foreach name="docsList" id="docs"}
<a href="#{$key|md5|substr=0,8}" class="list-group-item" data-toggle="collapse" data-parent="#sidebar">{$key} <i class="fa fa-caret-down"></i></a> <a href="#{$key}" class="list-group-item" data-toggle="collapse" data-parent="#sidebar">{$key} <i class="fa fa-caret-down"></i></a>
<div class="child collapse" id="{$key|md5|substr=0,8}"> <div class="child collapse" id="{$key}">
{foreach name="docs" id="api" } {foreach name="docs" id="api" }
<a href="javascript:;" data-id="{$api.id}" class="list-group-item">{$api.title} <a href="javascript:;" data-id="{$api.id}" class="list-group-item">{$api.title}
<span class="tag"> <span class="tag">
@ -395,10 +401,10 @@
</div> <!-- /container --> </div> <!-- /container -->
<!-- jQuery --> <!-- jQuery -->
<script src="{$config.cdnurl|default=''}/assets/libs/jquery/dist/jquery.min.js"></script> <script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.6.0/jquery.min.js"></script>
<!-- Bootstrap Core JavaScript --> <!-- Bootstrap Core JavaScript -->
<script src="{$config.cdnurl|default=''}/assets/libs/bootstrap/dist/js/bootstrap.min.js"></script> <script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/twitter-bootstrap/3.4.1/js/bootstrap.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
function syntaxHighlight(json) { function syntaxHighlight(json) {

View File

@ -920,7 +920,6 @@ class Crud extends Command
$replace = '\'{"custom[type]":"' . $table . '"}\''; $replace = '\'{"custom[type]":"' . $table . '"}\'';
} elseif ($selectpageController == 'admin') { } elseif ($selectpageController == 'admin') {
$attrArr['data-source'] = 'auth/admin/selectpage'; $attrArr['data-source'] = 'auth/admin/selectpage';
$attrArr['data-field'] = 'nickname';
} elseif ($selectpageController == 'user') { } elseif ($selectpageController == 'user') {
$attrArr['data-source'] = 'user/user/index'; $attrArr['data-source'] = 'user/user/index';
$attrArr['data-field'] = 'nickname'; $attrArr['data-field'] = 'nickname';

View File

@ -1,7 +1,7 @@
public function {%methodName%}($value, $data) public function {%methodName%}($value, $data)
{ {
$value = $value ?: ($data['{%field%}'] ?? ''); $value = $value ? $value : (isset($data['{%field%}']) ? $data['{%field%}'] : '');
$valueArr = explode(',', $value); $valueArr = explode(',', $value);
$list = $this->{%listMethodName%}(); $list = $this->{%listMethodName%}();
return implode(',', array_intersect_key($list, array_flip($valueArr))); return implode(',', array_intersect_key($list, array_flip($valueArr)));

View File

@ -1,6 +1,6 @@
public function {%methodName%}($value, $data) public function {%methodName%}($value, $data)
{ {
$value = $value ?: ($data['{%field%}'] ?? ''); $value = $value ? $value : (isset($data['{%field%}']) ? $data['{%field%}'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
} }

View File

@ -1,7 +1,7 @@
public function {%methodName%}($value, $data) public function {%methodName%}($value, $data)
{ {
$value = $value ?: ($data['{%field%}'] ?? ''); $value = $value ? $value : (isset($data['{%field%}']) ? $data['{%field%}'] : '');
$list = $this->{%listMethodName%}(); $list = $this->{%listMethodName%}();
return $list[$value] ?? ''; return isset($list[$value]) ? $list[$value] : '';
} }

View File

@ -1,7 +1,7 @@
public function {%methodName%}($value, $data) public function {%methodName%}($value, $data)
{ {
$value = $value ?: ($data['{%field%}'] ?? ''); $value = $value ? $value : (isset($data['{%field%}']) ? $data['{%field%}'] : '');
$list = $this->{%listMethodName%}(); $list = $this->{%listMethodName%}();
return $list[$value] ?? ''; return isset($list[$value]) ? $list[$value] : '';
} }

View File

@ -17,13 +17,6 @@ use think\View;
class Install extends Command class Install extends Command
{ {
/**
* 最低PHP版本
* @var string
*/
protected $minPhpVersion = '7.4.0';
protected $model = null; protected $model = null;
/** /**
* @var \think\View 视图类实例 * @var \think\View 视图类实例
@ -77,7 +70,7 @@ class Install extends Command
$adminName = $this->installation($hostname, $hostport, $database, $username, $password, $prefix, $adminUsername, $adminPassword, $adminEmail, $siteName); $adminName = $this->installation($hostname, $hostport, $database, $username, $password, $prefix, $adminUsername, $adminPassword, $adminEmail, $siteName);
if ($adminName) { if ($adminName) {
$output->highlight("Admin url:https://www.example.com/{$adminName}"); $output->highlight("Admin url:http://www.example.com/{$adminName}");
} }
$output->highlight("Admin username:{$adminUsername}"); $output->highlight("Admin username:{$adminUsername}");
@ -214,27 +207,22 @@ class Install extends Command
$adminFile = ROOT_PATH . 'public' . DS . 'admin.php'; $adminFile = ROOT_PATH . 'public' . DS . 'admin.php';
// 数据库配置文件 // 数据库配置文件
$envSampleFile = ROOT_PATH . '.env.sample'; $dbConfigFile = APP_PATH . 'database.php';
$envFile = ROOT_PATH . '.env'; $dbConfigText = @file_get_contents($dbConfigFile);
if (!file_exists($envFile)) {
if (!copy($envSampleFile, $envFile)) {
throw new Exception(__('Failed to copy %s to %s', '.env.sample', '.env'));
}
}
$envText = @file_get_contents($envFile);
$callback = function ($matches) use ($mysqlHostname, $mysqlHostport, $mysqlUsername, $mysqlPassword, $mysqlDatabase, $mysqlPrefix) { $callback = function ($matches) use ($mysqlHostname, $mysqlHostport, $mysqlUsername, $mysqlPassword, $mysqlDatabase, $mysqlPrefix) {
$field = "mysql" . ucfirst($matches[1]); $field = "mysql" . ucfirst($matches[1]);
$replace = $$field; $replace = $$field;
return "{$matches[1]} = {$replace}"; if ($matches[1] == 'hostport' && $mysqlHostport == 3306) {
$replace = '';
}
return "'{$matches[1]}'{$matches[2]}=>{$matches[3]}Env::get('database.{$matches[1]}', '{$replace}'),";
}; };
$envText = preg_replace_callback("/(hostname|database|username|password|hostport|prefix)\s*=\s*(.*)/", $callback, $envText); $dbConfigText = preg_replace_callback("/'(hostname|database|username|password|hostport|prefix)'(\s+)=>(\s+)Env::get\((.*)\)\,/", $callback, $dbConfigText);
// 检测能否成功写入数据库配置 // 检测能否成功写入数据库配置
$result = @file_put_contents($envFile, $envText); $result = @file_put_contents($dbConfigFile, $dbConfigText);
if (!$result) { if (!$result) {
throw new Exception(__('The current permissions are insufficient to write the file %s', '.env')); throw new Exception(__('The current permissions are insufficient to write the file %s', 'application/database.php'));
} }
// 设置新的Token随机密钥key // 设置新的Token随机密钥key
@ -249,7 +237,7 @@ class Install extends Command
throw new Exception(__('The current permissions are insufficient to write the file %s', 'application/config.php')); throw new Exception(__('The current permissions are insufficient to write the file %s', 'application/config.php'));
} }
$avatar = '/assets/img/avatar.png'; $avatar = request()->domain() . '/assets/img/avatar.png';
// 变更默认管理员密码 // 变更默认管理员密码
$adminPassword = $adminPassword ? $adminPassword : Random::alnum(8); $adminPassword = $adminPassword ? $adminPassword : Random::alnum(8);
$adminEmail = $adminEmail ? $adminEmail : "admin@admin.com"; $adminEmail = $adminEmail ? $adminEmail : "admin@admin.com";
@ -321,8 +309,8 @@ class Install extends Command
//数据库配置文件 //数据库配置文件
$dbConfigFile = APP_PATH . 'database.php'; $dbConfigFile = APP_PATH . 'database.php';
if (version_compare(PHP_VERSION, $this->minPhpVersion, '<')) { if (version_compare(PHP_VERSION, '7.4.0', '<')) {
throw new Exception(__("The current PHP %s is too low, please use PHP %s or higher", PHP_VERSION, $this->minPhpVersion)); throw new Exception(__("The current version %s is too low, please use PHP 7.4 or higher", PHP_VERSION));
} }
if (!extension_loaded("PDO")) { if (!extension_loaded("PDO")) {
throw new Exception(__("PDO is not currently installed and cannot be installed")); throw new Exception(__("PDO is not currently installed and cannot be installed"));

View File

@ -27,7 +27,7 @@ return [
'Password is too weak' => '密码太简单,请重新输入', 'Password is too weak' => '密码太简单,请重新输入',
'The two passwords you entered did not match' => '两次输入的密码不一致', 'The two passwords you entered did not match' => '两次输入的密码不一致',
'Please input correct website' => '网站名称输入不正确', 'Please input correct website' => '网站名称输入不正确',
'The current PHP %s is too low, please use PHP %s or higher' => '当前版本PHP %s过低请使用PHP %s及以上版本', 'The current version %s is too low, please use PHP 7.4 or higher' => '当前版本%s过低请使用PHP7.4及以上版本',
'PDO is not currently installed and cannot be installed' => '当前未开启PDO无法进行安装', 'PDO is not currently installed and cannot be installed' => '当前未开启PDO无法进行安装',
'The current permissions are insufficient to write the file %s' => '当前权限不足,无法写入文件%s', 'The current permissions are insufficient to write the file %s' => '当前权限不足,无法写入文件%s',
'Please go to the official website to download the full package or resource package and try to install' => '当前代码仅包含核心代码,请前往官网下载完整包或资源包覆盖后再尝试安装', 'Please go to the official website to download the full package or resource package and try to install' => '当前代码仅包含核心代码,请前往官网下载完整包或资源包覆盖后再尝试安装',

File diff suppressed because one or more lines are too long

View File

@ -21,6 +21,7 @@ use think\Validate;
*/ */
class Ajax extends Backend class Ajax extends Backend
{ {
protected $noNeedLogin = ['lang']; protected $noNeedLogin = ['lang'];
protected $noNeedRight = ['*']; protected $noNeedRight = ['*'];
protected $layout = ''; protected $layout = '';
@ -174,18 +175,18 @@ class Ajax extends Backend
$weighdata[$v[$prikey]] = $v[$field]; $weighdata[$v[$prikey]] = $v[$field];
} }
$position = array_search($changeid, $ids); $position = array_search($changeid, $ids);
$desc_id = $sour[$position] ?? end($sour); //移动到目标的ID值,取出所处改变前位置的值 $desc_id = isset($sour[$position]) ? $sour[$position] : end($sour); //移动到目标的ID值,取出所处改变前位置的值
$sour_id = $changeid; $sour_id = $changeid;
$weighids = []; $weighids = array();
$temp = array_values(array_diff_assoc($ids, $sour)); $temp = array_values(array_diff_assoc($ids, $sour));
foreach ($temp as $m => $n) { foreach ($temp as $m => $n) {
if ($n == $sour_id) { if ($n == $sour_id) {
$offset = $desc_id; $offset = $desc_id;
} else { } else {
if ($sour_id == $temp[0]) { if ($sour_id == $temp[0]) {
$offset = $temp[$m + 1] ?? $sour_id; $offset = isset($temp[$m + 1]) ? $temp[$m + 1] : $sour_id;
} else { } else {
$offset = $temp[$m - 1] ?? $sour_id; $offset = isset($temp[$m - 1]) ? $temp[$m - 1] : $sour_id;
} }
} }
if (!isset($weighdata[$offset])) { if (!isset($weighdata[$offset])) {
@ -206,6 +207,7 @@ class Ajax extends Backend
$type = $this->request->request("type"); $type = $this->request->request("type");
switch ($type) { switch ($type) {
case 'all': case 'all':
// no break
case 'content': case 'content':
//内容缓存 //内容缓存
rmdirs(CACHE_PATH, false); rmdirs(CACHE_PATH, false);
@ -213,21 +215,18 @@ class Ajax extends Backend
if ($type == 'content') { if ($type == 'content') {
break; break;
} }
// no break
case 'template': case 'template':
// 模板缓存 // 模板缓存
rmdirs(TEMP_PATH, false); rmdirs(TEMP_PATH, false);
if ($type == 'template') { if ($type == 'template') {
break; break;
} }
// no break
case 'addons': case 'addons':
// 插件缓存 // 插件缓存
Service::refresh(); Service::refresh();
if ($type == 'addons') { if ($type == 'addons') {
break; break;
} }
// no break
case 'browser': case 'browser':
// 浏览器缓存 // 浏览器缓存
// 只有生产环境下才修改 // 只有生产环境下才修改
@ -324,4 +323,5 @@ class Ajax extends Backend
$response = Response::create($data, '', 200, $header); $response = Response::create($data, '', 200, $header);
return $response; return $response;
} }
} }

View File

@ -18,13 +18,21 @@ class Adminlog extends Backend
* @var \app\admin\model\AdminLog * @var \app\admin\model\AdminLog
*/ */
protected $model = null; protected $model = null;
protected $childrenGroupIds = [];
protected $childrenAdminIds = []; protected $childrenAdminIds = [];
public function _initialize() public function _initialize()
{ {
parent::_initialize(); parent::_initialize();
$this->model = model('AdminLog'); $this->model = model('AdminLog');
$this->childrenAdminIds = $this->auth->getChildrenAdminIds(true); $this->childrenAdminIds = $this->auth->getChildrenAdminIds(true);
$this->childrenGroupIds = $this->auth->getChildrenGroupIds(true);
$groupName = AuthGroup::where('id', 'in', $this->childrenGroupIds)
->column('id,name');
$this->view->assign('groupdata', $groupName);
} }
/** /**

View File

@ -82,6 +82,7 @@ class Rule extends Backend
if ($result === false) { if ($result === false) {
$this->error($this->model->getError()); $this->error($this->model->getError());
} }
Cache::rm('__menu__');
$this->success(); $this->success();
} }
$this->error(); $this->error();
@ -123,6 +124,7 @@ class Rule extends Backend
if ($result === false) { if ($result === false) {
$this->error($row->getError()); $this->error($row->getError());
} }
Cache::rm('__menu__');
$this->success(); $this->success();
} }
$this->error(); $this->error();

View File

@ -7,7 +7,6 @@ return [
'Mobile' => '手机', 'Mobile' => '手机',
'Email' => '邮箱', 'Email' => '邮箱',
'Password' => '密码', 'Password' => '密码',
'Mobile' => '手机号',
'Sign up' => '注 册', 'Sign up' => '注 册',
'Sign in' => '登 录', 'Sign in' => '登 录',
'Sign out' => '退 出', 'Sign out' => '退 出',

View File

@ -30,7 +30,6 @@ return [
'You\'ve logged in, do not login again' => '你已经登录,无需重复登录', 'You\'ve logged in, do not login again' => '你已经登录,无需重复登录',
'Username or password can not be empty' => '用户名密码不能为空', 'Username or password can not be empty' => '用户名密码不能为空',
'Username or password is incorrect' => '用户名或密码不正确', 'Username or password is incorrect' => '用户名或密码不正确',
'Username must be 3 to 30 characters' => '用户名只能由3-30位数字、字母、下划线组合',
'Username is incorrect' => '用户名不正确', 'Username is incorrect' => '用户名不正确',
'Password is incorrect' => '密码不正确', 'Password is incorrect' => '密码不正确',
'Admin is forbidden' => '管理员已经被禁止登录', 'Admin is forbidden' => '管理员已经被禁止登录',

View File

@ -327,7 +327,10 @@ class Auth extends \fast\Auth
{ {
//取出当前管理员所有的分组 //取出当前管理员所有的分组
$groups = $this->getGroups(); $groups = $this->getGroups();
$groupIds = array_column($groups, 'id'); $groupIds = [];
foreach ($groups as $k => $v) {
$groupIds[] = $v['id'];
}
$originGroupIds = $groupIds; $originGroupIds = $groupIds;
foreach ($groups as $k => $v) { foreach ($groups as $k => $v) {
if (in_array($v['pid'], $originGroupIds)) { if (in_array($v['pid'], $originGroupIds)) {
@ -368,8 +371,12 @@ class Auth extends \fast\Auth
$childrenAdminIds = []; $childrenAdminIds = [];
if (!$this->isSuperAdmin()) { if (!$this->isSuperAdmin()) {
$groupIds = $this->getChildrenGroupIds(false); $groupIds = $this->getChildrenGroupIds(false);
$childrenAdminIds = \app\admin\model\AuthGroupAccess::where('group_id', 'in', $groupIds) $authGroupList = \app\admin\model\AuthGroupAccess::field('uid,group_id')
->column('uid'); ->where('group_id', 'in', $groupIds)
->select();
foreach ($authGroupList as $k => $v) {
$childrenAdminIds[] = $v['uid'];
}
} else { } else {
//超级管理员拥有所有人的权限 //超级管理员拥有所有人的权限
$childrenAdminIds = Admin::column('id'); $childrenAdminIds = Admin::column('id');

View File

@ -2,9 +2,9 @@
{if $addon.tips && $addon.tips.value} {if $addon.tips && $addon.tips.value}
<div class="alert {$addon.tips.extend|default='alert-info-light'}" style="margin-bottom:10px;"> <div class="alert {$addon.tips.extend|default='alert-info-light'}" style="margin-bottom:10px;">
{if $addon.tips.title} {if $addon.tips.title}
<b>{$addon.tips.title|htmlentities}</b><br> <b>{$addon.tips.title}</b><br>
{/if} {/if}
{$addon.tips.value|htmlentities} {$addon.tips.value}
</div> </div>
{/if} {/if}
@ -14,7 +14,7 @@
<ul class="nav nav-tabs nav-group"> <ul class="nav nav-tabs nav-group">
<li class="active"><a href="#all" data-toggle="tab">全部</a></li> <li class="active"><a href="#all" data-toggle="tab">全部</a></li>
{foreach name="groupList" id="tab"} {foreach name="groupList" id="tab"}
<li><a href="#tab-{$key|htmlentities}" title="{$tab|htmlentities}" data-toggle="tab">{$tab|htmlentities}</a></li> <li><a href="#tab-{$key}" title="{$tab}" data-toggle="tab">{$tab}</a></li>
{/foreach} {/foreach}
</ul> </ul>
</div> </div>
@ -23,99 +23,99 @@
<div class="panel-body no-padding"> <div class="panel-body no-padding">
<div id="myTabContent" class="tab-content"> <div id="myTabContent" class="tab-content">
{foreach name="groupList" id="group" key="groupName"} {foreach name="groupList" id="group" key="groupName"}
<div class="tab-pane fade active in" id="tab-{$groupName|htmlentities}"> <div class="tab-pane fade active in" id="tab-{$groupName}">
<table class="table table-striped table-config mb-0"> <table class="table table-striped table-config mb-0">
<tbody> <tbody>
{foreach name="$addon.config" id="item"} {foreach name="$addon.config" id="item"}
{if ((!isset($item['group']) || $item['group']=='') && $groupName=='other') || (isset($item['group']) && $item['group']==$group)} {if ((!isset($item['group']) || $item['group']=='') && $groupName=='other') || (isset($item['group']) && $item['group']==$group)}
<tr data-favisible="{$item.visible|default=''|htmlentities}" data-name="{$item.name|htmlentities}" class="{if $item.visible??''}hidden{/if}"> <tr data-favisible="{$item.visible|default=''|htmlentities}" data-name="{$item.name}" class="{if $item.visible??''}hidden{/if}">
<td width="15%">{$item.title|htmlentities}</td> <td width="15%">{$item.title}</td>
<td> <td>
<div class="row"> <div class="row">
<div class="col-sm-8 col-xs-12"> <div class="col-sm-8 col-xs-12">
{switch $item.type} {switch $item.type}
{case string} {case string}
<input {$item.extend} type="text" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control" data-rule="{$item.rule|htmlentities}" data-tip="{$item.tip|htmlentities}"/> <input {$item.extend} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control" data-rule="{$item.rule}" data-tip="{$item.tip}"/>
{/case} {/case}
{case password} {case password}
<input {$item.extend} type="password" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control" data-rule="{$item.rule|htmlentities}" data-tip="{$item.tip|htmlentities}"/> <input {$item.extend} type="password" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control" data-rule="{$item.rule}" data-tip="{$item.tip}"/>
{/case} {/case}
{case text} {case text}
<textarea {$item.extend} name="row[{$item.name|htmlentities}]" class="form-control" data-rule="{$item.rule|htmlentities}" rows="5" data-tip="{$item.tip|htmlentities}">{$item.value|htmlentities}</textarea> <textarea {$item.extend} name="row[{$item.name}]" class="form-control" data-rule="{$item.rule}" rows="5" data-tip="{$item.tip}">{$item.value|htmlentities}</textarea>
{/case} {/case}
{case array} {case array}
<dl class="fieldlist" data-name="row[{$item.name|htmlentities}]"> <dl class="fieldlist" data-name="row[{$item.name}]">
<dd> <dd>
<ins>{:__('Array key')}</ins> <ins>{:__('Array key')}</ins>
<ins>{:__('Array value')}</ins> <ins>{:__('Array value')}</ins>
</dd> </dd>
<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd> <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
<textarea name="row[{$item.name|htmlentities}]" cols="30" rows="5" class="hide">{$item.value|json_encode|htmlentities}</textarea> <textarea name="row[{$item.name}]" cols="30" rows="5" class="hide">{$item.value|json_encode|htmlentities}</textarea>
</dl> </dl>
{/case} {/case}
{case date} {case date}
<input {$item.extend} type="text" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-tip="{$item.tip|htmlentities}" data-rule="{$item.rule|htmlentities}"/> <input {$item.extend} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
{/case} {/case}
{case time} {case time}
<input {$item.extend} type="text" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="HH:mm:ss" data-tip="{$item.tip|htmlentities}" data-rule="{$item.rule|htmlentities}"/> <input {$item.extend} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="HH:mm:ss" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
{/case} {/case}
{case datetime} {case datetime}
<input {$item.extend} type="text" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-tip="{$item.tip|htmlentities}" data-rule="{$item.rule|htmlentities}"/> <input {$item.extend} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
{/case} {/case}
{case number} {case number}
<input {$item.extend} type="number" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control" data-tip="{$item.tip|htmlentities}" data-rule="{$item.rule|htmlentities}"/> <input {$item.extend} type="number" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
{/case} {/case}
{case checkbox} {case checkbox}
{foreach name="item.content" item="vo"} {foreach name="item.content" item="vo"}
<label for="row[{$item.name|htmlentities}][]-{$key|htmlentities}"><input id="row[{$item.name|htmlentities}][]-{$key|htmlentities}" name="row[{$item.name|htmlentities}][]" type="checkbox" value="{$key|htmlentities}" data-tip="{$item.tip|htmlentities}" {in name="key" value="$item.value" }checked{/in} /> {$vo|htmlentities}</label> <label for="row[{$item.name}][]-{$key}"><input id="row[{$item.name}][]-{$key}" name="row[{$item.name}][]" type="checkbox" value="{$key}" data-tip="{$item.tip}" {in name="key" value="$item.value" }checked{/in} /> {$vo}</label>
{/foreach} {/foreach}
<span class="msg-box n-right" for="row[{$item.name|htmlentities}]"></span> <span class="msg-box n-right" for="row[{$item.name}]"></span>
{/case} {/case}
{case radio} {case radio}
{foreach name="item.content" item="vo"} {foreach name="item.content" item="vo"}
<label for="row[{$item.name|htmlentities}]-{$key|htmlentities}"><input id="row[{$item.name|htmlentities}]-{$key|htmlentities}" name="row[{$item.name|htmlentities}]" type="radio" value="{$key|htmlentities}" data-tip="{$item.tip|htmlentities}" {in name="key" value="$item.value" }checked{/in} /> {$vo|htmlentities}</label> <label for="row[{$item.name}]-{$key}"><input id="row[{$item.name}]-{$key}" name="row[{$item.name}]" type="radio" value="{$key}" data-tip="{$item.tip}" {in name="key" value="$item.value" }checked{/in} /> {$vo}</label>
{/foreach} {/foreach}
<span class="msg-box n-right" for="row[{$item.name|htmlentities}]"></span> <span class="msg-box n-right" for="row[{$item.name}]"></span>
{/case} {/case}
{case value="select" break="0"}{/case} {case value="select" break="0"}{/case}
{case value="selects"} {case value="selects"}
<select {$item.extend} name="row[{$item.name|htmlentities}]{$item.type=='selects'?'[]':''}" class="form-control selectpicker" data-tip="{$item.tip|htmlentities}" {$item.type=='selects'?'multiple':''}> <select {$item.extend} name="row[{$item.name}]{$item.type=='selects'?'[]':''}" class="form-control selectpicker" data-tip="{$item.tip}" {$item.type=='selects'?'multiple':''}>
{foreach name="item.content" item="vo"} {foreach name="item.content" item="vo"}
<option value="{$key|htmlentities}" {in name="key" value="$item.value" }selected{/in}>{$vo|htmlentities}</option> <option value="{$key}" {in name="key" value="$item.value" }selected{/in}>{$vo}</option>
{/foreach} {/foreach}
</select> </select>
{/case} {/case}
{case value="image" break="0"}{/case} {case value="image" break="0"}{/case}
{case value="images"} {case value="images"}
<div class="form-inline"> <div class="form-inline">
<input id="c-{$item.name|htmlentities}" class="form-control" size="28" name="row[{$item.name|htmlentities}]" type="text" value="{$item.value|htmlentities}" data-tip="{$item.tip|htmlentities}"> <input id="c-{$item.name}" class="form-control" size="28" name="row[{$item.name}]" type="text" value="{$item.value|htmlentities}" data-tip="{$item.tip}">
<span><button type="button" id="plupload-{$item.name|htmlentities}" class="btn btn-danger plupload" data-input-id="c-{$item.name|htmlentities}" data-mimetype="image/*" data-multiple="{$item.type=='image'?'false':'true'}" data-preview-id="p-{$item.name|htmlentities}"><i class="fa fa-upload"></i> {:__('Upload')}</button></span> <span><button type="button" id="plupload-{$item.name}" class="btn btn-danger plupload" data-input-id="c-{$item.name}" data-mimetype="image/*" data-multiple="{$item.type=='image'?'false':'true'}" data-preview-id="p-{$item.name}"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-{$item.name|htmlentities}" class="btn btn-primary fachoose" data-input-id="c-{$item.name|htmlentities}" data-mimetype="image/*" data-multiple="{$item.type=='image'?'false':'true'}"><i class="fa fa-list"></i> {:__('Choose')}</button></span> <span><button type="button" id="fachoose-{$item.name}" class="btn btn-primary fachoose" data-input-id="c-{$item.name}" data-mimetype="image/*" data-multiple="{$item.type=='image'?'false':'true'}"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
<ul class="row list-inline plupload-preview" id="p-{$item.name|htmlentities}"></ul> <ul class="row list-inline plupload-preview" id="p-{$item.name}"></ul>
<span class="msg-box n-right" for="c-{$item.name|htmlentities}"></span> <span class="msg-box n-right" for="c-{$item.name}"></span>
</div> </div>
{/case} {/case}
{case value="file" break="0"}{/case} {case value="file" break="0"}{/case}
{case value="files"} {case value="files"}
<div class="form-inline"> <div class="form-inline">
<input id="c-{$item.name|htmlentities}" class="form-control" size="28" name="row[{$item.name|htmlentities}]" type="text" value="{$item.value|htmlentities}" data-tip="{$item.tip|htmlentities}"> <input id="c-{$item.name}" class="form-control" size="28" name="row[{$item.name}]" type="text" value="{$item.value|htmlentities}" data-tip="{$item.tip}">
<span><button type="button" id="plupload-{$item.name|htmlentities}" class="btn btn-danger plupload" data-input-id="c-{$item.name|htmlentities}" data-multiple="{$item.type=='file'?'false':'true'}"><i class="fa fa-upload"></i> {:__('Upload')}</button></span> <span><button type="button" id="plupload-{$item.name}" class="btn btn-danger plupload" data-input-id="c-{$item.name}" data-multiple="{$item.type=='file'?'false':'true'}"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-{$item.name|htmlentities}" class="btn btn-primary fachoose" data-input-id="c-{$item.name|htmlentities}" data-multiple="{$item.type=='file'?'false':'true'}"><i class="fa fa-list"></i> {:__('Choose')}</button></span> <span><button type="button" id="fachoose-{$item.name}" class="btn btn-primary fachoose" data-input-id="c-{$item.name}" data-multiple="{$item.type=='file'?'false':'true'}"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
<span class="msg-box n-right" for="c-{$item.name|htmlentities}"></span> <span class="msg-box n-right" for="c-{$item.name}"></span>
</div> </div>
{/case} {/case}
{case switch} {case switch}
<input id="c-{$item.name|htmlentities}" name="row[{$item.name|htmlentities}]" type="hidden" value="{:$item.value?1:0}"> <input id="c-{$item.name}" name="row[{$item.name}]" type="hidden" value="{:$item.value?1:0}">
<a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-{$item.name|htmlentities}" data-yes="1" data-no="0"> <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-{$item.name}" data-yes="1" data-no="0">
<i class="fa fa-toggle-on text-success {if !$item.value}fa-flip-horizontal text-gray{/if} fa-2x"></i> <i class="fa fa-toggle-on text-success {if !$item.value}fa-flip-horizontal text-gray{/if} fa-2x"></i>
</a> </a>
{/case} {/case}
{case bool} {case bool}
<label for="row[{$item.name|htmlentities}]-yes"><input id="row[{$item.name|htmlentities}]-yes" name="row[{$item.name|htmlentities}]" type="radio" value="1" {$item.value?'checked':''} data-tip="{$item.tip|htmlentities}" /> {:__('Yes')}</label> <label for="row[{$item.name}]-yes"><input id="row[{$item.name}]-yes" name="row[{$item.name}]" type="radio" value="1" {$item.value?'checked':''} data-tip="{$item.tip}" /> {:__('Yes')}</label>
<label for="row[{$item.name|htmlentities}]-no"><input id="row[{$item.name|htmlentities}]-no" name="row[{$item.name|htmlentities}]" type="radio" value="0" {$item.value?'':'checked'} data-tip="{$item.tip|htmlentities}" /> {:__('No')}</label> <label for="row[{$item.name}]-no"><input id="row[{$item.name}]-no" name="row[{$item.name}]" type="radio" value="0" {$item.value?'':'checked'} data-tip="{$item.tip}" /> {:__('No')}</label>
{/case} {/case}
{default /}{$item.value|htmlentities} {default /}{$item.value}
{/switch} {/switch}
</div> </div>
<div class="col-sm-4"></div> <div class="col-sm-4"></div>

View File

@ -136,7 +136,7 @@
<div class="form-group"> <div class="form-group">
<label class="control-label">{:__('Version')}</label> <label class="control-label">{:__('Version')}</label>
<input type="hidden" class="operate" data-name="faversion" value="="/> <input type="hidden" class="operate" data-name="faversion" value="="/>
<input class="form-control" name="faversion" type="text" value="{$Think.config.fastadmin.version|htmlentities}"> <input class="form-control" name="faversion" type="text" value="{$Think.config.fastadmin.version}">
</div> </div>
</div> </div>
<div class="col-xs-12 col-sm-6 col-md-3"> <div class="col-xs-12 col-sm-6 col-md-3">

View File

@ -10,7 +10,7 @@
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]"> <select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
{foreach name="typeList" item="vo"} {foreach name="typeList" item="vo"}
<option value="{$key|htmlentities}" {in name="key" value=""}selected{/in}>{$vo|htmlentities}</option> <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
{/foreach} {/foreach}
</select> </select>
@ -22,7 +22,7 @@
<select id="c-pid" data-rule="required" class="form-control selectpicker" name="row[pid]"> <select id="c-pid" data-rule="required" class="form-control selectpicker" name="row[pid]">
{foreach name="parentList" item="vo"} {foreach name="parentList" item="vo"}
<option data-type="{$vo.type|htmlentities}" value="{$key|htmlentities}" {in name="key" value=""}selected{/in}>{$vo.name|htmlentities}</option> <option data-type="{$vo.type}" value="{$key}" {in name="key" value=""}selected{/in}>{$vo.name}</option>
{/foreach} {/foreach}
</select> </select>
@ -46,7 +46,7 @@
<select id="c-flag" class="form-control selectpicker" multiple="" name="row[flag][]"> <select id="c-flag" class="form-control selectpicker" multiple="" name="row[flag][]">
{foreach name="flagList" item="vo"} {foreach name="flagList" item="vo"}
<option value="{$key|htmlentities}" {in name="key" value=""}selected{/in}>{$vo|htmlentities}</option> <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
{/foreach} {/foreach}
</select> </select>

View File

@ -6,7 +6,7 @@
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]"> <select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
{foreach name="typeList" item="vo"} {foreach name="typeList" item="vo"}
<option value="{$key|htmlentities}" {in name="key" value="$row.type"}selected{/in}>{$vo|htmlentities}</option> <option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
{/foreach} {/foreach}
</select> </select>
@ -18,7 +18,7 @@
<select id="c-pid" data-rule="required" class="form-control selectpicker" name="row[pid]"> <select id="c-pid" data-rule="required" class="form-control selectpicker" name="row[pid]">
{foreach name="parentList" item="vo"} {foreach name="parentList" item="vo"}
<option data-type="{$vo.type|htmlentities}" class="{:$vo.type==$row.type||$vo.type=='all'?'':'hide'}" value="{$key|htmlentities}" {in name="key" value="$row.pid"}selected{/in}>{$vo.name|htmlentities}</option> <option data-type="{$vo.type}" class="{:$vo.type==$row.type||$vo.type=='all'?'':'hide'}" value="{$key}" {in name="key" value="$row.pid"}selected{/in}>{$vo.name}</option>
{/foreach} {/foreach}
</select> </select>
@ -42,7 +42,7 @@
<select id="c-flag" class="form-control selectpicker" multiple="" name="row[flag][]"> <select id="c-flag" class="form-control selectpicker" multiple="" name="row[flag][]">
{foreach name="flagList" item="vo"} {foreach name="flagList" item="vo"}
<option value="{$key|htmlentities}" {in name="key" value="$row.flag"}selected{/in}>{$vo|htmlentities}</option> <option value="{$key}" {in name="key" value="$row.flag"}selected{/in}>{$vo}</option>
{/foreach} {/foreach}
</select> </select>

View File

@ -4,7 +4,7 @@
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="active"><a href="#all" data-toggle="tab">{:__('All')}</a></li> <li class="active"><a href="#all" data-toggle="tab">{:__('All')}</a></li>
{foreach name="typeList" item="vo"} {foreach name="typeList" item="vo"}
<li><a href="#{$key|htmlentities}" data-toggle="tab">{$vo|htmlentities}</a></li> <li><a href="#{$key}" data-toggle="tab">{$vo}</a></li>
{/foreach} {/foreach}
</ul> </ul>

View File

@ -117,10 +117,10 @@
<div id="secondnav"> <div id="secondnav">
<ul class="nav nav-tabs nav-addtabs disable-top-badge" role="tablist"> <ul class="nav nav-tabs nav-addtabs disable-top-badge" role="tablist">
{if $fixedmenu} {if $fixedmenu}
<li role="presentation" id="tab_{$fixedmenu.id|htmlentities}" class="{:$referermenu?'':'active'}"><a href="#con_{$fixedmenu.id|htmlentities}" node-id="{$fixedmenu.id|htmlentities}" aria-controls="{$fixedmenu.id|htmlentities}" role="tab" data-toggle="tab"><i class="fa fa-dashboard fa-fw"></i> <span>{$fixedmenu.title|htmlentities}</span> <span class="pull-right-container"> </span></a></li> <li role="presentation" id="tab_{$fixedmenu.id}" class="{:$referermenu?'':'active'}"><a href="#con_{$fixedmenu.id}" node-id="{$fixedmenu.id}" aria-controls="{$fixedmenu.id}" role="tab" data-toggle="tab"><i class="fa fa-dashboard fa-fw"></i> <span>{$fixedmenu.title}</span> <span class="pull-right-container"> </span></a></li>
{/if} {/if}
{if $referermenu} {if $referermenu}
<li role="presentation" id="tab_{$referermenu.id|htmlentities}" class="active"><a href="#con_{$referermenu.id|htmlentities}" node-id="{$referermenu.id|htmlentities}" aria-controls="{$referermenu.id|htmlentities}" role="tab" data-toggle="tab"><i class="fa fa-list fa-fw"></i> <span>{$referermenu.title|htmlentities}</span> <span class="pull-right-container"> </span></a> <i class="close-tab fa fa-remove"></i></li> <li role="presentation" id="tab_{$referermenu.id}" class="active"><a href="#con_{$referermenu.id}" node-id="{$referermenu.id}" aria-controls="{$referermenu.id}" role="tab" data-toggle="tab"><i class="fa fa-list fa-fw"></i> <span>{$referermenu.title}</span> <span class="pull-right-container"> </span></a> <i class="close-tab fa fa-remove"></i></li>
{/if} {/if}
</ul> </ul>
</div> </div>

View File

@ -7,10 +7,10 @@
<link rel="shortcut icon" href="__CDN__/assets/img/favicon.ico" /> <link rel="shortcut icon" href="__CDN__/assets/img/favicon.ico" />
<!-- Loading Bootstrap --> <!-- Loading Bootstrap -->
<link href="__CDN__/assets/css/backend{$Think.config.app_debug?'':'.min'}.css?v={$Think.config.site.version|htmlentities}" rel="stylesheet"> <link href="__CDN__/assets/css/backend{$Think.config.app_debug?'':'.min'}.css?v={$Think.config.site.version}" rel="stylesheet">
{if $Think.config.fastadmin.adminskin} {if $Think.config.fastadmin.adminskin}
<link href="__CDN__/assets/css/skins/{$Think.config.fastadmin.adminskin|htmlentities}.css?v={$Think.config.site.version|htmlentities}" rel="stylesheet"> <link href="__CDN__/assets/css/skins/{$Think.config.fastadmin.adminskin}.css?v={$Think.config.site.version}" rel="stylesheet">
{/if} {/if}
<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. --> <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->

View File

@ -1 +1 @@
<script src="__CDN__/assets/js/require.min.js" data-main="__CDN__/assets/js/require-backend{$Think.config.app_debug?'':'.min'}.js?v={$site.version|htmlentities}"></script> <script src="__CDN__/assets/js/require{$Think.config.app_debug?'':'.min'}.js" data-main="__CDN__/assets/js/require-backend{$Think.config.app_debug?'':'.min'}.js?v={$site.version|htmlentities}"></script>

View File

@ -176,7 +176,7 @@
<div class="sm-st clearfix"> <div class="sm-st clearfix">
<span class="sm-st-icon st-red"><i class="fa fa-users"></i></span> <span class="sm-st-icon st-red"><i class="fa fa-users"></i></span>
<div class="sm-st-info"> <div class="sm-st-info">
<span>{$totaluser|htmlentities}</span> <span>{$totaluser}</span>
{:__('Total user')} {:__('Total user')}
</div> </div>
</div> </div>
@ -185,7 +185,7 @@
<div class="sm-st clearfix"> <div class="sm-st clearfix">
<span class="sm-st-icon st-violet"><i class="fa fa-magic"></i></span> <span class="sm-st-icon st-violet"><i class="fa fa-magic"></i></span>
<div class="sm-st-info"> <div class="sm-st-info">
<span>{$totaladdon|htmlentities}</span> <span>{$totaladdon}</span>
{:__('Total addon')} {:__('Total addon')}
</div> </div>
</div> </div>
@ -194,7 +194,7 @@
<div class="sm-st clearfix"> <div class="sm-st clearfix">
<span class="sm-st-icon st-blue"><i class="fa fa-leaf"></i></span> <span class="sm-st-icon st-blue"><i class="fa fa-leaf"></i></span>
<div class="sm-st-info"> <div class="sm-st-info">
<span>{$attachmentnums|htmlentities}</span> <span>{$attachmentnums}</span>
{:__('Total attachment')} {:__('Total attachment')}
</div> </div>
</div> </div>
@ -203,7 +203,7 @@
<div class="sm-st clearfix"> <div class="sm-st clearfix">
<span class="sm-st-icon st-green"><i class="fa fa-user"></i></span> <span class="sm-st-icon st-green"><i class="fa fa-user"></i></span>
<div class="sm-st-info"> <div class="sm-st-info">
<span>{$totaladmin|htmlentities}</span> <span>{$totaladmin}</span>
{:__('Total admin')} {:__('Total admin')}
</div> </div>
</div> </div>
@ -221,7 +221,7 @@
<div class="col-xs-6 stat-col"> <div class="col-xs-6 stat-col">
<div class="stat-icon"><i class="fa fa-rocket"></i></div> <div class="stat-icon"><i class="fa fa-rocket"></i></div>
<div class="stat"> <div class="stat">
<div class="value"> {$todayusersignup|htmlentities}</div> <div class="value"> {$todayusersignup}</div>
<div class="name"> {:__('Today user signup')}</div> <div class="name"> {:__('Today user signup')}</div>
</div> </div>
<div class="progress"> <div class="progress">
@ -231,7 +231,7 @@
<div class="col-xs-6 stat-col"> <div class="col-xs-6 stat-col">
<div class="stat-icon"><i class="fa fa-vcard"></i></div> <div class="stat-icon"><i class="fa fa-vcard"></i></div>
<div class="stat"> <div class="stat">
<div class="value"> {$todayuserlogin|htmlentities}</div> <div class="value"> {$todayuserlogin}</div>
<div class="name"> {:__('Today user login')}</div> <div class="name"> {:__('Today user login')}</div>
</div> </div>
<div class="progress"> <div class="progress">
@ -241,7 +241,7 @@
<div class="col-xs-6 stat-col"> <div class="col-xs-6 stat-col">
<div class="stat-icon"><i class="fa fa-calendar"></i></div> <div class="stat-icon"><i class="fa fa-calendar"></i></div>
<div class="stat"> <div class="stat">
<div class="value"> {$threednu|htmlentities}</div> <div class="value"> {$threednu}</div>
<div class="name"> {:__('Three dnu')}</div> <div class="name"> {:__('Three dnu')}</div>
</div> </div>
<div class="progress"> <div class="progress">
@ -251,7 +251,7 @@
<div class="col-xs-6 stat-col"> <div class="col-xs-6 stat-col">
<div class="stat-icon"><i class="fa fa-calendar-plus-o"></i></div> <div class="stat-icon"><i class="fa fa-calendar-plus-o"></i></div>
<div class="stat"> <div class="stat">
<div class="value"> {$sevendnu|htmlentities}</div> <div class="value"> {$sevendnu}</div>
<div class="name"> {:__('Seven dnu')}</div> <div class="name"> {:__('Seven dnu')}</div>
</div> </div>
<div class="progress"> <div class="progress">
@ -261,7 +261,7 @@
<div class="col-xs-6 stat-col"> <div class="col-xs-6 stat-col">
<div class="stat-icon"><i class="fa fa-user-circle"></i></div> <div class="stat-icon"><i class="fa fa-user-circle"></i></div>
<div class="stat"> <div class="stat">
<div class="value"> {$sevendau|htmlentities}</div> <div class="value"> {$sevendau}</div>
<div class="name"> {:__('Seven dau')}</div> <div class="name"> {:__('Seven dau')}</div>
</div> </div>
<div class="progress"> <div class="progress">
@ -271,7 +271,7 @@
<div class="col-xs-6 stat-col"> <div class="col-xs-6 stat-col">
<div class="stat-icon"><i class="fa fa-user-circle-o"></i></div> <div class="stat-icon"><i class="fa fa-user-circle-o"></i></div>
<div class="stat"> <div class="stat">
<div class="value"> {$thirtydau|htmlentities}</div> <div class="value"> {$thirtydau}</div>
<div class="name"> {:__('Thirty dau')}</div> <div class="name"> {:__('Thirty dau')}</div>
</div> </div>
<div class="progress"> <div class="progress">
@ -298,7 +298,7 @@
<div class="panel-content"> <div class="panel-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<h1 class="no-margins">{$totalworkingaddon|htmlentities}</h1> <h1 class="no-margins">{$totalworkingaddon}</h1>
<div class="font-bold"><i class="fa fa-magic"></i> <div class="font-bold"><i class="fa fa-magic"></i>
<small>{:__('Working addon count tips')}</small> <small>{:__('Working addon count tips')}</small>
</div> </div>
@ -318,7 +318,7 @@
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h1 class="no-margins">{$dbtablenums|htmlentities}</h1> <h1 class="no-margins">{$dbtablenums}</h1>
<div class="font-bold"><i class="fa fa-database"></i> <div class="font-bold"><i class="fa fa-database"></i>
<small>{:__('Database table nums')}</small> <small>{:__('Database table nums')}</small>
</div> </div>
@ -346,7 +346,7 @@
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h1 class="no-margins">{$attachmentnums|htmlentities}</h1> <h1 class="no-margins">{$attachmentnums}</h1>
<div class="font-bold"><i class="fa fa-files-o"></i> <div class="font-bold"><i class="fa fa-files-o"></i>
<small>{:__('Attachment nums')}</small> <small>{:__('Attachment nums')}</small>
</div> </div>
@ -373,7 +373,7 @@
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h1 class="no-margins">{$picturenums|htmlentities}</h1> <h1 class="no-margins">{$picturenums}</h1>
<div class="font-bold"><i class="fa fa-picture-o"></i> <div class="font-bold"><i class="fa fa-picture-o"></i>
<small>{:__('Picture nums')}</small> <small>{:__('Picture nums')}</small>
</div> </div>

View File

@ -15,7 +15,7 @@
<select name="category-third" id="category-third" class="form-control selectpicker"> <select name="category-third" id="category-third" class="form-control selectpicker">
<option value="">{:__('Please select category')}</option> <option value="">{:__('Please select category')}</option>
{foreach name="categoryList" id="item"} {foreach name="categoryList" id="item"}
<option value="{$key|htmlentities}">{$item|htmlentities}</option> <option value="{$key}">{$item}</option>
{/foreach} {/foreach}
</select> </select>
</div> </div>
@ -42,13 +42,13 @@
<select name="category-local" id="category-local" class="form-control selectpicker"> <select name="category-local" id="category-local" class="form-control selectpicker">
<option value="">{:__('Please select category')}</option> <option value="">{:__('Please select category')}</option>
{foreach name="categoryList" id="item"} {foreach name="categoryList" id="item"}
<option value="{$key|htmlentities}">{$item|htmlentities}</option> <option value="{$key}">{$item}</option>
{/foreach} {/foreach}
</select> </select>
</div> </div>
<button type="button" id="faupload-local" class="btn btn-primary faupload" data-input-id="c-local" data-multiple="true" data-preview-id="p-local" data-url="{:url('ajax/upload')}" data-cdnurl=""><i class="fa fa-upload"></i> {:__("Upload to local")}</button> <button type="button" id="faupload-local" class="btn btn-primary faupload" data-input-id="c-local" data-multiple="true" data-preview-id="p-local" data-url="{:url('ajax/upload')}"><i class="fa fa-upload"></i> {:__("Upload to local")}</button>
{if $config.upload.chunking} {if $config.upload.chunking}
<button type="button" id="faupload-local-chunking" class="btn btn-primary faupload" data-chunking="true" data-maxsize="1gb" data-input-id="c-local" data-multiple="true" data-preview-id="p-local" data-url="{:url('ajax/upload')}" data-cdnurl=""><i class="fa fa-upload"></i> {:__("Upload to local by chunk")}</button> <button type="button" id="faupload-local-chunking" class="btn btn-primary faupload" data-chunking="true" data-maxsize="1gb" data-input-id="c-local" data-multiple="true" data-preview-id="p-local" data-url="{:url('ajax/upload')}"><i class="fa fa-upload"></i> {:__("Upload to local by chunk")}</button>
{/if} {/if}
</div> </div>
</div> </div>

View File

@ -8,7 +8,7 @@
<select name="row[category]" class="form-control"> <select name="row[category]" class="form-control">
<option value="">{:__('Please select category')}</option> <option value="">{:__('Please select category')}</option>
{foreach name="categoryList" id="item"} {foreach name="categoryList" id="item"}
<option value="{$key|htmlentities}" {if $key==$row.category}selected{/if}>{$item|htmlentities}</option> <option value="{$key}" {if $key==$row.category}selected{/if}>{$item}</option>
{/foreach} {/foreach}
</select> </select>
</div> </div>

View File

@ -5,14 +5,14 @@
<ul class="nav nav-tabs" data-field="category"> <ul class="nav nav-tabs" data-field="category">
<li class="active"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li> <li class="active"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
{foreach name="categoryList" item="vo"} {foreach name="categoryList" item="vo"}
<li><a href="#t-{$key|htmlentities}" data-value="{$key|htmlentities}" data-toggle="tab">{$vo|htmlentities}</a></li> <li><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
{/foreach} {/foreach}
<li class="pull-right dropdown filter-type"> <li class="pull-right dropdown filter-type">
<a href="javascript:" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-filter"></i> {:__('Filter Type')}</a> <a href="javascript:" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-filter"></i> {:__('Filter Type')}</a>
<ul class="dropdown-menu text-left" role="menu"> <ul class="dropdown-menu text-left" role="menu">
<li class="active"><a href="javascript:" data-value="">{:__('All')}</a></li> <li class="active"><a href="javascript:" data-value="">{:__('All')}</a></li>
{foreach name="mimetypeList" id="item"} {foreach name="mimetypeList" id="item"}
<li><a href="javascript:" data-value="{$key|htmlentities}">{$item|htmlentities}</a></li> <li><a href="javascript:" data-value="{$key}">{$item}</a></li>
{/foreach} {/foreach}
</ul> </ul>
</li> </li>
@ -45,7 +45,7 @@
<select name="category" class="form-control"> <select name="category" class="form-control">
<option value="">{:__('Please select category')}</option> <option value="">{:__('Please select category')}</option>
{foreach name="categoryList" id="item"} {foreach name="categoryList" id="item"}
<option value="{$key|htmlentities}">{$item|htmlentities}</option> <option value="{$key}">{$item}</option>
{/foreach} {/foreach}
</select> </select>
</div> </div>

View File

@ -9,7 +9,7 @@
<ul class="nav nav-tabs" data-field="category"> <ul class="nav nav-tabs" data-field="category">
<li class="active"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li> <li class="active"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
{foreach name="categoryList" item="vo"} {foreach name="categoryList" item="vo"}
<li><a href="#t-{$key|htmlentities}" data-value="{$key|htmlentities}" data-toggle="tab">{$vo|htmlentities}</a></li> <li><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
{/foreach} {/foreach}
{if stripos(request()->get('mimetype'),'image/')===false} {if stripos(request()->get('mimetype'),'image/')===false}
<li class="pull-right dropdown filter-type"> <li class="pull-right dropdown filter-type">
@ -17,7 +17,7 @@
<ul class="dropdown-menu text-left" role="menu"> <ul class="dropdown-menu text-left" role="menu">
<li class="active"><a href="javascript:" data-value="">{:__('All')}</a></li> <li class="active"><a href="javascript:" data-value="">{:__('All')}</a></li>
{foreach name="mimetypeList" id="item"} {foreach name="mimetypeList" id="item"}
<li><a href="javascript:" data-value="{$key|htmlentities}">{$item|htmlentities}</a></li> <li><a href="javascript:" data-value="{$key}">{$item}</a></li>
{/foreach} {/foreach}
</ul> </ul>
</li> </li>

View File

@ -27,7 +27,7 @@
{:build_heading(null, false)} {:build_heading(null, false)}
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
{foreach $siteList as $index=>$vo} {foreach $siteList as $index=>$vo}
<li class="{$vo.active?'active':''}"><a href="#tab-{$vo.name|htmlentities}" data-toggle="tab">{:__(htmlentities($vo.title))}</a></li> <li class="{$vo.active?'active':''}"><a href="#tab-{$vo.name}" data-toggle="tab">{:__($vo.title)}</a></li>
{/foreach} {/foreach}
{if $Think.config.app_debug} {if $Think.config.app_debug}
<li data-toggle="tooltip" title="{:__('Add new config')}"> <li data-toggle="tooltip" title="{:__('Add new config')}">
@ -41,9 +41,9 @@
<div id="myTabContent" class="tab-content"> <div id="myTabContent" class="tab-content">
<!--@formatter:off--> <!--@formatter:off-->
{foreach $siteList as $index=>$vo} {foreach $siteList as $index=>$vo}
<div class="tab-pane fade {$vo.active ? 'active in' : ''}" id="tab-{$vo.name|htmlentities}"> <div class="tab-pane fade {$vo.active ? 'active in' : ''}" id="tab-{$vo.name}">
<div class="widget-body no-padding"> <div class="widget-body no-padding">
<form id="{$vo.name|htmlentities}-form" class="edit-form form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('general.config/edit')}"> <form id="{$vo.name}-form" class="edit-form form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('general.config/edit')}">
{:token()} {:token()}
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
@ -58,111 +58,111 @@
</thead> </thead>
<tbody> <tbody>
{foreach $vo.list as $item} {foreach $vo.list as $item}
<tr data-favisible="{$item.visible|default=''|htmlentities}" data-name="{$item.name|htmlentities}" class="{if $item.visible??''}hidden{/if}"> <tr data-favisible="{$item.visible|default=''|htmlentities}" data-name="{$item.name}" class="{if $item.visible??''}hidden{/if}">
<td>{$item.title|htmlentities}</td> <td>{$item.title}</td>
<td> <td>
<div class="row"> <div class="row">
<div class="col-sm-8 col-xs-12"> <div class="col-sm-8 col-xs-12">
{switch $item.type} {switch $item.type}
{case string} {case string}
<input {$item.extend_html|htmlentities} type="text" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control" data-rule="{$item.rule|htmlentities}" data-tip="{$item.tip|htmlentities}"/> <input {$item.extend_html} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control" data-rule="{$item.rule}" data-tip="{$item.tip}"/>
{/case} {/case}
{case password} {case password}
<input {$item.extend_html|htmlentities} type="password" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control" data-rule="{$item.rule|htmlentities}" data-tip="{$item.tip|htmlentities}"/> <input {$item.extend_html} type="password" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control" data-rule="{$item.rule}" data-tip="{$item.tip}"/>
{/case} {/case}
{case text} {case text}
<textarea {$item.extend_html|htmlentities} name="row[{$item.name|htmlentities}]" class="form-control" data-rule="{$item.rule|htmlentities}" rows="5" data-tip="{$item.tip|htmlentities}">{$item.value|htmlentities}</textarea> <textarea {$item.extend_html} name="row[{$item.name}]" class="form-control" data-rule="{$item.rule}" rows="5" data-tip="{$item.tip}">{$item.value|htmlentities}</textarea>
{/case} {/case}
{case editor} {case editor}
<textarea {$item.extend_html|htmlentities} name="row[{$item.name|htmlentities}]" id="editor-{$item.name|htmlentities}" class="form-control editor" data-rule="{$item.rule|htmlentities}" rows="5" data-tip="{$item.tip|htmlentities}">{$item.value|htmlentities}</textarea> <textarea {$item.extend_html} name="row[{$item.name}]" id="editor-{$item.name}" class="form-control editor" data-rule="{$item.rule}" rows="5" data-tip="{$item.tip}">{$item.value|htmlentities}</textarea>
{/case} {/case}
{case array} {case array}
<dl {$item.extend_html|htmlentities} class="fieldlist" data-name="row[{$item.name|htmlentities}]"> <dl {$item.extend_html} class="fieldlist" data-name="row[{$item.name}]">
<dd> <dd>
<ins>{:isset($item["setting"]["key"])&&$item["setting"]["key"]?$item["setting"]["key"]:__('Array key')}</ins> <ins>{:isset($item["setting"]["key"])&&$item["setting"]["key"]?$item["setting"]["key"]:__('Array key')}</ins>
<ins>{:isset($item["setting"]["value"])&&$item["setting"]["value"]?$item["setting"]["value"]:__('Array value')}</ins> <ins>{:isset($item["setting"]["value"])&&$item["setting"]["value"]?$item["setting"]["value"]:__('Array value')}</ins>
</dd> </dd>
<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd> <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
<textarea name="row[{$item.name|htmlentities}]" class="form-control hide" cols="30" rows="5">{$item.value|htmlentities}</textarea> <textarea name="row[{$item.name}]" class="form-control hide" cols="30" rows="5">{$item.value|htmlentities}</textarea>
</dl> </dl>
{/case} {/case}
{case date} {case date}
<input {$item.extend_html|htmlentities} type="text" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-tip="{$item.tip|htmlentities}" data-rule="{$item.rule|htmlentities}"/> <input {$item.extend_html} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
{/case} {/case}
{case time} {case time}
<input {$item.extend_html|htmlentities} type="text" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="HH:mm:ss" data-tip="{$item.tip|htmlentities}" data-rule="{$item.rule|htmlentities}"/> <input {$item.extend_html} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="HH:mm:ss" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
{/case} {/case}
{case datetime} {case datetime}
<input {$item.extend_html|htmlentities} type="text" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-tip="{$item.tip|htmlentities}" data-rule="{$item.rule|htmlentities}"/> <input {$item.extend_html} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
{/case} {/case}
{case datetimerange} {case datetimerange}
<input {$item.extend_html|htmlentities} type="text" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control datetimerange" data-tip="{$item.tip|htmlentities}" data-rule="{$item.rule|htmlentities}"/> <input {$item.extend_html} type="text" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control datetimerange" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
{/case} {/case}
{case number} {case number}
<input {$item.extend_html|htmlentities} type="number" name="row[{$item.name|htmlentities}]" value="{$item.value|htmlentities}" class="form-control" data-tip="{$item.tip|htmlentities}" data-rule="{$item.rule|htmlentities}"/> <input {$item.extend_html} type="number" name="row[{$item.name}]" value="{$item.value|htmlentities}" class="form-control" data-tip="{$item.tip}" data-rule="{$item.rule}"/>
{/case} {/case}
{case checkbox} {case checkbox}
<div class="checkbox"> <div class="checkbox">
{foreach name="item.content" item="vo"} {foreach name="item.content" item="vo"}
<label for="row[{$item.name|htmlentities}][]-{$key|htmlentities}"><input id="row[{$item.name|htmlentities}][]-{$key|htmlentities}" name="row[{$item.name|htmlentities}][]" type="checkbox" value="{$key|htmlentities}" data-tip="{$item.tip|htmlentities}" {in name="key" value="$item.value" }checked{/in} /> {$vo|htmlentities}</label> <label for="row[{$item.name}][]-{$key}"><input id="row[{$item.name}][]-{$key}" name="row[{$item.name}][]" type="checkbox" value="{$key}" data-tip="{$item.tip}" {in name="key" value="$item.value" }checked{/in} /> {$vo}</label>
{/foreach} {/foreach}
</div> </div>
{/case} {/case}
{case radio} {case radio}
<div class="radio"> <div class="radio">
{foreach name="item.content" item="vo"} {foreach name="item.content" item="vo"}
<label for="row[{$item.name|htmlentities}]-{$key|htmlentities}"><input id="row[{$item.name|htmlentities}]-{$key|htmlentities}" name="row[{$item.name|htmlentities}]" type="radio" value="{$key|htmlentities}" data-tip="{$item.tip|htmlentities}" {in name="key" value="$item.value" }checked{/in} /> {$vo|htmlentities}</label> <label for="row[{$item.name}]-{$key}"><input id="row[{$item.name}]-{$key}" name="row[{$item.name}]" type="radio" value="{$key}" data-tip="{$item.tip}" {in name="key" value="$item.value" }checked{/in} /> {$vo}</label>
{/foreach} {/foreach}
</div> </div>
{/case} {/case}
{case value="select" break="0"}{/case} {case value="select" break="0"}{/case}
{case value="selects"} {case value="selects"}
<select {$item.extend_html|htmlentities} name="row[{$item.name|htmlentities}]{$item.type=='selects'?'[]':''}" class="form-control selectpicker" data-tip="{$item.tip|htmlentities}" {$item.type=='selects'?'multiple':''}> <select {$item.extend_html} name="row[{$item.name}]{$item.type=='selects'?'[]':''}" class="form-control selectpicker" data-tip="{$item.tip}" {$item.type=='selects'?'multiple':''}>
{foreach name="item.content" item="vo"} {foreach name="item.content" item="vo"}
<option value="{$key|htmlentities}" {in name="key" value="$item.value" }selected{/in}>{$vo|htmlentities}</option> <option value="{$key}" {in name="key" value="$item.value" }selected{/in}>{$vo}</option>
{/foreach} {/foreach}
</select> </select>
{/case} {/case}
{case value="image" break="0"}{/case} {case value="image" break="0"}{/case}
{case value="images"} {case value="images"}
<div class="form-inline"> <div class="form-inline">
<input id="c-{$item.name|htmlentities}" class="form-control" size="50" name="row[{$item.name|htmlentities}]" type="text" value="{$item.value|htmlentities}" data-tip="{$item.tip|htmlentities}"> <input id="c-{$item.name}" class="form-control" size="50" name="row[{$item.name}]" type="text" value="{$item.value|htmlentities}" data-tip="{$item.tip}">
<span><button type="button" id="faupload-{$item.name|htmlentities}" class="btn btn-danger faupload" data-input-id="c-{$item.name|htmlentities}" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="{$item.type=='image'?'false':'true'}" data-preview-id="p-{$item.name|htmlentities}"><i class="fa fa-upload"></i> {:__('Upload')}</button></span> <span><button type="button" id="faupload-{$item.name}" class="btn btn-danger faupload" data-input-id="c-{$item.name}" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="{$item.type=='image'?'false':'true'}" data-preview-id="p-{$item.name}"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-{$item.name|htmlentities}" class="btn btn-primary fachoose" data-input-id="c-{$item.name|htmlentities}" data-mimetype="image/*" data-multiple="{$item.type=='image'?'false':'true'}"><i class="fa fa-list"></i> {:__('Choose')}</button></span> <span><button type="button" id="fachoose-{$item.name}" class="btn btn-primary fachoose" data-input-id="c-{$item.name}" data-mimetype="image/*" data-multiple="{$item.type=='image'?'false':'true'}"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
<span class="msg-box n-right" for="c-{$item.name|htmlentities}"></span> <span class="msg-box n-right" for="c-{$item.name}"></span>
<ul class="row list-inline faupload-preview" id="p-{$item.name|htmlentities}"></ul> <ul class="row list-inline faupload-preview" id="p-{$item.name}"></ul>
</div> </div>
{/case} {/case}
{case value="file" break="0"}{/case} {case value="file" break="0"}{/case}
{case value="files"} {case value="files"}
<div class="form-inline"> <div class="form-inline">
<input id="c-{$item.name|htmlentities}" class="form-control" size="50" name="row[{$item.name|htmlentities}]" type="text" value="{$item.value|htmlentities}" data-tip="{$item.tip|htmlentities}"> <input id="c-{$item.name}" class="form-control" size="50" name="row[{$item.name}]" type="text" value="{$item.value|htmlentities}" data-tip="{$item.tip}">
<span><button type="button" id="faupload-{$item.name|htmlentities}" class="btn btn-danger faupload" data-input-id="c-{$item.name|htmlentities}" data-multiple="{$item.type=='file'?'false':'true'}"><i class="fa fa-upload"></i> {:__('Upload')}</button></span> <span><button type="button" id="faupload-{$item.name}" class="btn btn-danger faupload" data-input-id="c-{$item.name}" data-multiple="{$item.type=='file'?'false':'true'}"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-{$item.name|htmlentities}" class="btn btn-primary fachoose" data-input-id="c-{$item.name|htmlentities}" data-multiple="{$item.type=='file'?'false':'true'}"><i class="fa fa-list"></i> {:__('Choose')}</button></span> <span><button type="button" id="fachoose-{$item.name}" class="btn btn-primary fachoose" data-input-id="c-{$item.name}" data-multiple="{$item.type=='file'?'false':'true'}"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
<span class="msg-box n-right" for="c-{$item.name|htmlentities}"></span> <span class="msg-box n-right" for="c-{$item.name}"></span>
</div> </div>
{/case} {/case}
{case switch} {case switch}
<input id="c-{$item.name|htmlentities}" name="row[{$item.name|htmlentities}]" type="hidden" value="{:$item.value?1:0}"> <input id="c-{$item.name}" name="row[{$item.name}]" type="hidden" value="{:$item.value?1:0}">
<a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-{$item.name|htmlentities}" data-yes="1" data-no="0"> <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-{$item.name}" data-yes="1" data-no="0">
<i class="fa fa-toggle-on text-success {if !$item.value}fa-flip-horizontal text-gray{/if} fa-2x"></i> <i class="fa fa-toggle-on text-success {if !$item.value}fa-flip-horizontal text-gray{/if} fa-2x"></i>
</a> </a>
{/case} {/case}
{case bool} {case bool}
<label for="row[{$item.name|htmlentities}]-yes"><input id="row[{$item.name|htmlentities}]-yes" name="row[{$item.name|htmlentities}]" type="radio" value="1" {$item.value?'checked':''} data-tip="{$item.tip|htmlentities}" /> {:__('Yes')}</label> <label for="row[{$item.name}]-yes"><input id="row[{$item.name}]-yes" name="row[{$item.name}]" type="radio" value="1" {$item.value?'checked':''} data-tip="{$item.tip}" /> {:__('Yes')}</label>
<label for="row[{$item.name|htmlentities}]-no"><input id="row[{$item.name|htmlentities}]-no" name="row[{$item.name|htmlentities}]" type="radio" value="0" {$item.value?'':'checked'} data-tip="{$item.tip|htmlentities}" /> {:__('No')}</label> <label for="row[{$item.name}]-no"><input id="row[{$item.name}]-no" name="row[{$item.name}]" type="radio" value="0" {$item.value?'':'checked'} data-tip="{$item.tip}" /> {:__('No')}</label>
{/case} {/case}
{case city} {case city}
<div style="position:relative"> <div style="position:relative">
<input {$item.extend_html|htmlentities} type="text" name="row[{$item.name|htmlentities}]" id="c-{$item.name|htmlentities}" value="{$item.value|htmlentities}" class="form-control" data-toggle="city-picker" data-tip="{$item.tip|htmlentities}" data-rule="{$item.rule|htmlentities}" /> <input {$item.extend_html} type="text" name="row[{$item.name}]" id="c-{$item.name}" value="{$item.value|htmlentities}" class="form-control" data-toggle="city-picker" data-tip="{$item.tip}" data-rule="{$item.rule}" />
</div> </div>
{/case} {/case}
{case value="selectpage" break="0"}{/case} {case value="selectpage" break="0"}{/case}
{case value="selectpages"} {case value="selectpages"}
<input {$item.extend_html|htmlentities} type="text" name="row[{$item.name|htmlentities}]" id="c-{$item.name|htmlentities}" value="{$item.value|htmlentities}" class="form-control selectpage" data-source="{:url('general.config/selectpage')}?id={$item.id|htmlentities}" data-primary-key="{$item.setting.primarykey|htmlentities}" data-field="{$item.setting.field|htmlentities}" data-multiple="{$item.type=='selectpage'?'false':'true'}" data-tip="{$item.tip|htmlentities}" data-rule="{$item.rule|htmlentities}" /> <input {$item.extend_html} type="text" name="row[{$item.name}]" id="c-{$item.name}" value="{$item.value|htmlentities}" class="form-control selectpage" data-source="{:url('general.config/selectpage')}?id={$item.id}" data-primary-key="{$item.setting.primarykey}" data-field="{$item.setting.field}" data-multiple="{$item.type=='selectpage'?'false':'true'}" data-tip="{$item.tip}" data-rule="{$item.rule}" />
{/case} {/case}
{case custom} {case custom}
{$item.extend_html|htmlentities} {$item.extend_html}
{/case} {/case}
{/switch} {/switch}
</div> </div>
@ -172,7 +172,7 @@
</td> </td>
{if $Think.config.app_debug} {if $Think.config.app_debug}
<td>{php}echo "{\$site.". $item['name'] . "}";{/php}</td> <td>{php}echo "{\$site.". $item['name'] . "}";{/php}</td>
<td>{if $item['id']>18}<a href="javascript:;" class="btn-delcfg text-muted" data-name="{$item.name|htmlentities}"><i class="fa fa-times"></i></a>{/if}</td> <td>{if $item['id']>18}<a href="javascript:;" class="btn-delcfg text-muted" data-name="{$item.name}"><i class="fa fa-times"></i></a>{/if}</td>
{/if} {/if}
</tr> </tr>
{/foreach} {/foreach}
@ -205,7 +205,7 @@
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<select name="row[group]" class="form-control selectpicker"> <select name="row[group]" class="form-control selectpicker">
{foreach name="groupList" item="vo"} {foreach name="groupList" item="vo"}
<option value="{$key|htmlentities}" {in name="key" value="basic" }selected{/in}>{$vo|htmlentities}</option> <option value="{$key}" {in name="key" value="basic" }selected{/in}>{$vo}</option>
{/foreach} {/foreach}
</select> </select>
</div> </div>
@ -215,7 +215,7 @@
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<select name="row[type]" id="c-type" class="form-control selectpicker"> <select name="row[type]" id="c-type" class="form-control selectpicker">
{foreach name="typeList" item="vo"} {foreach name="typeList" item="vo"}
<option value="{$key|htmlentities}" {in name="key" value="string" }selected{/in}>{$vo|htmlentities}</option> <option value="{$key}" {in name="key" value="string" }selected{/in}>{$vo}</option>
{/foreach} {/foreach}
</select> </select>
</div> </div>
@ -306,7 +306,7 @@ value2|title2</textarea>
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown" type="button">{:__('Choose')}</button> <button class="btn btn-primary dropdown-toggle" data-toggle="dropdown" type="button">{:__('Choose')}</button>
<ul class="dropdown-menu pull-right rulelist"> <ul class="dropdown-menu pull-right rulelist">
{volist name="ruleList" id="item"} {volist name="ruleList" id="item"}
<li><a href="javascript:;" data-value="{$key|htmlentities}">{$item|htmlentities}<span class="text-muted">({$key|htmlentities})</span></a></li> <li><a href="javascript:;" data-value="{$key}">{$item}<span class="text-muted">({$key})</span></a></li>
{/volist} {/volist}
</ul> </ul>
</span> </span>

View File

@ -27,13 +27,13 @@
<!-- 主体内容区域 --> <!-- 主体内容区域 -->
<div class="content-wrapper tab-content tab-addtabs"> <div class="content-wrapper tab-content tab-addtabs">
{if $fixedmenu} {if $fixedmenu}
<div role="tabpanel" class="tab-pane {:$referermenu?'':'active'}" id="con_{$fixedmenu.id|htmlentities}"> <div role="tabpanel" class="tab-pane {:$referermenu?'':'active'}" id="con_{$fixedmenu.id}">
<iframe src="{$fixedmenu.url|htmlentities}{:stripos($fixedmenu.url, '?') !== false ? '&' : '?'}addtabs=1" width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling-x="no" scrolling-y="auto" allowtransparency="yes"></iframe> <iframe src="{$fixedmenu.url}{:stripos($fixedmenu.url, '?') !== false ? '&' : '?'}addtabs=1" width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling-x="no" scrolling-y="auto" allowtransparency="yes"></iframe>
</div> </div>
{/if} {/if}
{if $referermenu} {if $referermenu}
<div role="tabpanel" class="tab-pane active" id="con_{$referermenu.id|htmlentities}"> <div role="tabpanel" class="tab-pane active" id="con_{$referermenu.id}">
<iframe src="{$referermenu.url|htmlentities}{:stripos($referermenu.url, '?') !== false ? '&' : '?'}addtabs=1" width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling-x="no" scrolling-y="auto" allowtransparency="yes"></iframe> <iframe src="{$referermenu.url}{:stripos($referermenu.url, '?') !== false ? '&' : '?'}addtabs=1" width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling-x="no" scrolling-y="auto" allowtransparency="yes"></iframe>
</div> </div>
{/if} {/if}
</div> </div>
@ -42,7 +42,7 @@
<footer class="main-footer hide"> <footer class="main-footer hide">
<div class="pull-right hidden-xs"> <div class="pull-right hidden-xs">
</div> </div>
<strong>Copyright &copy; 2017-{:date("Y")} <a href="__PUBLIC__">{$site.name|htmlentities}</a>.</strong> All rights reserved. <strong>Copyright &copy; 2017-{:date("Y")} <a href="__PUBLIC__">{$site.name}</a>.</strong> All rights reserved.
</footer> </footer>
<!-- 右侧控制栏 --> <!-- 右侧控制栏 -->

View File

@ -81,7 +81,7 @@
{if $background} {if $background}
<style type="text/css"> <style type="text/css">
body{ body{
background-image: url('{$background|htmlentities}'); background-image: url('{$background}');
} }
</style> </style>
{/if} {/if}
@ -116,7 +116,7 @@
{if $Think.config.fastadmin.login_captcha} {if $Think.config.fastadmin.login_captcha}
<div class="input-group"> <div class="input-group">
<div class="input-group-addon"><span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></div> <div class="input-group-addon"><span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></div>
<input type="text" name="captcha" class="form-control" placeholder="{:__('Captcha')}" data-rule="{:__('Captcha')}:required;length({$Think.config.captcha.length|htmlentities})" autocomplete="off"/> <input type="text" name="captcha" class="form-control" placeholder="{:__('Captcha')}" data-rule="{:__('Captcha')}:required;length({$Think.config.captcha.length})" autocomplete="off"/>
<span class="input-group-addon" style="padding:0;border:none;cursor:pointer;"> <span class="input-group-addon" style="padding:0;border:none;cursor:pointer;">
<img src="{:rtrim('__PUBLIC__', '/')}/index.php?s=/captcha" width="100" height="30" onclick="this.src = '{:rtrim('__PUBLIC__', '/')}/index.php?s=/captcha&r=' + Math.random();"/> <img src="{:rtrim('__PUBLIC__', '/')}/index.php?s=/captcha" width="100" height="30" onclick="this.src = '{:rtrim('__PUBLIC__', '/')}/index.php?s=/captcha&r=' + Math.random();"/>
</span> </span>

View File

@ -26,7 +26,7 @@
</ol> </ol>
<ol class="breadcrumb pull-right"> <ol class="breadcrumb pull-right">
{foreach $breadcrumb as $vo} {foreach $breadcrumb as $vo}
<li><a href="javascript:;" data-url="{$vo.url|htmlentities}">{$vo.title|htmlentities}</a></li> <li><a href="javascript:;" data-url="{$vo.url}">{$vo.title}</a></li>
{/foreach} {/foreach}
</ol> </ol>
</div> </div>

View File

@ -22,7 +22,7 @@
<div class="radio"> <div class="radio">
{foreach name="statusList" item="vo"} {foreach name="statusList" item="vo"}
<label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key" value="normal"}checked{/in} /> {$vo|htmlentities}</label> <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="normal"}checked{/in} /> {$vo}</label>
{/foreach} {/foreach}
</div> </div>

View File

@ -22,7 +22,7 @@
<div class="radio"> <div class="radio">
{foreach name="statusList" item="vo"} {foreach name="statusList" item="vo"}
<label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key" value="$row.status"}checked{/in} /> {$vo|htmlentities}</label> <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
{/foreach} {/foreach}
</div> </div>

View File

@ -80,7 +80,7 @@ class Common extends Api
/** /**
* 上传文件 * 上传文件
* @ApiMethod (POST) * @ApiMethod (POST)
* @ApiParams (name="file", type="file", required=true, description="文件流") * @ApiParams (name="file", type="File", required=true, description="文件流")
*/ */
public function upload() public function upload()
{ {

View File

@ -552,7 +552,7 @@ class Backend extends Controller
$primaryvalue = array_unique(is_array($primaryvalue) ? $primaryvalue : explode(',', $primaryvalue)); $primaryvalue = array_unique(is_array($primaryvalue) ? $primaryvalue : explode(',', $primaryvalue));
//修复自定义data-primary-key为字符串内容时给排序字段添加上引号 //修复自定义data-primary-key为字符串内容时给排序字段添加上引号
$primaryvalue = array_map(function ($value) { $primaryvalue = array_map(function ($value) {
return \think\Db::quote($value); return '\'' . $value . '\'';
}, $primaryvalue); }, $primaryvalue);
$primaryvalue = implode(',', $primaryvalue); $primaryvalue = implode(',', $primaryvalue);
@ -577,7 +577,6 @@ class Backend extends Controller
$result = array_intersect_key(($item instanceof Model ? $item->toArray() : (array)$item), array_flip($fields)); $result = array_intersect_key(($item instanceof Model ? $item->toArray() : (array)$item), array_flip($fields));
} }
$result['pid'] = isset($item['pid']) ? $item['pid'] : (isset($item['parent_id']) ? $item['parent_id'] : 0); $result['pid'] = isset($item['pid']) ? $item['pid'] : (isset($item['parent_id']) ? $item['parent_id'] : 0);
$result = array_map("htmlentities", $result);
$list[] = $result; $list[] = $result;
} }
if ($istree && !$primaryvalue) { if ($istree && !$primaryvalue) {

View File

@ -224,7 +224,6 @@ class Auth
if ($user->loginfailure >= 10 && time() - $user->loginfailuretime < 86400) { if ($user->loginfailure >= 10 && time() - $user->loginfailuretime < 86400) {
$this->setError('Please try again after 1 day'); $this->setError('Please try again after 1 day');
return false;
} }
if ($user->password != $this->getEncryptPassword($password, $user->salt)) { if ($user->password != $this->getEncryptPassword($password, $user->salt)) {

View File

@ -19,8 +19,10 @@ class Log extends AbstractLogger
* @param array $context * @param array $context
* *
* @return void * @return void
*
* @throws \Psr\Log\InvalidArgumentException
*/ */
public function log($level, $message, array $context = []) public function log($level, $message, array $context = array())
{ {
\think\Log::write($message); \think\Log::write($message);
} }

View File

@ -86,11 +86,6 @@ class Upload
*/ */
protected function checkExecutable() protected function checkExecutable()
{ {
//禁止上传以.开头的文件
if (substr($this->fileInfo['name'], 0, 1) === '.') {
throw new UploadException(__('Uploaded file format is limited'));
}
//禁止上传PHP和HTML文件 //禁止上传PHP和HTML文件
if (in_array($this->fileInfo['type'], ['text/x-php', 'text/html']) || in_array($this->fileInfo['suffix'], ['php', 'html', 'htm', 'phar', 'phtml']) || preg_match("/^php(.*)/i", $this->fileInfo['suffix'])) { if (in_array($this->fileInfo['type'], ['text/x-php', 'text/html']) || in_array($this->fileInfo['suffix'], ['php', 'html', 'htm', 'phar', 'phtml']) || preg_match("/^php(.*)/i", $this->fileInfo['suffix'])) {
throw new UploadException(__('Uploaded file format is limited')); throw new UploadException(__('Uploaded file format is limited'));
@ -112,7 +107,8 @@ class Upload
throw new UploadException(__('Uploaded file format is limited')); throw new UploadException(__('Uploaded file format is limited'));
} }
//验证文件后缀 //验证文件后缀
if (in_array($this->fileInfo['suffix'], $mimetypeArr) || in_array('.' . $this->fileInfo['suffix'], $mimetypeArr) if ($this->config['mimetype'] === '*'
|| in_array($this->fileInfo['suffix'], $mimetypeArr) || in_array('.' . $this->fileInfo['suffix'], $mimetypeArr)
|| in_array($typeArr[0] . "/*", $mimetypeArr) || (in_array($this->fileInfo['type'], $mimetypeArr) && stripos($this->fileInfo['type'], '/') !== false)) { || in_array($typeArr[0] . "/*", $mimetypeArr) || (in_array($this->fileInfo['type'], $mimetypeArr) && stripos($this->fileInfo['type'], '/') !== false)) {
return true; return true;
} }

View File

@ -219,7 +219,7 @@ class Config extends Model
} }
file_put_contents( file_put_contents(
CONF_PATH . 'extra' . DS . 'site.php', CONF_PATH . 'extra' . DS . 'site.php',
'<?php' . "\n\nreturn " . var_export($config, true) . ";\n" '<?php' . "\n\nreturn " . var_export_short($config) . ";\n"
); );
return true; return true;
} }

View File

@ -7,10 +7,6 @@ use think\Model;
/** /**
* 会员模型 * 会员模型
* @method static mixed getByUsername($str) 通过用户名查询用户
* @method static mixed getByNickname($str) 通过昵称查询用户
* @method static mixed getByMobile($str) 通过手机查询用户
* @method static mixed getByEmail($str) 通过邮箱查询用户
*/ */
class User extends Model class User extends Model
{ {

View File

@ -41,19 +41,18 @@
<p class="clearfix"> <p class="clearfix">
<a href="__PUBLIC__" class="btn btn-grey">{:__('Go back')}</a> <a href="__PUBLIC__" class="btn btn-grey">{:__('Go back')}</a>
{if $url} {if $url}
<a id="href" href="{$url|htmlentities}" class="btn btn-primary">{:__('Jump now')}</a> <a href="{$url|htmlentities}" class="btn btn-primary">{:__('Jump now')}</a>
{/if} {/if}
</p> </p>
</div> </div>
{if $url} {if $url}
<script type="text/javascript"> <script type="text/javascript">
(function () { (function () {
var wait = document.getElementById('wait'), var wait = document.getElementById('wait');
href = document.getElementById('href').href;
var interval = setInterval(function () { var interval = setInterval(function () {
var time = --wait.innerHTML; var time = --wait.innerHTML;
if (time <= 0) { if (time <= 0) {
location.href = href; location.href = "{$url|htmlentities}";
clearInterval(interval); clearInterval(interval);
} }
}, 1000); }, 1000);
@ -61,4 +60,4 @@
</script> </script>
{/if} {/if}
</body> </body>
</html> </html>

View File

@ -302,7 +302,7 @@ return [
//允许跨域的域名,多个以,分隔 //允许跨域的域名,多个以,分隔
'cors_request_domain' => 'localhost,127.0.0.1', 'cors_request_domain' => 'localhost,127.0.0.1',
//版本号 //版本号
'version' => '1.6.1.20250430', 'version' => '1.5.2.20240906',
//API接口地址 //API接口地址
'api_url' => 'https://api.fastadmin.net', 'api_url' => 'https://api.fastadmin.net',
], ],

View File

@ -20,17 +20,12 @@ return [
'maxsize' => '10mb', 'maxsize' => '10mb',
/** /**
* 可上传的文件类型 * 可上传的文件类型
* 如配置允许 pdf,ppt,docx,svg 等可能含有脚本的文件时,请先从服务器配置此类文件直接下载而不是预览
*/ */
'mimetype' => 'jpg,png,bmp,jpeg,gif,webp,zip,rar,wav,mp4,mp3,webm', 'mimetype' => 'jpg,png,bmp,jpeg,gif,webp,zip,rar,wav,mp4,mp3,webm',
/** /**
* 是否支持批量上传 * 是否支持批量上传
*/ */
'multiple' => false, 'multiple' => false,
/**
* 上传超时时长这里仅用于JS上传超时控制
*/
'timeout' => 60000,
/** /**
* 是否支持分片上传 * 是否支持分片上传
*/ */

View File

@ -57,12 +57,11 @@ return [
'Change password successful' => '修改密码成功', 'Change password successful' => '修改密码成功',
'Password and confirm password don\'t match' => '两次输入的密码不一致', 'Password and confirm password don\'t match' => '两次输入的密码不一致',
'Captcha is incorrect' => '验证码不正确', 'Captcha is incorrect' => '验证码不正确',
'Please try again after 1 day' => '请于1天后再尝试登录',
'Logged in successful' => '登录成功', 'Logged in successful' => '登录成功',
'Logout successful' => '退出成功', 'Logout successful' => '退出成功',
'User center already closed' => '会员中心已经关闭', 'User center already closed' => '会员中心已经关闭',
'Don\'t have an account? Sign up' => '还没有账号?点击注册', 'Don\'t have an account? Sign up' => '还没有账号?点击注册',
'Already have an account? Sign in' => '已经有账号?点击登录', 'Already have an account? Sign in' => '已经有账号?点击登录',
'Operation failed' => '操作失败', 'Operation failed' => '操作失败',
'Invalid parameters' => '参数不正确', 'Invalid parameters' => '参数不正确',
'Change password failure' => '修改密码失败', 'Change password failure' => '修改密码失败',

View File

@ -1 +1 @@
<script src="__CDN__/assets/js/require{$Think.config.app_debug?'':'.min'}.js" data-main="__CDN__/assets/js/require-frontend{$Think.config.app_debug?'':'.min'}.js?v={$site.version|htmlentities}"></script> <script src="__CDN__/assets/js/require{$Think.config.app_debug?'':'.min'}.js" data-main="__CDN__/assets/js/require-frontend{$Think.config.app_debug?'':'.min'}.js?v={$site.version|htmlentities}"></script>

34
bower.json 100755
View File

@ -0,0 +1,34 @@
{
"name": "fastadmin",
"description": "the fastest admin framework",
"main": "",
"license": "Apache2.0",
"homepage": "https://www.fastadmin.net",
"private": true,
"dependencies": {
"jquery": "^3.7.0",
"bootstrap": "^3.3.7",
"font-awesome": "^4.6.1",
"bootstrap-table": "fastadmin-bootstraptable#~1.11.5",
"jstree": "~3.3.2",
"moment": "~2.29.0",
"toastr": "~2.1.3",
"eonasdan-bootstrap-datetimepicker": "~4.17.43",
"bootstrap-select": "~1.13.18",
"require-css": "~0.1.8",
"tableExport.jquery.plugin": "~1.10.3",
"jquery-slimscroll": "~1.3.8",
"jquery.cookie": "~1.4.1",
"Sortable": "~1.10.0",
"nice-validator": "karsonzhang/fastadmin-nicevalidator#~1.1.6",
"art-template": "~3.1.3",
"bootstrap-daterangepicker": "~2.1.25",
"fastadmin-citypicker": "~1.3.1",
"fastadmin-cxselect": "~1.4.0",
"fastadmin-dragsort": "~1.0.0",
"fastadmin-addtabs": "~1.0.8",
"fastadmin-selectpage": "~1.0.12",
"fastadmin-layer": "~3.5.1",
"bootstrap-slider": "*"
}
}

View File

@ -1,5 +1,5 @@
{ {
"name": "fastadminnet/fastadmin", "name": "karsonzhang/fastadmin",
"description": "the fastest admin framework", "description": "the fastest admin framework",
"type": "project", "type": "project",
"keywords": [ "keywords": [
@ -21,15 +21,15 @@
"topthink/think-installer": "^1.0.14", "topthink/think-installer": "^1.0.14",
"topthink/think-queue": "1.1.6", "topthink/think-queue": "1.1.6",
"topthink/think-helper": "^1.0.7", "topthink/think-helper": "^1.0.7",
"fastadminnet/fastadmin-addons": "~1.4.0", "karsonzhang/fastadmin-addons": "~1.4.0",
"fastadminnet/fastadmin-mailer": "^2.0.0",
"overtrue/pinyin": "^3.0", "overtrue/pinyin": "^3.0",
"phpoffice/phpspreadsheet": "^1.29.1", "phpoffice/phpspreadsheet": "^1.29.1",
"overtrue/wechat": "^4.6", "overtrue/wechat": "^4.6",
"ext-json": "*", "ext-json": "*",
"ext-curl": "*", "ext-curl": "*",
"ext-pdo": "*", "ext-pdo": "*",
"ext-bcmath": "*" "ext-bcmath": "*",
"txthinking/mailer": "^2.0"
}, },
"config": { "config": {
"preferred-install": "dist", "preferred-install": "dist",

View File

@ -124,7 +124,7 @@ class Date
*/ */
public static function human($remote, $local = null) public static function human($remote, $local = null)
{ {
$time_diff = (is_null($local) ? time() : $local) - $remote; $time_diff = (is_null($local) || $local ? time() : $local) - $remote;
$tense = $time_diff < 0 ? 'after' : 'ago'; $tense = $time_diff < 0 ? 'after' : 'ago';
$time_diff = abs($time_diff); $time_diff = abs($time_diff);
$chunks = [ $chunks = [
@ -146,7 +146,7 @@ class Date
break; break;
} }
} }
return __("%d $name%s $tense", [$count, ($count > 1 ? 's' : '')]); return __("%d $name%s $tense", $count, ($count > 1 ? 's' : ''));
} }
/** /**

View File

@ -14,7 +14,7 @@ class Random
* @param int $len 长度 * @param int $len 长度
* @return string * @return string
*/ */
public static function alnum(int $len = 6): string public static function alnum($len = 6)
{ {
return self::build('alnum', $len); return self::build('alnum', $len);
} }
@ -25,7 +25,7 @@ class Random
* @param int $len 长度 * @param int $len 长度
* @return string * @return string
*/ */
public static function alpha(int $len = 6): string public static function alpha($len = 6)
{ {
return self::build('alpha', $len); return self::build('alpha', $len);
} }
@ -36,7 +36,7 @@ class Random
* @param int $len 长度 * @param int $len 长度
* @return string * @return string
*/ */
public static function numeric(int $len = 4): string public static function numeric($len = 4)
{ {
return self::build('numeric', $len); return self::build('numeric', $len);
} }
@ -47,7 +47,7 @@ class Random
* @param int $len 长度 * @param int $len 长度
* @return string * @return string
*/ */
public static function nozero(int $len = 4): string public static function nozero($len = 4)
{ {
return self::build('nozero', $len); return self::build('nozero', $len);
} }
@ -58,7 +58,7 @@ class Random
* @param int $len 长度 * @param int $len 长度
* @return string * @return string
*/ */
public static function build(string $type = 'alnum', int $len = 8): string public static function build($type = 'alnum', $len = 8)
{ {
switch ($type) { switch ($type) {
case 'alpha': case 'alpha':
@ -93,7 +93,7 @@ class Random
* 获取全球唯一标识 * 获取全球唯一标识
* @return string * @return string
*/ */
public static function uuid(): string public static function uuid()
{ {
return sprintf( return sprintf(
'%04x%04x-%04x-%04x-%04x-%04x%04x%04x', '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',

View File

@ -325,7 +325,7 @@ class Tree
'@url' => $childdata || !isset($value['@url']) ? "javascript:;" : $value['@url'], '@url' => $childdata || !isset($value['@url']) ? "javascript:;" : $value['@url'],
'@addtabs' => $childdata || !isset($value['@url']) ? "" : (stripos($value['@url'], "?") !== false ? "&" : "?") . "ref=addtabs", '@addtabs' => $childdata || !isset($value['@url']) ? "" : (stripos($value['@url'], "?") !== false ? "&" : "?") . "ref=addtabs",
'@caret' => ($childdata && (!isset($value['@badge']) || !$value['@badge']) ? '<i class="fa fa-angle-left"></i>' : ''), '@caret' => ($childdata && (!isset($value['@badge']) || !$value['@badge']) ? '<i class="fa fa-angle-left"></i>' : ''),
'@badge' => $value['@badge'] ?? '', '@badge' => isset($value['@badge']) ? $value['@badge'] : '',
'@class' => ($selected ? ' active' : '') . ($disabled ? ' disabled' : '') . ($childdata ? ' treeview' . (config('fastadmin.show_submenu') ? ' treeview-open' : '') : ''), '@class' => ($selected ? ' active' : '') . ($disabled ? ' disabled' : '') . ($childdata ? ' treeview' . (config('fastadmin.show_submenu') ? ' treeview-open' : '') : ''),
); );
$str .= strtr($nstr, $value); $str .= strtr($nstr, $value);
@ -422,7 +422,7 @@ class Tree
{ {
$arr = []; $arr = [];
foreach ($data as $k => $v) { foreach ($data as $k => $v) {
$childlist = $v['childlist'] ?? []; $childlist = isset($v['childlist']) ? $v['childlist'] : [];
unset($v['childlist']); unset($v['childlist']);
$v[$field] = $v['spacer'] . ' ' . $v[$field]; $v[$field] = $v['spacer'] . ' ' . $v[$field];
$v['haschild'] = $childlist ? 1 : 0; $v['haschild'] = $childlist ? 1 : 0;

3190
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,109 +0,0 @@
{
"name": "fastadmin",
"version": "1.6.1",
"description": "FastAdmin是一款基于ThinkPHP+Bootstrap的极速后台开发框架。",
"scripts": {
"build": "grunt"
},
"repository": {
"type": "git",
"url": "git@gitee.com:karson/fastadmin.git"
},
"dependencies": {
"bootstrap": "npm:fastadmin-bootstrap@^3.4.1",
"bootstrap-daterangepicker": "~2.1.25",
"bootstrap-select": "^1.13.18",
"bootstrap-slider": "^11.0.2",
"eonasdan-bootstrap-datetimepicker": "^4.17.49",
"fastadmin-addtabs": "^1.0.8",
"fastadmin-arttemplate": "^3.1.4",
"fastadmin-bootstraptable": "^1.11.12",
"fastadmin-citypicker": "^1.3.6",
"fastadmin-cxselect": "^1.4.0",
"fastadmin-dragsort": "^1.0.5",
"fastadmin-layer": "^3.5.6",
"fastadmin-selectpage": "^1.1.1",
"fastadmin-nicevalidator": "^1.1.6",
"art-template": "npm:fastadmin-arttemplate@^3.1.4",
"bootstrap-table": "npm:fastadmin-bootstraptable@^1.11.12",
"nice-validator": "npm:fastadmin-nicevalidator@^1.1.6",
"font-awesome": "^4.6.1",
"jquery": "^3.7.1",
"jquery-slimscroll": "~1.3.8",
"jquery.cookie": "~1.4.1",
"jstree": "~3.3.2",
"moment": "^2.10",
"require-css": "~0.1.8",
"sortablejs": "^1.12.0",
"tableexport.jquery.plugin": "^1.20.0",
"toastr": "~2.1.3"
},
"author": "FastAdmin",
"license": "Apache-2.0",
"devDependencies": {
"grunt": "^1.5.3",
"grunt-contrib-clean": "^2.0.1",
"grunt-contrib-copy": "^1.0.0",
"jsonminify": "^0.4.2",
"parse-config-file": "^1.0.4"
},
"overrides": {
"canvg": {
"xmldom": "^0.7.0"
},
"tableexport.jquery.plugin": {
"xlsx": "npm:@e965/xlsx@^0.20.3"
},
"eonasdan-bootstrap-datetimepicker": {
"moment-timezone": "^0.5.35"
}
},
"dists": {
"art-template": "dist/**",
"bootstrap": "dist/**",
"bootstrap-daterangepicker": [
"daterangepicker.js",
"daterangepicker.css"
],
"bootstrap-select": "dist/**",
"bootstrap-slider": [
"dist/**",
"*.css",
"*.js"
],
"coloris": [
"dist/umd/**",
"dist/*.css"
],
"eonasdan-bootstrap-datetimepicker": "build/**",
"fastadmin-addtabs": "*.js",
"fastadmin-bootstraptable": "dist/**",
"fastadmin-citypicker": "dist/**",
"fastadmin-cxselect": "js/**",
"fastadmin-dragsort": "*.js",
"fastadmin-layer": "dist/**",
"fastadmin-selectpage": "*",
"font-awesome": [
"css/**",
"fonts/**"
],
"jquery": "dist/**",
"jquery-slimscroll": "*.js",
"jquery.cookie": "*.js",
"jstree": "dist/**",
"moment": [
"moment.js",
"locale/**"
],
"nice-validator": "dist/**",
"require-css": "*.js",
"sortablejs": "*.js",
"tableexport.jquery.plugin": "tableExport.min.js",
"toastr": [
"*.less",
"*.css",
"*.js",
"build/**"
]
}
}

View File

@ -3,7 +3,7 @@
@import url("../css/skins/skin-black-blue.css"); @import url("../css/skins/skin-black-blue.css");
@import url("../css/iconfont.css"); @import url("../css/iconfont.css");
@import url("../libs/font-awesome/css/font-awesome.min.css"); @import url("../libs/font-awesome/css/font-awesome.min.css");
@import url("../libs/toastr/build/toastr.min.css"); @import url("../libs/toastr/toastr.min.css");
@import url("../libs/fastadmin-layer/dist/theme/default/layer.css"); @import url("../libs/fastadmin-layer/dist/theme/default/layer.css");
@import url("../libs/bootstrap-table/dist/bootstrap-table.min.css"); @import url("../libs/bootstrap-table/dist/bootstrap-table.min.css");
@import url("../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css"); @import url("../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css");
@ -11,7 +11,7 @@
@import url("../libs/nice-validator/dist/jquery.validator.css"); @import url("../libs/nice-validator/dist/jquery.validator.css");
@import url("../libs/bootstrap-select/dist/css/bootstrap-select.min.css"); @import url("../libs/bootstrap-select/dist/css/bootstrap-select.min.css");
@import url("../libs/fastadmin-selectpage/selectpage.css"); @import url("../libs/fastadmin-selectpage/selectpage.css");
@import url("../libs/bootstrap-slider/dist/css/bootstrap-slider.css"); @import url("../libs/bootstrap-slider/slider.css");
.m-0 { .m-0 {
margin-top: 0px !important; margin-top: 0px !important;
margin-right: 0px !important; margin-right: 0px !important;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -165,10 +165,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'cookie']
title: __('Operate'), title: __('Operate'),
table: table, table: table,
formatter: Controller.api.formatter.operate, formatter: Controller.api.formatter.operate,
align: 'right', align: 'right'
cellStyle: function (value, row, index) {
return {css: {'min-width': '158px'}};
}
}, },
] ]
], ],
@ -241,27 +238,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'cookie']
Layer.close(index); Layer.close(index);
}); });
return false; return false;
} else if (ret && ret.code === -3) {
//插件目录发现影响全局的文件
Layer.open({
content: Template("conflicttpl", ret.data),
shade: 0.8,
area: area,
title: __('Warning'),
btn: [__('Continue install'), __('Cancel')],
end: function () {
},
yes: function (index) {
up.removeFile(file);
file.force = true;
up.uploadFile(file);
Layer.close(index);
}
});
} else {
Layer.alert(ret.msg, {title: __('Warning'), icon: 0});
} }
}); });
@ -504,7 +480,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'cookie']
//如果登录已经超时,重新提醒登录 //如果登录已经超时,重新提醒登录
if (uid && uid != ret.data.uid) { if (uid && uid != ret.data.uid) {
Controller.api.userinfo.set(null); Controller.api.userinfo.set(null);
$(".operate[data-name='" + name + "'] .btn-install:first").trigger("click"); $(".operate[data-name='" + name + "'] .btn-install").trigger("click");
return; return;
} }
top.Fast.api.open(ret.data.payurl, __('Pay now'), { top.Fast.api.open(ret.data.payurl, __('Pay now'), {

View File

@ -20,7 +20,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
table.bootstrapTable({ table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url, url: $.fn.bootstrapTable.defaults.extend.index_url,
sortName: '', sortName: '',
escape: true, escape: false,
columns: [ columns: [
[ [
{field: 'state', checkbox: true,}, {field: 'state', checkbox: true,},
@ -180,7 +180,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
var iconfunc = function () { var iconfunc = function () {
Layer.open({ Layer.open({
type: 1, type: 1,
area: ['80%', '80%'], //宽高 area: ['99%', '98%'], //宽高
content: Template('chooseicontpl', {iconlist: iconlist}) content: Template('chooseicontpl', {iconlist: iconlist})
}); });
}; };
@ -192,8 +192,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
}); });
$(document).on('click', ".btn-search-icon", function () { $(document).on('click', ".btn-search-icon", function () {
if (iconlist.length == 0) { if (iconlist.length == 0) {
$.get(Config.site.cdnurl + "/assets/libs/font-awesome/css/font-awesome.css", function (ret) { $.get(Config.site.cdnurl + "/assets/libs/font-awesome/less/variables.less", function (ret) {
var exp = /fa-(.*):before/ig; var exp = /fa-var-(.*):/ig;
var result; var result;
while ((result = exp.exec(ret)) != null) { while ((result = exp.exec(ret)) != null) {
iconlist.push(result[1]); iconlist.push(result[1]);

View File

@ -167,7 +167,7 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
{ {
field: 'operate', title: __('Operate'), width: 85, events: { field: 'operate', title: __('Operate'), width: 85, events: {
'click .btn-chooseone': function (e, value, row, index) { 'click .btn-chooseone': function (e, value, row, index) {
Fast.api.close($.extend({multiple: multiple}, row)); Fast.api.close({url: row.url, multiple: multiple});
}, },
}, formatter: function () { }, formatter: function () {
return '<a href="javascript:;" class="btn btn-danger btn-chooseone btn-xs"><i class="fa fa-check"></i> ' + __('Choose') + '</a>'; return '<a href="javascript:;" class="btn btn-danger btn-chooseone btn-xs"><i class="fa fa-check"></i> ' + __('Choose') + '</a>';

View File

@ -21,7 +21,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
url: $.fn.bootstrapTable.defaults.extend.index_url, url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id', pk: 'id',
sortName: 'weigh', sortName: 'weigh',
escape: true, escape: false,
columns: [ columns: [
[ [
{checkbox: true}, {checkbox: true},

View File

@ -21,8 +21,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
url: $.fn.bootstrapTable.defaults.extend.index_url, url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id', pk: 'id',
sortName: 'user.id', sortName: 'user.id',
fixedColumns: true,
fixedRightNumber: 1,
columns: [ columns: [
[ [
{checkbox: true}, {checkbox: true},

View File

@ -157,7 +157,7 @@
} else { } else {
key = isArray ? value : key; key = isArray ? value : key;
} }
optionList.push(sprintf("<option value='" + Fast.api.escape(key) + "' %s>" + Fast.api.escape(value) + "</option>", key == vObjCol.defaultValue ? 'selected' : '')); optionList.push(sprintf("<option value='" + key + "' %s>" + value + "</option>", key == vObjCol.defaultValue ? 'selected' : ''));
}); });
return optionList; return optionList;
}; };
@ -208,7 +208,7 @@
} else { } else {
value = process ? process(obj.val()) : obj.val(); value = process ? process(obj.val()) : obj.val();
} }
if (removeempty && (value === '' || value == null || ($.isArray(value) && value.length === 0)) && !sym.match(/null/i)) { if (removeempty && (value == '' || value == null || ($.isArray(value) && value.length == 0)) && !sym.match(/null/i)) {
return true; return true;
} }
@ -268,7 +268,7 @@
return "Common search"; return "Common search";
}, },
formatCommonSubmitButton: function () { formatCommonSubmitButton: function () {
return "Search"; return "Submit";
}, },
formatCommonResetButton: function () { formatCommonResetButton: function () {
return "Reset"; return "Reset";

View File

@ -4,7 +4,7 @@
* @author: karson * @author: karson
* @version: v0.0.1 * @version: v0.0.1
* *
* @update 2017-06-24 <http://github.com/fastadminnet/fastadmin> * @update 2017-06-24 <http://github.com/karsonzhang/fastadmin>
*/ */
!function ($) { !function ($) {

File diff suppressed because one or more lines are too long

View File

@ -102,7 +102,6 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
//绑定select元素事件 //绑定select元素事件
if ($(".selectpicker", form).length > 0) { if ($(".selectpicker", form).length > 0) {
require(['bootstrap-select', 'bootstrap-select-lang'], function () { require(['bootstrap-select', 'bootstrap-select-lang'], function () {
$.fn.selectpicker.Constructor.BootstrapVersion = '3';
$('.selectpicker', form).selectpicker(); $('.selectpicker', form).selectpicker();
$(form).on("reset", function () { $(form).on("reset", function () {
setTimeout(function () { setTimeout(function () {
@ -219,7 +218,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
}; };
var origincallback = function (start, end) { var origincallback = function (start, end) {
$(this.element).val(start.format(this.locale.format) + " - " + end.format(this.locale.format)); $(this.element).val(start.format(this.locale.format) + " - " + end.format(this.locale.format));
$(this.element).trigger('change').trigger('validate'); $(this.element).trigger('change');
}; };
$(".datetimerange", form).each(function () { $(".datetimerange", form).each(function () {
var callback = typeof $(this).data('callback') == 'function' ? $(this).data('callback') : origincallback; var callback = typeof $(this).data('callback') == 'function' ? $(this).data('callback') : origincallback;
@ -227,7 +226,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
callback.call(picker, picker.startDate, picker.endDate); callback.call(picker, picker.startDate, picker.endDate);
}); });
$(this).on('cancel.daterangepicker', function (ev, picker) { $(this).on('cancel.daterangepicker', function (ev, picker) {
$(this).val('').trigger('change').trigger('validate'); $(this).val('').trigger('change');
}); });
$(this).daterangepicker($.extend(true, {}, options, $(this).data() || {}, $(this).data("daterangepicker-options") || {})); $(this).daterangepicker($.extend(true, {}, options, $(this).data() || {}, $(this).data("daterangepicker-options") || {}));
}); });
@ -295,9 +294,6 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
var url = Config.upload.fullmode ? Fast.api.cdnurl(data.url) : data.url; var url = Config.upload.fullmode ? Fast.api.cdnurl(data.url) : data.url;
$("#" + input_id).val(url).trigger("change").trigger("validate"); $("#" + input_id).val(url).trigger("change").trigger("validate");
} }
// 触发选择文件自定义事件
button.trigger("fa.event.selectedfile", data);
} }
}); });
return false; return false;
@ -571,9 +567,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
} }
}; };
// @formatter:on // @formatter:on
var $disabledElements = form.find(':disabled').removeAttr('disabled');
var dataArr = form.serializeArray(), dataObj = {}, fieldName, fieldValue; var dataArr = form.serializeArray(), dataObj = {}, fieldName, fieldValue;
$disabledElements.attr('disabled', 'disabled');
$(dataArr).each(function (i, field) { $(dataArr).each(function (i, field) {
fieldName = field.name; fieldName = field.name;
fieldValue = field.value; fieldValue = field.value;

File diff suppressed because one or more lines are too long

View File

@ -131,7 +131,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
return __('Common search'); return __('Common search');
}, },
formatCommonSubmitButton: function () { formatCommonSubmitButton: function () {
return __('Search'); return __('Submit');
}, },
formatCommonResetButton: function () { formatCommonResetButton: function () {
return __('Reset'); return __('Reset');
@ -764,7 +764,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
suffix = /[\.]?([a-zA-Z0-9]+)$/.exec(value); suffix = /[\.]?([a-zA-Z0-9]+)$/.exec(value);
suffix = suffix ? suffix[1] : 'file'; suffix = suffix ? suffix[1] : 'file';
url = Fast.api.fixurl("ajax/icon?suffix=" + suffix); url = Fast.api.fixurl("ajax/icon?suffix=" + suffix);
html.push('<a href="' + value + '" target="_blank"><img src="' + url + '" class="' + classname + '" width="30" height="30"></a>'); html.push('<a href="' + value + '" target="_blank"><img src="' + url + '" class="' + classname + '"></a>');
}); });
return html.join(' '); return html.join(' ');
}, },
@ -788,7 +788,6 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
if (typeof this.custom !== 'undefined') { if (typeof this.custom !== 'undefined') {
custom = $.extend(custom, this.custom); custom = $.extend(custom, this.custom);
} }
value = row[this.field] || value;
value = value == null || value.length === 0 ? '' : value.toString(); value = value == null || value.length === 0 ? '' : value.toString();
var keys = typeof this.searchList === 'object' ? Object.keys(this.searchList) : []; var keys = typeof this.searchList === 'object' ? Object.keys(this.searchList) : [];
var index = keys.indexOf(value); var index = keys.indexOf(value);
@ -801,8 +800,6 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
if (!display) { if (!display) {
display = __(value.charAt(0).toUpperCase() + value.slice(1)); display = __(value.charAt(0).toUpperCase() + value.slice(1));
} }
value = Fast.api.escape(value);
display = Fast.api.escape(display);
var html = '<span class="text-' + color + '">' + (icon ? '<i class="' + icon + '"></i> ' : '') + display + '</span>'; var html = '<span class="text-' + color + '">' + (icon ? '<i class="' + icon + '"></i> ' : '') + display + '</span>';
if (this.operate != false) { if (this.operate != false) {
html = '<a href="javascript:;" class="searchit" data-toggle="tooltip" title="' + __('Click to search %s', display) + '" data-field="' + this.field + '" data-value="' + value + '">' + html + '</a>'; html = '<a href="javascript:;" class="searchit" data-toggle="tooltip" title="' + __('Click to search %s', display) + '" data-field="' + this.field + '" data-value="' + value + '">' + html + '</a>';
@ -869,15 +866,6 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
value = Fast.api.escape(customValue); value = Fast.api.escape(customValue);
field = this.customField; field = this.customField;
} }
if (typeof that.searchList === 'object' && typeof that.searchList.then === 'function') {
$.when(that.searchList).done(function (ret) {
if (ret.data && ret.data.searchlist && $.isArray(ret.data.searchlist)) {
that.searchList = ret.data.searchlist;
} else if (ret.constructor === Array || ret.constructor === Object) {
that.searchList = ret;
}
})
}
if (typeof that.searchList === 'object' && typeof that.custom === 'undefined') { if (typeof that.searchList === 'object' && typeof that.custom === 'undefined') {
var i = 0; var i = 0;
var searchValues = Object.values(colorArr); var searchValues = Object.values(colorArr);
@ -891,16 +879,14 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
//渲染Flag //渲染Flag
var html = []; var html = [];
var arr = $.isArray(value) ? value : value != '' ? value.split(',') : []; var arr = value != '' ? value.split(',') : [];
var color, display, label; var color, display, label;
$.each(arr, function (i, value) { $.each(arr, function (i, value) {
value = value == null || value.length === 0 ? '' : value.toString(); value = value == null || value.length === 0 ? '' : value.toString();
if (value === '') if (value == '')
return true; return true;
color = value && typeof colorArr[value] !== 'undefined' ? colorArr[value] : 'primary'; color = value && typeof colorArr[value] !== 'undefined' ? colorArr[value] : 'primary';
display = typeof that.searchList !== 'undefined' && typeof that.searchList[value] !== 'undefined' ? that.searchList[value] : __(value.charAt(0).toUpperCase() + value.slice(1)); display = typeof that.searchList !== 'undefined' && typeof that.searchList[value] !== 'undefined' ? that.searchList[value] : __(value.charAt(0).toUpperCase() + value.slice(1));
value = Fast.api.escape(value);
display = Fast.api.escape(display);
label = '<span class="label label-' + color + '">' + display + '</span>'; label = '<span class="label label-' + color + '">' + display + '</span>';
if (that.operate) { if (that.operate) {
html.push('<a href="javascript:;" class="searchit" data-toggle="tooltip" title="' + __('Click to search %s', display) + '" data-field="' + field + '" data-value="' + value + '">' + label + '</a>'); html.push('<a href="javascript:;" class="searchit" data-toggle="tooltip" title="' + __('Click to search %s', display) + '" data-field="' + field + '" data-value="' + value + '">' + label + '</a>');

View File

@ -1,5 +1,5 @@
/** vim: et:ts=4:sw=4:sts=4 /** vim: et:ts=4:sw=4:sts=4
* @license RequireJS 2.3.7 Copyright jQuery Foundation and other contributors. * @license RequireJS 2.3.2 Copyright jQuery Foundation and other contributors.
* Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE
*/ */
//Not using strict: uneven strict support in browsers, #392, and causes //Not using strict: uneven strict support in browsers, #392, and causes
@ -11,7 +11,7 @@ var requirejs, require, define;
(function (global, setTimeout) { (function (global, setTimeout) {
var req, s, head, baseElement, dataMain, src, var req, s, head, baseElement, dataMain, src,
interactiveScript, currentlyAddingScript, mainScript, subPath, interactiveScript, currentlyAddingScript, mainScript, subPath,
version = '2.3.7', version = '2.3.2',
commentRegExp = /\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/mg, commentRegExp = /\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/mg,
cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
jsSuffixRegExp = /\.js$/, jsSuffixRegExp = /\.js$/,
@ -33,8 +33,7 @@ var requirejs, require, define;
contexts = {}, contexts = {},
cfg = {}, cfg = {},
globalDefQueue = [], globalDefQueue = [],
useInteractive = false, useInteractive = false;
disallowedProps = ['__proto__', 'constructor'];
//Could match something like ')//comment', do not lose the prefix to comment. //Could match something like ')//comment', do not lose the prefix to comment.
function commentReplace(match, singlePrefix) { function commentReplace(match, singlePrefix) {
@ -95,7 +94,7 @@ var requirejs, require, define;
function eachProp(obj, func) { function eachProp(obj, func) {
var prop; var prop;
for (prop in obj) { for (prop in obj) {
if (hasProp(obj, prop) && disallowedProps.indexOf(prop) == -1) { if (hasProp(obj, prop)) {
if (func(obj[prop], prop)) { if (func(obj[prop], prop)) {
break; break;
} }
@ -166,7 +165,7 @@ var requirejs, require, define;
* @returns {Error} * @returns {Error}
*/ */
function makeError(id, msg, err, requireModules) { function makeError(id, msg, err, requireModules) {
var e = new Error(msg + '\nhttps://requirejs.org/docs/errors.html#' + id); var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
e.requireType = id; e.requireType = id;
e.requireModules = requireModules; e.requireModules = requireModules;
if (err) { if (err) {
@ -441,9 +440,7 @@ var requirejs, require, define;
//Account for relative paths if there is a base name. //Account for relative paths if there is a base name.
if (name) { if (name) {
if (prefix) { if (prefix) {
if (isNormalized) { if (pluginModule && pluginModule.normalize) {
normalizedName = name;
} else if (pluginModule && pluginModule.normalize) {
//Plugin is loaded, use its normalize method. //Plugin is loaded, use its normalize method.
normalizedName = pluginModule.normalize(name, function (name) { normalizedName = pluginModule.normalize(name, function (name) {
return normalize(name, parentName, applyMap); return normalize(name, parentName, applyMap);
@ -975,8 +972,7 @@ var requirejs, require, define;
//prefix and name should already be normalized, no need //prefix and name should already be normalized, no need
//for applying map config again either. //for applying map config again either.
normalizedMap = makeModuleMap(map.prefix + '!' + name, normalizedMap = makeModuleMap(map.prefix + '!' + name,
this.map.parentMap, this.map.parentMap);
true);
on(normalizedMap, on(normalizedMap,
'defined', bind(this, function (value) { 'defined', bind(this, function (value) {
this.map.normalizedMap = normalizedMap; this.map.normalizedMap = normalizedMap;

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@
@import url("../css/skins/skin-black-blue.css"); @import url("../css/skins/skin-black-blue.css");
@import url("../css/iconfont.css"); @import url("../css/iconfont.css");
@import url("../libs/font-awesome/css/font-awesome.min.css"); @import url("../libs/font-awesome/css/font-awesome.min.css");
@import url("../libs/toastr/build/toastr.min.css"); @import url("../libs/toastr/toastr.min.css");
@import url("../libs/fastadmin-layer/dist/theme/default/layer.css"); @import url("../libs/fastadmin-layer/dist/theme/default/layer.css");
@import url("../libs/bootstrap-table/dist/bootstrap-table.min.css"); @import url("../libs/bootstrap-table/dist/bootstrap-table.min.css");
@import url("../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css"); @import url("../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css");
@ -16,7 +16,7 @@
@import url("../libs/nice-validator/dist/jquery.validator.css"); @import url("../libs/nice-validator/dist/jquery.validator.css");
@import url("../libs/bootstrap-select/dist/css/bootstrap-select.min.css"); @import url("../libs/bootstrap-select/dist/css/bootstrap-select.min.css");
@import url("../libs/fastadmin-selectpage/selectpage.css"); @import url("../libs/fastadmin-selectpage/selectpage.css");
@import url("../libs/bootstrap-slider/dist/css/bootstrap-slider.css"); @import url("../libs/bootstrap-slider/slider.css");
@import "tinycss.less"; @import "tinycss.less";
@main-bg: #f1f4f6; @main-bg: #f1f4f6;