diff --git a/.env.emp b/.env.emp deleted file mode 100644 index fc3c700..0000000 --- a/.env.emp +++ /dev/null @@ -1,15 +0,0 @@ -app_debug=true -app_trace=true - -db_connection=mysql -db_host=localhost -db_database=thinking -db_username=user -db_port=3306 -db_password=password - -redis_host= -redis_port= -redis_password= - - diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 2b6f52c..0000000 --- a/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/.idea -/.vscode -/vendor -*.log -thinkphp -.env -.DS_Store diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 36f7b6f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -sudo: false - -language: php - -branches: - only: - - stable - -cache: - directories: - - $HOME/.composer/cache - -before_install: - - composer self-update - -install: - - composer install --no-dev --no-interaction --ignore-platform-reqs - - zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Core.zip . - - composer require --update-no-dev --no-interaction "topthink/think-image:^1.0" - - composer require --update-no-dev --no-interaction "topthink/think-migration:^1.0" - - composer require --update-no-dev --no-interaction "topthink/think-captcha:^1.0" - - composer require --update-no-dev --no-interaction "topthink/think-mongo:^1.0" - - composer require --update-no-dev --no-interaction "topthink/think-worker:^1.0" - - composer require --update-no-dev --no-interaction "topthink/think-helper:^1.0" - - composer require --update-no-dev --no-interaction "topthink/think-queue:^1.0" - - composer require --update-no-dev --no-interaction "topthink/think-angular:^1.0" - - composer require --dev --update-no-dev --no-interaction "topthink/think-testing:^1.0" - - zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Full.zip . - -script: - - php think unit - -deploy: - provider: releases - api_key: - secure: TSF6bnl2JYN72UQOORAJYL+CqIryP2gHVKt6grfveQ7d9rleAEoxlq6PWxbvTI4jZ5nrPpUcBUpWIJHNgVcs+bzLFtyh5THaLqm39uCgBbrW7M8rI26L8sBh/6nsdtGgdeQrO/cLu31QoTzbwuz1WfAVoCdCkOSZeXyT/CclH99qV6RYyQYqaD2wpRjrhA5O4fSsEkiPVuk0GaOogFlrQHx+C+lHnf6pa1KxEoN1A0UxxVfGX6K4y5g4WQDO5zT4bLeubkWOXK0G51XSvACDOZVIyLdjApaOFTwamPcD3S1tfvuxRWWvsCD5ljFvb2kSmx5BIBNwN80MzuBmrGIC27XLGOxyMerwKxB6DskNUO9PflKHDPI61DRq0FTy1fv70SFMSiAtUv9aJRT41NQh9iJJ0vC8dl+xcxrWIjU1GG6+l/ZcRqVx9V1VuGQsLKndGhja7SQ+X1slHl76fRq223sMOql7MFCd0vvvxVQ2V39CcFKao/LB1aPH3VhODDEyxwx6aXoTznvC/QPepgWsHOWQzKj9ftsgDbsNiyFlXL4cu8DWUty6rQy8zT2b4O8b1xjcwSUCsy+auEjBamzQkMJFNlZAIUrukL/NbUhQU37TAbwsFyz7X0E/u/VMle/nBCNAzgkMwAUjiHM6FqrKKBRWFbPrSIixjfjkCnrMEPw= - file: - - ThinkPHP_Core.zip - - ThinkPHP_Full.zip - skip_cleanup: true - on: - tags: true diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 85dc6ce..0000000 --- a/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 JaguarJack - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 40b6356..0000000 --- a/README.md +++ /dev/null @@ -1,81 +0,0 @@ -# think-admin -# ENV -- php >= 7.1.3 -- mysql >= 5.5 - -# install -- curl -sS http://install.phpcomposer.com/installer | php -- composer config -g repo.packagist composer https://packagist.laravel-china.org -- composer update -- 修改根目录下 .env.emp .env -- .env 配置数据库信息 -- php think migrate:run -- php think seed:run - -# Use -- 配置虚拟域名 OR 在根目录下执行 php think run -- yourUrl/login -- 默认用户名 admin 密码 admin - -# nginx 配置 -``` -server { - listen 端口; - server_name 域名; - - access_log logs/wenwen.access.log; - - root 项目目录/public; - index index.php index.html index.htm; - - location / { - index index.php index.html index.htm; - - if (!-e $request_filename) { - rewrite ^(.*)$ /index.php?s=$1 last; - break; - } - } - - #error_page 404 /404.html; - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root html; - } - - location ~ \.php$ { - root 项目目录/public; - fastcgi_pass phpfastcgi; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi_params; - } - - location ^~ /data { - deny all; - } - } - -``` -# Problem -> SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'updated_at' - -设置 sql_mode; -``` -show variables like 'sql_mode' ; -``` -> remove 'NO_ZERO_IN_DATE,NO_ZERO_DATE' -``` -SET GLOBAL sql_mode='STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' -``` -# Test Address -测试地址 -- 账号:admin -- 密码: 123456 - -# Talking -- 可以提 ISSUE,请按照 issue 模板提问 -- 欢迎进入 Q 群,可以及时反馈一些问题。 --  - -仅供学习 \ No newline at end of file diff --git a/application/.htaccess b/application/.htaccess deleted file mode 100644 index 3418e55..0000000 --- a/application/.htaccess +++ /dev/null @@ -1 +0,0 @@ -deny from all \ No newline at end of file diff --git a/application/admin/controller/Base.php b/application/admin/controller/Base.php deleted file mode 100644 index 1fa2045..0000000 --- a/application/admin/controller/Base.php +++ /dev/null @@ -1,48 +0,0 @@ -limit = $params['limit'] ?? $this->limit; - $this->page = $params['page'] ?? $this->page; - - foreach ($params as $key => $param) { - if (!$param || $key == 'limit' || $key == 'page') { - unset($params[$key]); - } - } - $this->start = $this->start(); - } - - /** - * Table ID Start - * - * @time at 2018年11月16日 - * @return float|int - */ - protected function start() - { - return (int)$this->limit * ((int)$this->page - 1) + 1; - } -} diff --git a/application/admin/controller/Database.php b/application/admin/controller/Database.php deleted file mode 100644 index aad5291..0000000 --- a/application/admin/controller/Database.php +++ /dev/null @@ -1,63 +0,0 @@ -tables = Db::query('SHOW TABLE STATUS'); - - return $this->fetch(); - } - - /** - * 优化表 - * - * @time at 2019年01月18日 - * @return void - */ - public function optimize() - { - $table = $this->request->post('table'); - - if (!$table) { - $this->error('参数错误, 未指定表'); - } - - Db::query(sprintf('optimize table %s', $table)) ? $this->success('优化成功') : $this->error('优化失败'); - - } - - /** - * - * - * @time at 2019年01月18日 - * @return void - */ - public function view() - { - $table = $this->request->param('table'); - - if (!$table) { - $this->error('参数错误', '未指定表'); - } - - $this->table = Db::query('show full columns from ' . $table); - - return $this->fetch(); - } -} \ No newline at end of file diff --git a/application/admin/controller/Index.php b/application/admin/controller/Index.php deleted file mode 100644 index 3e79451..0000000 --- a/application/admin/controller/Index.php +++ /dev/null @@ -1,43 +0,0 @@ -getLoginUser(); - $userHasRoles = $loginUser->getRoles(); - $permissionIds = []; - $userHasRoles->each(function ($role, $key) use (&$permissionIds) { - $permissionIds = array_merge($permissionIds, Roles::getRoleBy($role->id)->getPermissions(false)); - }); - $permissions = Permissions::whereIn('id', $permissionIds)->where('is_show', 1)->select(); - $this->permissions = $menuService->tree($permissions); - $this->loginUser = $loginUser; - return $this->fetch(); - } - - /** - * main - * - * @time at 2018年11月16日 - * @return mixed|string - */ - public function main() - { - return $this->fetch(); - } -} \ No newline at end of file diff --git a/application/admin/controller/Log.php b/application/admin/controller/Log.php deleted file mode 100644 index 6833fd7..0000000 --- a/application/admin/controller/Log.php +++ /dev/null @@ -1,30 +0,0 @@ -request->param(); - $this->checkParams($params); - - $this->list = $logRecordModel->getAll($params, $this->limit); - - return $this->fetch(); - } -} \ No newline at end of file diff --git a/application/admin/controller/Login.php b/application/admin/controller/Login.php deleted file mode 100644 index be37883..0000000 --- a/application/admin/controller/Login.php +++ /dev/null @@ -1,55 +0,0 @@ -request->isPost()) { - $this->authLogin($this->request); - } - - return $this->fetch('/index/login'); - } - - /** - * 登出 - * - * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\think\response\Redirect - */ - public function logout() - { - $this->authLogout(); - - return redirect(url('login')); - } - - /** - * 验证规则 - * - * @time at 2018年11月13日 - * @return array - */ - protected function rule() - { - return [ - $this->name() => 'require', - 'password|密码' => 'require', - 'captcha|验证码' => 'require|captcha' - ]; - } - -} \ No newline at end of file diff --git a/application/admin/controller/Permission.php b/application/admin/controller/Permission.php deleted file mode 100644 index cc4799f..0000000 --- a/application/admin/controller/Permission.php +++ /dev/null @@ -1,78 +0,0 @@ -permissions = new Collection($menuService->sort(Permissions::select())); - return $this->fetch(); - } - - /** - * Create Data - * - * @time at 2018年11月13日 - * @return mixed|string - */ - public function create(PermissionRequest $request, MenuService $menuService) - { - if ($request->isPost()) { - $data = $request->post(); - Permissions::store($data) ? $this->success('添加成功', url('permission/index')) : $this->error('添加失败'); - } - - $this->permissions = $menuService->sort(Permissions::select()); - $this->permissionId = $this->request->param('id') ?? 0; - return $this->fetch(); - } - - /** - * Edit Data - * - * @time at 2018年11月13日 - * @return mixed|string - */ - public function edit(PermissionRequest $request, MenuService $menuService) - { - if ($request->isPost()) { - $data = $request->post(); - Permissions::updateBy($data['id'], $data) !== false ? $this->success('编辑成功', url('permission/index')) : $this->error(''); - } - $permissionId = $this->request->param('id'); - if (!$permissionId) { - $this->error('不存在的数据'); - } - $this->permissions = $menuService->sort(Permissions::select()); - $this->permission = Permissions::getPermissionBy($permissionId); - return $this->fetch(); - } - - /** - * Delete Data - * - * @time at 2018年11月13日 - * @return void - */ - public function delete() - { - $permissionId = $this->request->post('id'); - if (!$permissionId) { - $this->error('不存在数据'); - } - if (Permissions::where('pid', $permissionId)->find()) { - $this->error('请先删除子菜单'); - } - // 删除权限关联的角色信息 - Permissions::detachRole($permissionId); - if (Permissions::deleteBy($permissionId)) { - $this->success('删除成功', url('permission/index')); - } - $this->error('删除失败'); - } -} \ No newline at end of file diff --git a/application/admin/controller/Role.php b/application/admin/controller/Role.php deleted file mode 100644 index c4c724d..0000000 --- a/application/admin/controller/Role.php +++ /dev/null @@ -1,115 +0,0 @@ -roles = Roles::paginate(10); - return $this->fetch(); - } - - /** - * create Data - * - * @time at 2018年11月13日 - * @return mixed|string - */ - public function create(RoleRequest $request) - { - if ($request->isPost()) { - Roles::store($request->post()) ? $this->success('创建成功', url('role/index')) : $this->error('创建失败'); - } - return $this->fetch(); - } - - /** - * Edit Data - * - * @time at 2018年11月13日 - * @return mixed|string - */ - public function edit(RoleRequest $request) - { - if ($this->request->isPost()) { - Roles::updateBy($request->post('id'), $request->post()) !== false ? $this->success('编辑成功', url('role/index')) : $this->error('编辑失败'); - } - - $this->role = Roles::getRoleBy($this->request->param('id')); - return $this->fetch(); - } - - /** - * Delete Data - * - * @time at 2018年11月13日 - * @return void - */ - public function delete() - { - $roleId = $this->request->post('id'); - if (!$roleId) { - $this->error('角色信息不存在'); - } - // 删除角色相关的用户 - Roles::detachUsers($roleId); - // 删除角色相关的权限 - Roles::detachPermissions($roleId); - if (Roles::deleteBy($roleId)) { - $this->success('删除成功', url('role/index')); - } - $this->error('删除失败'); - } - - /** - * 获取角色权限 - * - * @time at 2018年09月21日 - * @return void - */ - public function getPermissionsOfRole(MenuService $menuService) - { - $field = ['name', 'id', 'pid']; - $roleId = $this->request->post('role_id'); - $permissions = Permissions::field($field)->all(); - $roleHasPermissions = Roles::getRoleBy($roleId)->getPermissions(false); - $permissions = $permissions->each(function ($item, $key) use ($roleHasPermissions){ - if (!$item->pid) { - $item->open = true; - } - $item->checked = in_array($item->id, $roleHasPermissions) ? true : false; - return $item; - }); - - header('content-Type: application/json'); - exit(json_encode($menuService->sort($permissions))); - } - - /** - * 分配权限 - * - * @time at 2018年11月15日 - * @return mixed|string - */ - public function givePermissions() - { - if ($this->request->isPost()) { - $postData = $this->request->post(); - $roleId = $postData['role_id']; - if (!isset($postData['permissions'])) { - Roles::detachPermissions($roleId); - $this->success('分配成功', url('role/index')); - } - $permissions = $postData['permissions']; - Roles::detachPermissions($roleId); - Roles::attachPermissions($roleId, $permissions) ? $this->success('分配成功', url('role/index')) : $this->error('分配失败'); - } - $this->role_id = $this->request->param('id'); - return $this->fetch('role/givePermissions'); - } -} \ No newline at end of file diff --git a/application/admin/controller/User.php b/application/admin/controller/User.php deleted file mode 100644 index 97b7208..0000000 --- a/application/admin/controller/User.php +++ /dev/null @@ -1,126 +0,0 @@ -request->param(); - $this->checkParams($params); - $this->users = $userModel->getList($params, $this->limit); - - return $this->fetch(); - } - - /** - * create Data - * - * @time at 2018年11月12日 - * @return mixed|string - */ - public function create(UserModel $userModel, UserRequest $request) - { - if ($request->isPost()) { - $data = $request->post(); - $data['password'] = generatePassword($data['password']); - - if ($userId = $userModel->store($data)) { - // 分配角色 - $this->giveRoles($userModel, $userId, $data); - $this->success('添加成功', url('user/index')); - } - $this->error('添加失败'); - } - - $this->roles = Roles::all(); - return $this->fetch(); - } - - /** - * Edit Data - * - * @time at 2018年11月12日 - * @return mixed|string - */ - public function edit(UserModel $userModel, UserRequest $request) - { - if ($request->isPost()) { - $data = $request->post(); - $this->giveRoles($userModel, $data['id'], $data); - $data['password'] = generatePassword($data['password']); - $userModel->updateBy($data['id'], $data) ? $this->success('修改成功', url('user/index')) : $this->error('修改失败'); - } - - $id = $this->request->param('id'); - if (!$id) { - $this->error('数据不存在'); - } - $user = $userModel->findBy($id); - $userHasRoles = $user->getRoles(false); - $roles = Roles::all()->each(function($item, $key) use ($userHasRoles){ - $item->checked = in_array($item->id, $userHasRoles) ? true : false; - return $item; - }); - - $this->user = $user; - $this->roles = $roles; - return $this->fetch(); - } - - /** - * Delete Data - * - * @time at 2018年11月12日 - * @return void - */ - public function delete(UserModel $userModel) - { - $id = $this->request->post('id'); - - if (!$id) { - $this->error('不存在的数据'); - } - // 删除用户相关的角色 - $userModel->detachRoles($id); - if ($userModel->deleteBy($id)) { - $this->success('删除成功', url('user/index')); - } - $this->error('删除失败'); - } - - /** - * 分配角色 - * - * @time at 2018年11月15日 - * @param \app\model\UserModel $userModel - * @param int $userId - * @param $data - * @return bool - */ - protected function giveRoles(UserModel $userModel, int $userId, &$data) - { - if (isset($data['roles'])) { - $rolesIds = $data['roles']; - if (!is_array($rolesIds)) { - $rolesIds = [$rolesIds]; - } - $userModel->detachRoles($userId); - $userModel->attachRoles($userId, $rolesIds); - unset($data['roles']); - return true; - } - $userModel->detachRoles($userId); - return true; - } -} \ No newline at end of file diff --git a/application/admin/request/FormRequest.php b/application/admin/request/FormRequest.php deleted file mode 100644 index 5eef447..0000000 --- a/application/admin/request/FormRequest.php +++ /dev/null @@ -1,30 +0,0 @@ - - * Date: 2018/11/29 0029 21:56 - */ -namespace app\admin\request; - -use think\exception\HttpResponseException; -use think\Request; - -abstract class FormRequest extends Request -{ - - /** - * FormRequest constructor. - */ - public function __construct() - { - parent::__construct(); - - if ($this->withServer($_SERVER)->isAjax(true) && $err = $this->validate()) { - throw new HttpResponseException(json([ - 'code' => 0, - 'msg' => $err, - 'wait' => 3, - ])); - } - } -} \ No newline at end of file diff --git a/application/admin/request/PermissionRequest.php b/application/admin/request/PermissionRequest.php deleted file mode 100644 index 1c36b1f..0000000 --- a/application/admin/request/PermissionRequest.php +++ /dev/null @@ -1,17 +0,0 @@ - - * Date: 2018/11/29 0029 21:56 - */ -namespace app\admin\request; - -use app\admin\validates\PermissionValidate; - -class PermissionRequest extends FormRequest -{ - public function validate() - { - return (new PermissionValidate())->getErrors($this->post()); - } -} \ No newline at end of file diff --git a/application/admin/request/RoleRequest.php b/application/admin/request/RoleRequest.php deleted file mode 100644 index 0728039..0000000 --- a/application/admin/request/RoleRequest.php +++ /dev/null @@ -1,17 +0,0 @@ - - * Date: 2018/11/29 0029 21:56 - */ -namespace app\admin\request; - -use app\admin\validates\RoleValidate; - -class RoleRequest extends FormRequest -{ - public function validate() - { - return (new RoleValidate())->getErrors($this->post()); - } -} \ No newline at end of file diff --git a/application/admin/request/UserRequest.php b/application/admin/request/UserRequest.php deleted file mode 100644 index ece3885..0000000 --- a/application/admin/request/UserRequest.php +++ /dev/null @@ -1,17 +0,0 @@ - - * Date: 2018/11/29 0029 21:56 - */ -namespace app\admin\request; - -use app\admin\validates\UserValidate; - -class UserRequest extends FormRequest -{ - public function validate() - { - return (new UserValidate())->getErrors($this->post()); - } -} \ No newline at end of file diff --git a/application/admin/validates/AbstractValidate.php b/application/admin/validates/AbstractValidate.php deleted file mode 100644 index bbbc103..0000000 --- a/application/admin/validates/AbstractValidate.php +++ /dev/null @@ -1,35 +0,0 @@ -check($data); - - return $this->getError(); - } - - - public function __set($name, $value) - { - // TODO: Implement __set() method. - $this->rule[$name] = $value; - } -} \ No newline at end of file diff --git a/application/admin/validates/PermissionValidate.php b/application/admin/validates/PermissionValidate.php deleted file mode 100644 index f3359f3..0000000 --- a/application/admin/validates/PermissionValidate.php +++ /dev/null @@ -1,19 +0,0 @@ - 'require|min:2|max:10|chs|unique:permissions', - 'module|模块名称' => 'require|min:2|max:10|alpha', - 'controller|控制器名称' => 'require|min:2|max:50|alpha', - 'action|方法名称' => 'require|min:2|max:50|alpha', - ]; -} \ No newline at end of file diff --git a/application/admin/validates/RoleValidate.php b/application/admin/validates/RoleValidate.php deleted file mode 100644 index d06240a..0000000 --- a/application/admin/validates/RoleValidate.php +++ /dev/null @@ -1,15 +0,0 @@ - 'require|min:3|max:15|chs|unique:roles', - ]; -} \ No newline at end of file diff --git a/application/admin/validates/UserValidate.php b/application/admin/validates/UserValidate.php deleted file mode 100644 index 59d9245..0000000 --- a/application/admin/validates/UserValidate.php +++ /dev/null @@ -1,18 +0,0 @@ - 'require|min:3|max:15|alphaNum|unique:users', - 'email|邮箱' => 'email|unique:users', - 'password|密码' => 'confirm|min:6|max:20|alphaDash', - ]; -} \ No newline at end of file diff --git a/application/behavior/LoginRecord.php b/application/behavior/LoginRecord.php deleted file mode 100644 index 25c6e5b..0000000 --- a/application/behavior/LoginRecord.php +++ /dev/null @@ -1,20 +0,0 @@ -login_at = date('Y-m-d h:i:s', time()); - $user->login_ip = request()->ip(); - $user->save(); - } -} \ No newline at end of file diff --git a/application/command.php b/application/command.php deleted file mode 100644 index b069390..0000000 --- a/application/command.php +++ /dev/null @@ -1,15 +0,0 @@ - -// +---------------------------------------------------------------------- - -return [ - 'make:curd' => app\command\MakeCurd::class, - 'rbac:publish' => think\permissions\command\PermissionPublish::class, -]; diff --git a/application/command/MakeCurd.php b/application/command/MakeCurd.php deleted file mode 100644 index 735b361..0000000 --- a/application/command/MakeCurd.php +++ /dev/null @@ -1,154 +0,0 @@ -appPath = env('app_path'); - $this->stubPath = $this->appPath . 'command' . DIRECTORY_SEPARATOR . 'stub' .DIRECTORY_SEPARATOR; - } - - protected function configure() - { - $this->setName('make:curd') - ->addArgument('controller', Argument::OPTIONAL, "controller name") - ->addArgument('model', Argument::OPTIONAL, "model name") - ->addOption('module', null, Option::VALUE_REQUIRED, 'module name') - ->setDescription('Create curd option controller model --module?'); - } - - protected function execute(Input $input, Output $output) - { - // 首先获取默认模块 - $moduleName = config('app.default_module'); - $controllerName = trim($input->getArgument('controller')); - if (!$controllerName) { - $output->writeln('Controller Name Must Set');exit; - } - - $modelName = trim($input->getArgument('model')); - - if (!$modelName) { - $output->writeln('Model Name Must Set');exit; - } - - if ($input->hasOption('module')) { - $moduleName = $input->getOption('module'); - } - - $this->makeController($controllerName, $moduleName); - $output->writeln($controllerName . ' controller create success'); - $this->makeModel($modelName, $moduleName); - $output->writeln($modelName . ' model create success'); - $this->makeView($controllerName, $moduleName); - $output->writeln($controllerName . ' view create success'); - } - // 创建控制器文件 - protected function makeController($controllerName, $moduleName) - { - $controllerStub = $this->stubPath . 'Controller.stub'; - $controllerStub = str_replace(['$controller', '$module'], [ucfirst($controllerName), strtolower($moduleName)], file_get_contents($controllerStub)); - $controllerPath = $this->appPath . $moduleName . DIRECTORY_SEPARATOR . 'controller' . DIRECTORY_SEPARATOR; - if (!is_dir($controllerPath)) { - mkdir($controllerPath, 0777, true); - } - return file_put_contents( $controllerPath . $controllerName . '.php', $controllerStub); - } - // 创建模型文件 - public function makeModel($modelName, $moduleName) - { - $modelPath = $this->appPath . DIRECTORY_SEPARATOR . 'model'; - if (!is_dir($modelPath)) { - mkdir($modelPath, 0777, true); - } - $modelContents = "writeField($modelContents, $modelName); - $modelContents = str_replace('$model', ucfirst($modelName), $modelContents); - $modelContents = str_replace('$_table', $this->unCamelize($modelName), $modelContents); - $modelContents .= "\r\n }"; - - return file_put_contents($modelPath . DIRECTORY_SEPARATOR . $modelName . 'Model.php', $modelContents); - } - - private function writeField($modelContents, $modelName) - { - $info = Db::query('show full columns from ' . config('database.prefix') . $this->unCamelize($modelName)); - foreach ($info as $value) { - $modelContents .= sprintf("\r\n %s \t protected $%s = '%s'; \r\n", $this->fieldComment($value['Comment']), $this->combine($value['Field']), $value['Field']); - } - - return $modelContents; - } - // 创建模板 - public function makeView($controllerName, $moduleName) - { - $viewStub = $this->stubPath . 'View.stub'; - $viewPath = (config('template.view_base') ? config('template.view_base') . $moduleName . DIRECTORY_SEPARATOR : env('app_path') . $moduleName . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR) . strtolower($controllerName); - if (!is_dir($viewPath)) { - mkdir($viewPath, 0777, true); - } - - $stub = explode('||', file_get_contents($viewStub)); - - foreach ($this->views as $view) { - if ($view == 'index') { - file_put_contents($viewPath . DIRECTORY_SEPARATOR . $view .'.html', trim($stub[0])); - } else { - file_put_contents($viewPath . DIRECTORY_SEPARATOR . $view .'.html', trim($stub[1])); - } - } - } - - /** - * 字符注释 - * - * @time at 2019年01月08日 - * @param $comment - * @return string - */ - private function fieldComment($comment) - { - return sprintf("\t /** \r\n \t * @var string \r\n \t * @desc %s \r\n \t */ \r\n", $comment); - } - /** - * 驼峰分割 - * - * @time at 2019年01月02日 - * @param string $camelCaps - * @param string $separator - * @return string - */ - private function unCamelize(string $string, string $separator = '_') - { - return strtolower(preg_replace('/(?<=[a-z])([A-Z])/', $separator . '$1', $string)); - } - - private function combine(string $string) - { - $s = explode('_', $string); - array_walk($s, function (&$value, $key) { - if ($key) { - $value = ucfirst($value); - } - }); - return implode($s, ''); - } -} \ No newline at end of file diff --git a/application/command/stub/Controller.stub b/application/command/stub/Controller.stub deleted file mode 100644 index a417fc9..0000000 --- a/application/command/stub/Controller.stub +++ /dev/null @@ -1,20 +0,0 @@ -fetch(); - } - public function create() - { - return $this->fetch(); - } - public function edit() - { - return $this->fetch(); - } - public function delete() - {} -} \ No newline at end of file diff --git a/application/command/stub/View.stub b/application/command/stub/View.stub deleted file mode 100644 index afd9c52..0000000 --- a/application/command/stub/View.stub +++ /dev/null @@ -1,12 +0,0 @@ -{extend name="public:base" /} -{block name="menu"}{/block} -{block name="search"}{/block} -{block name="button-create"}{/block} -{block name="table-head"}{/block} -{block name="table-body"}{/block} -{block name="paginate"}{/block} -|| -{extend name="public:form" /} -{block name="menu"}{/block} -{block name='action'}{/block} -{block name="form"}{/block} diff --git a/application/common.php b/application/common.php deleted file mode 100644 index 4c0eca6..0000000 --- a/application/common.php +++ /dev/null @@ -1,67 +0,0 @@ - -// +---------------------------------------------------------------------- - -// 应用公共文件 - -/** - * 钩子行为 - */ -if (!function_exists('hook')) { - function hook($behavior, $params) { - \think\facade\Hook::exec($behavior, $params); - } -} - -/** - * 编辑按钮 - */ -if (!function_exists('editButton')) { - function editButton(string $url, string $name = '编辑') { - return sprintf('', $url, $name); - } -} - -/** - * 增加按钮 - */ -if (!function_exists('createButton')) { - function createButton(string $url, string $name, $isBig = true) { - return $isBig ? sprintf(' ', $url, $name) : - sprintf(' ', $url, $name); - } -} - -/** - * 删除按钮 - */ -if (!function_exists('deleteButton')) { - function deleteButton(string $url, int $id, string $name="删除") { - return sprintf('', $url, $id, $name); - } -} - -/** - * 搜索按钮 - */ -if (!function_exists('searchButton')) { - function searchButton(string $name="搜索") { - return sprintf('', $name); - } -} - -/** - * 生成密码 - */ -if (!function_exists('generatePassword')) { - function generatePassword(string $password, int $algo = PASSWORD_DEFAULT) { - return password_hash($password, $algo); - } -} diff --git a/application/component/upload/LocalUpload.php b/application/component/upload/LocalUpload.php deleted file mode 100644 index 81c92c1..0000000 --- a/application/component/upload/LocalUpload.php +++ /dev/null @@ -1,60 +0,0 @@ -name); - if (!$this->name) { - throw new UploadException('请选择上传的图片'); - } - $info = $file->validate(config('admin.image'))->move(config('admin.local_upload_path')); - if (!$info) { - throw new UploadException($file->getError()); - } - return $info->getSaveName(); - } catch (UploadException $exception) { - return $exception->getMessage(); - } - } - /** - * Set Image Name - * - * @time at 2018年11月16日 - * @param $name - * @return $this - */ - public function name($name) - { - $this->name = $name; - return $this; - } -} \ No newline at end of file diff --git a/application/component/upload/UploadInterface.php b/application/component/upload/UploadInterface.php deleted file mode 100644 index f538216..0000000 --- a/application/component/upload/UploadInterface.php +++ /dev/null @@ -1,15 +0,0 @@ -session('user')) { - return redirect(url('login')); - } - - return $next($request); - } -} diff --git a/application/http/middleware/LogRecord.php b/application/http/middleware/LogRecord.php deleted file mode 100644 index 38e32f1..0000000 --- a/application/http/middleware/LogRecord.php +++ /dev/null @@ -1,16 +0,0 @@ -record($request); - - return $next($request); - } -} diff --git a/application/model/BaseModel.php b/application/model/BaseModel.php deleted file mode 100644 index d3bf2d7..0000000 --- a/application/model/BaseModel.php +++ /dev/null @@ -1,64 +0,0 @@ -save($data) ? $this->id : false; - } - - /** - * Find By ID - * - * @time at 2018年11月12日 - * @param int $id - * @return array|false|\PDOStatement|string|\think\Model - */ - public function findBy(int $id) - { - return $this->where('id', $id)->find(); - } - - /** - * Update By ID && Data - * - * @time at 2018年11月12日 - * @param int $id - * @param array $data - * @return bool - */ - public function updateBy(int $id, array $data) - { - return $this->save($data, ['id' => $id]); - } - - /** - * Delete By ID - * - * @time at 2018年11月12日 - * @param int $id - * @return bool|null - */ - public function deleteBy(int $id) - { - return $this->where('id', $id)->delete(); - } -} \ No newline at end of file diff --git a/application/model/LogRecordModel.php b/application/model/LogRecordModel.php deleted file mode 100644 index fadc25f..0000000 --- a/application/model/LogRecordModel.php +++ /dev/null @@ -1,36 +0,0 @@ -order('created_at', 'desc')->paginate($limit, false, ['query' => request()->param()]); - } - - if (isset($params['name'])) { - $list = $this->whereLike('user_name', '%'.$params['name'].'%'); - } - - return $list->order('created_at', 'desc')->paginate($limit, false, ['query' => request()->param()]); - } -} \ No newline at end of file diff --git a/application/model/UserModel.php b/application/model/UserModel.php deleted file mode 100644 index d71e1a9..0000000 --- a/application/model/UserModel.php +++ /dev/null @@ -1,37 +0,0 @@ -paginate($limit); - } - - - if (isset($params['name'])) { - $user = $this->whereLike('name', '%'.$params['name'].'%'); - } - if (isset($params['email'])) { - $user = $this->whereLike('email', '%'.$params['email'].'%'); - } - - return $user->paginate($limit, false, ['query' => request()->param()]); - } - -} \ No newline at end of file diff --git a/application/provider.php b/application/provider.php deleted file mode 100644 index e474e82..0000000 --- a/application/provider.php +++ /dev/null @@ -1,15 +0,0 @@ - -// +---------------------------------------------------------------------- - -// 应用容器绑定定义 -return [ - -]; diff --git a/application/service/LogService.php b/application/service/LogService.php deleted file mode 100644 index b013f59..0000000 --- a/application/service/LogService.php +++ /dev/null @@ -1,35 +0,0 @@ -module(); - $controller = $request->controller(); - $action = $request->action(); - $user = $request->session('user'); - $permission = Permissions::getPermissionByModuleAnd($module, $controller, $action); - - (new LogRecordModel())->store([ - 'user_id' => $user->id, - 'user_name' => $user->name, - 'module' => $module, - 'controller' => $controller, - 'action' => $action, - 'option' => $permission->name, - 'method' => $request->method(), - ]); - } -} diff --git a/application/service/MenuService.php b/application/service/MenuService.php deleted file mode 100644 index 1491119..0000000 --- a/application/service/MenuService.php +++ /dev/null @@ -1,55 +0,0 @@ -each(function ($item, $key) use ($pid, $menus, $collection){ - if ($item->pid == $pid) { - $collection[$key] = $item; - $collection[$key][$item->id] = $this->tree($menus, $item->id); - } - }); - - return $collection; - } - - /** - * 顺序结构 - * - * @time at 2018年11月13日 - * @param $menu - * @return Collection - */ - public function sort(Collection $menus, int $pid = 0, int $level = 0) - { - $collection = []; - foreach ($menus as $menu) { - if ($menu->pid == $pid) { - $menu->level = $level; - $collection[] = $menu; - $collection = array_merge($collection, $this->sort($menus, $menu->id, $level+1)); - } - } - return $collection; - } -} \ No newline at end of file diff --git a/application/service/PaginateService.php b/application/service/PaginateService.php deleted file mode 100644 index 07106e1..0000000 --- a/application/service/PaginateService.php +++ /dev/null @@ -1,63 +0,0 @@ -hasPages()) { - if ($this->simple) { - return sprintf( - '
您单击了 ' + node.text + '
'); - } - }); - - // $('#treeview11').on('nodeSelected', function (event, node) { - // $('#event_output').prepend('您单击了 ' + node.text + '
'); - // }); - - - $('#treeview12').treeview({ - data: json - }); - -}); diff --git a/public/assets/js/demo/webuploader-demo.js b/public/assets/js/demo/webuploader-demo.js deleted file mode 100644 index 4f2f35d..0000000 --- a/public/assets/js/demo/webuploader-demo.js +++ /dev/null @@ -1,438 +0,0 @@ -jQuery(function() { - var $ = jQuery, // just in case. Make sure it's not an other libaray. - - $wrap = $('#uploader'), - - // 图片容器 - $queue = $('' + file.name + '
' + - ''+ - '' + - '
")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,a,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,h],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),o=c[n],a=0===this.alpha()?l("transparent"):this,r=a[o.cache]||o.to(a._rgba),h=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],l=s[o],c=u[n.type]||{};null!==l&&(null===a?h[o]=l:(c.mod&&(l-a>c.mod/2?a+=c.mod:a-l>c.mod/2&&(a-=c.mod)),h[o]=i((l-a)*e+a,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),h=Math.min(s,n,o),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-o)/l+360:n===r?60*(o-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[a]&&(this[a]=h(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[a]=d,n):l(d)},f(o,function(e,i){l.fn[e]||(l.fn[e]=function(n){var o,a=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=l(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function s(e,i){var s,n,a={};for(s in i)n=i[s],e[s]!==n&&(o[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(a[s]=n));return a}var n=["add","remove","toggle"],o={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,o,a,r){var h=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",l=h.children?a.find("*").addBack():a;l=l.map(function(){var e=t(this);return{el:e,start:i(this)}}),o=function(){t.each(n,function(t,i){e[i]&&a[i+"Class"](e[i])})},o(),l=l.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),a.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,o,a,r){return"boolean"==typeof n||n===e?o?t.effects.animateClass.call(this,n?{add:s}:{remove:s},o,a,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,o,a)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.4",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,o;for(o=0;s.length>o;o++)null!==s[o]&&(n=t.data(i+s[o]),n===e&&(n=""),t.css(s[o],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("
").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(o)&&o.call(n[0]),t.isFunction(e)&&e()}var n=t(this),o=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):a.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,o=i.queue,a=t.effects.effect[i.effect];return t.fx.off||!a?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):o===!1?this.each(e):this.queue(o||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()}(jQuery),function(t){var e=0,i={},s={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",s.height=s.paddingTop=s.paddingBottom=s.borderTopWidth=s.borderBottomWidth="show",t.widget("ui.accordion",{version:"1.10.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t(),content:this.active.length?this.active.next():t()}},_createIcons:function(){var e=this.options.icons;e&&(t("").addClass("ui-accordion-header-icon ui-icon "+e.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(e.header).addClass(e.activeHeader),this.headers.addClass("ui-accordion-icons")) -},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),undefined):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),"disabled"===t&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!e),undefined)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),o=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:o=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[s-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),o.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().focus()},refresh:function(){var e=this.options;this._processPanels(),e.active===!1&&e.collapsible===!0||!this.headers.length?(e.active=!1,this.active=t()):e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,s=this.options,n=s.heightStyle,o=this.element.parent(),a=this.accordionId="ui-accordion-"+(this.element.attr("id")||++e);this.active=this._findActive(s.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(e){var i=t(this),s=i.attr("id"),n=i.next(),o=n.attr("id");s||(s=a+"-header-"+e,i.attr("id",s)),o||(o=a+"-panel-"+e,n.attr("id",o)),i.attr("aria-controls",o),n.attr("aria-labelledby",s)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(s.event),"fill"===n?(i=o.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.headers.each(function(){i-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===n&&(i=0,this.headers.next().each(function(){i=Math.max(i,t(this).css("height","").height())}).height(i))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n[0]===s[0],a=o&&i.collapsible,r=a?t():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:a?t():n,newPanel:r};e.preventDefault(),o&&!i.collapsible||this._trigger("beforeActivate",e,l)===!1||(i.active=a?!1:this.headers.index(n),this.active=o?t():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),o||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-hidden":"true"}),s.prev().attr("aria-selected","false"),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(t,e,n){var o,a,r,h=this,l=0,c=t.length&&(!e.length||t.index()