From d5173c95b31843a169a4c7d50987067d3fd77fd3 Mon Sep 17 00:00:00 2001 From: pppscn <35696959@qq.com> Date: Tue, 27 Nov 2018 21:49:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=B5=8B=E8=AF=95=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/.DS_Store | Bin 6148 -> 0 bytes application/admin/.DS_Store | Bin 6148 -> 0 bytes application/admin/controller/Docs.php | 214 -------- application/admin/controller/Test.php | 50 -- application/admin/controller/cms/Ajax.php | 59 --- application/admin/controller/cms/Archives.php | 363 ------------- application/admin/controller/cms/Block.php | 55 -- application/admin/controller/cms/Channel.php | 181 ------- application/admin/controller/cms/Comment.php | 64 --- application/admin/controller/cms/Diydata.php | 178 ------- application/admin/controller/cms/Diyform.php | 27 - application/admin/controller/cms/Fields.php | 114 ----- application/admin/controller/cms/Modelx.php | 26 - application/admin/controller/cms/Page.php | 63 --- application/admin/controller/cms/Tags.php | 46 -- .../admin/controller/example/Baidumap.php | 41 -- .../controller/example/Bootstraptable.php | 121 ----- .../admin/controller/example/Colorbadge.php | 24 - .../controller/example/Controllerjump.php | 24 - .../admin/controller/example/Customsearch.php | 26 - .../admin/controller/example/Cxselect.php | 23 - .../admin/controller/example/Multitable.php | 95 ---- .../controller/example/Relationmodel.php | 52 -- .../controller/example/Tabletemplate.php | 60 --- .../admin/controller/general/Database.php | 290 ----------- .../admin/controller/wechat/Autoreply.php | 67 --- .../admin/controller/wechat/Config.php | 126 ----- application/admin/controller/wechat/Menu.php | 90 ---- .../admin/controller/wechat/Response.php | 79 --- application/admin/lang/zh-cn/cms/archives.php | 48 -- application/admin/lang/zh-cn/cms/block.php | 13 - application/admin/lang/zh-cn/cms/channel.php | 30 -- application/admin/lang/zh-cn/cms/comment.php | 19 - application/admin/lang/zh-cn/cms/diydata.php | 8 - application/admin/lang/zh-cn/cms/diyform.php | 16 - application/admin/lang/zh-cn/cms/fields.php | 45 -- application/admin/lang/zh-cn/cms/modelx.php | 15 - application/admin/lang/zh-cn/cms/page.php | 22 - application/admin/lang/zh-cn/cms/tags.php | 7 - .../admin/lang/zh-cn/crm/tenant/tags.php | 8 - application/admin/lang/zh-cn/docs.php | 17 - .../admin/lang/zh-cn/general/database.php | 43 -- application/admin/lang/zh-cn/test.php | 47 -- .../admin/lang/zh-cn/wechat/autoreply.php | 8 - .../admin/lang/zh-cn/wechat/config.php | 10 - .../admin/lang/zh-cn/wechat/response.php | 8 - application/admin/model/Archives.php | 138 ----- application/admin/model/Area.php | 16 - application/admin/model/Block.php | 34 -- application/admin/model/Channel.php | 97 ---- application/admin/model/Comment.php | 58 --- application/admin/model/Diyform.php | 59 --- application/admin/model/Fields.php | 143 ------ application/admin/model/Modelx.php | 36 -- application/admin/model/Page.php | 61 --- application/admin/model/Tags.php | 27 - application/admin/model/Test.php | 143 ------ application/admin/validate/Archives.php | 27 - application/admin/validate/Block.php | 27 - application/admin/validate/Channel.php | 27 - application/admin/validate/Comment.php | 27 - application/admin/validate/CrmTenant.php | 27 - application/admin/validate/CrmTenantTags.php | 27 - application/admin/validate/Fields.php | 49 -- application/admin/validate/Modelx.php | 27 - application/admin/validate/Page.php | 27 - application/admin/validate/Tags.php | 27 - application/admin/validate/Test.php | 27 - application/admin/view/cms/archives/add.html | 198 -------- .../admin/view/cms/archives/content.html | 29 -- application/admin/view/cms/archives/edit.html | 207 -------- .../admin/view/cms/archives/fields.html | 102 ---- .../admin/view/cms/archives/index.html | 93 ---- .../admin/view/cms/archives/recyclebin.html | 23 - application/admin/view/cms/block/add.html | 66 --- application/admin/view/cms/block/edit.html | 66 --- application/admin/view/cms/block/index.html | 28 -- application/admin/view/cms/channel/add.html | 130 ----- application/admin/view/cms/channel/edit.html | 136 ----- application/admin/view/cms/channel/index.html | 37 -- application/admin/view/cms/comment/add.html | 82 --- application/admin/view/cms/comment/edit.html | 82 --- application/admin/view/cms/comment/index.html | 32 -- application/admin/view/cms/diydata/add.html | 17 - application/admin/view/cms/diydata/edit.html | 17 - .../admin/view/cms/diydata/fields.html | 102 ---- application/admin/view/cms/diydata/index.html | 29 -- application/admin/view/cms/diyform/add.html | 79 --- application/admin/view/cms/diyform/edit.html | 79 --- application/admin/view/cms/diyform/index.html | 24 - application/admin/view/cms/diyform/tpl.html | 66 --- application/admin/view/cms/fields/add.html | 131 ----- application/admin/view/cms/fields/edit.html | 132 ----- application/admin/view/cms/fields/index.html | 36 -- application/admin/view/cms/modelx/add.html | 40 -- application/admin/view/cms/modelx/edit.html | 40 -- application/admin/view/cms/modelx/index.html | 24 - application/admin/view/cms/modelx/tpl.html | 66 --- application/admin/view/cms/page/add.html | 96 ---- application/admin/view/cms/page/edit.html | 107 ---- application/admin/view/cms/page/index.html | 36 -- application/admin/view/cms/tags/add.html | 28 -- application/admin/view/cms/tags/edit.html | 28 -- application/admin/view/cms/tags/index.html | 21 - application/admin/view/docs/add.html | 63 --- application/admin/view/docs/edit.html | 57 --- application/admin/view/docs/index.html | 23 - .../admin/view/example/baidumap/index.html | 21 - .../admin/view/example/baidumap/map.html | 30 -- .../view/example/bootstraptable/detail.html | 33 -- .../view/example/bootstraptable/index.html | 49 -- .../admin/view/example/colorbadge/index.html | 21 - .../view/example/controllerjump/index.html | 21 - .../view/example/customsearch/index.html | 116 ----- .../admin/view/example/cxselect/index.html | 160 ------ .../admin/view/example/multitable/index.html | 27 - .../view/example/relationmodel/index.html | 21 - .../view/example/tabletemplate/index.html | 67 --- .../admin/view/general/database/index.html | 114 ----- application/admin/view/test/add.html | 208 -------- application/admin/view/test/edit.html | 208 -------- application/admin/view/test/index.html | 30 -- application/admin/view/wechat/.DS_Store | Bin 8196 -> 0 bytes .../admin/view/wechat/autoreply/add.html | 51 -- .../admin/view/wechat/autoreply/edit.html | 51 -- .../admin/view/wechat/autoreply/index.html | 28 -- application/admin/view/wechat/config/add.html | 45 -- .../admin/view/wechat/config/edit.html | 47 -- .../admin/view/wechat/config/index.html | 28 -- application/admin/view/wechat/menu/index.html | 84 ---- .../admin/view/wechat/response/add.html | 48 -- .../admin/view/wechat/response/edit.html | 52 -- .../admin/view/wechat/response/index.html | 21 - .../admin/view/wechat/response/select.html | 16 - application/common/model/MoneyLog.php | 23 - application/common/model/WechatAutoreply.php | 16 - application/common/model/WechatConfig.php | 32 -- application/common/model/WechatContext.php | 16 - application/common/model/WechatResponse.php | 16 - application/index/controller/cms/Archives.php | 240 --------- application/index/controller/cms/Diyform.php | 54 -- application/index/lang/zh-cn/cms/archives.php | 14 - application/index/lang/zh-cn/cms/diyform.php | 7 - .../index/view/cms/archives/fields.html | 100 ---- application/index/view/cms/archives/my.html | 65 --- application/index/view/cms/archives/post.html | 107 ---- application/index/view/cms/common/fields.html | 100 ---- application/index/view/cms/diyform/index.html | 46 -- public/admin.php.bak | 38 -- public/assets/js/backend/cms/archives.js | 476 ------------------ public/assets/js/backend/cms/block.js | 57 --- public/assets/js/backend/cms/channel.js | 179 ------- public/assets/js/backend/cms/comment.js | 62 --- public/assets/js/backend/cms/diydata.js | 109 ---- public/assets/js/backend/cms/diyform.js | 102 ---- public/assets/js/backend/cms/fields.js | 67 --- public/assets/js/backend/cms/modelx.js | 105 ---- public/assets/js/backend/cms/page.js | 61 --- public/assets/js/backend/cms/tags.js | 54 -- public/assets/js/backend/docs.js | 70 --- public/assets/js/backend/example/baidumap.js | 102 ---- .../js/backend/example/bootstraptable.js | 278 ---------- .../assets/js/backend/example/colorbadge.js | 52 -- .../js/backend/example/controllerjump.js | 59 --- .../assets/js/backend/example/customsearch.js | 63 --- public/assets/js/backend/example/cxselect.js | 14 - .../assets/js/backend/example/multitable.js | 93 ---- .../js/backend/example/relationmodel.js | 47 -- .../js/backend/example/tabletemplate.js | 115 ----- public/assets/js/backend/general/database.js | 115 ----- public/assets/js/backend/test.js | 98 ---- public/assets/js/backend/wechat/autoreply.js | 77 --- public/assets/js/backend/wechat/config.js | 97 ---- public/assets/js/backend/wechat/menu.js | 293 ----------- public/assets/js/backend/wechat/response.js | 178 ------- public/assets/js/frontend/cms/archives.js | 27 - public/assets/js/frontend/cms/diyform.js | 13 - 177 files changed, 12239 deletions(-) delete mode 100644 application/.DS_Store delete mode 100644 application/admin/.DS_Store delete mode 100644 application/admin/controller/Docs.php delete mode 100644 application/admin/controller/Test.php delete mode 100644 application/admin/controller/cms/Ajax.php delete mode 100644 application/admin/controller/cms/Archives.php delete mode 100644 application/admin/controller/cms/Block.php delete mode 100644 application/admin/controller/cms/Channel.php delete mode 100644 application/admin/controller/cms/Comment.php delete mode 100644 application/admin/controller/cms/Diydata.php delete mode 100644 application/admin/controller/cms/Diyform.php delete mode 100644 application/admin/controller/cms/Fields.php delete mode 100644 application/admin/controller/cms/Modelx.php delete mode 100644 application/admin/controller/cms/Page.php delete mode 100644 application/admin/controller/cms/Tags.php delete mode 100644 application/admin/controller/example/Baidumap.php delete mode 100644 application/admin/controller/example/Bootstraptable.php delete mode 100644 application/admin/controller/example/Colorbadge.php delete mode 100644 application/admin/controller/example/Controllerjump.php delete mode 100644 application/admin/controller/example/Customsearch.php delete mode 100644 application/admin/controller/example/Cxselect.php delete mode 100644 application/admin/controller/example/Multitable.php delete mode 100644 application/admin/controller/example/Relationmodel.php delete mode 100644 application/admin/controller/example/Tabletemplate.php delete mode 100644 application/admin/controller/general/Database.php delete mode 100644 application/admin/controller/wechat/Autoreply.php delete mode 100644 application/admin/controller/wechat/Config.php delete mode 100644 application/admin/controller/wechat/Menu.php delete mode 100644 application/admin/controller/wechat/Response.php delete mode 100644 application/admin/lang/zh-cn/cms/archives.php delete mode 100644 application/admin/lang/zh-cn/cms/block.php delete mode 100644 application/admin/lang/zh-cn/cms/channel.php delete mode 100644 application/admin/lang/zh-cn/cms/comment.php delete mode 100644 application/admin/lang/zh-cn/cms/diydata.php delete mode 100644 application/admin/lang/zh-cn/cms/diyform.php delete mode 100644 application/admin/lang/zh-cn/cms/fields.php delete mode 100644 application/admin/lang/zh-cn/cms/modelx.php delete mode 100644 application/admin/lang/zh-cn/cms/page.php delete mode 100644 application/admin/lang/zh-cn/cms/tags.php delete mode 100644 application/admin/lang/zh-cn/crm/tenant/tags.php delete mode 100644 application/admin/lang/zh-cn/docs.php delete mode 100644 application/admin/lang/zh-cn/general/database.php delete mode 100644 application/admin/lang/zh-cn/test.php delete mode 100644 application/admin/lang/zh-cn/wechat/autoreply.php delete mode 100644 application/admin/lang/zh-cn/wechat/config.php delete mode 100644 application/admin/lang/zh-cn/wechat/response.php delete mode 100644 application/admin/model/Archives.php delete mode 100644 application/admin/model/Area.php delete mode 100644 application/admin/model/Block.php delete mode 100644 application/admin/model/Channel.php delete mode 100644 application/admin/model/Comment.php delete mode 100644 application/admin/model/Diyform.php delete mode 100644 application/admin/model/Fields.php delete mode 100644 application/admin/model/Modelx.php delete mode 100644 application/admin/model/Page.php delete mode 100644 application/admin/model/Tags.php delete mode 100644 application/admin/model/Test.php delete mode 100644 application/admin/validate/Archives.php delete mode 100644 application/admin/validate/Block.php delete mode 100644 application/admin/validate/Channel.php delete mode 100644 application/admin/validate/Comment.php delete mode 100644 application/admin/validate/CrmTenant.php delete mode 100644 application/admin/validate/CrmTenantTags.php delete mode 100644 application/admin/validate/Fields.php delete mode 100644 application/admin/validate/Modelx.php delete mode 100644 application/admin/validate/Page.php delete mode 100644 application/admin/validate/Tags.php delete mode 100644 application/admin/validate/Test.php delete mode 100644 application/admin/view/cms/archives/add.html delete mode 100644 application/admin/view/cms/archives/content.html delete mode 100644 application/admin/view/cms/archives/edit.html delete mode 100644 application/admin/view/cms/archives/fields.html delete mode 100644 application/admin/view/cms/archives/index.html delete mode 100644 application/admin/view/cms/archives/recyclebin.html delete mode 100644 application/admin/view/cms/block/add.html delete mode 100644 application/admin/view/cms/block/edit.html delete mode 100644 application/admin/view/cms/block/index.html delete mode 100644 application/admin/view/cms/channel/add.html delete mode 100644 application/admin/view/cms/channel/edit.html delete mode 100644 application/admin/view/cms/channel/index.html delete mode 100644 application/admin/view/cms/comment/add.html delete mode 100644 application/admin/view/cms/comment/edit.html delete mode 100644 application/admin/view/cms/comment/index.html delete mode 100644 application/admin/view/cms/diydata/add.html delete mode 100644 application/admin/view/cms/diydata/edit.html delete mode 100644 application/admin/view/cms/diydata/fields.html delete mode 100644 application/admin/view/cms/diydata/index.html delete mode 100644 application/admin/view/cms/diyform/add.html delete mode 100644 application/admin/view/cms/diyform/edit.html delete mode 100644 application/admin/view/cms/diyform/index.html delete mode 100644 application/admin/view/cms/diyform/tpl.html delete mode 100644 application/admin/view/cms/fields/add.html delete mode 100644 application/admin/view/cms/fields/edit.html delete mode 100644 application/admin/view/cms/fields/index.html delete mode 100644 application/admin/view/cms/modelx/add.html delete mode 100644 application/admin/view/cms/modelx/edit.html delete mode 100644 application/admin/view/cms/modelx/index.html delete mode 100644 application/admin/view/cms/modelx/tpl.html delete mode 100644 application/admin/view/cms/page/add.html delete mode 100644 application/admin/view/cms/page/edit.html delete mode 100644 application/admin/view/cms/page/index.html delete mode 100644 application/admin/view/cms/tags/add.html delete mode 100644 application/admin/view/cms/tags/edit.html delete mode 100644 application/admin/view/cms/tags/index.html delete mode 100644 application/admin/view/docs/add.html delete mode 100644 application/admin/view/docs/edit.html delete mode 100644 application/admin/view/docs/index.html delete mode 100644 application/admin/view/example/baidumap/index.html delete mode 100644 application/admin/view/example/baidumap/map.html delete mode 100644 application/admin/view/example/bootstraptable/detail.html delete mode 100644 application/admin/view/example/bootstraptable/index.html delete mode 100644 application/admin/view/example/colorbadge/index.html delete mode 100644 application/admin/view/example/controllerjump/index.html delete mode 100644 application/admin/view/example/customsearch/index.html delete mode 100644 application/admin/view/example/cxselect/index.html delete mode 100644 application/admin/view/example/multitable/index.html delete mode 100644 application/admin/view/example/relationmodel/index.html delete mode 100644 application/admin/view/example/tabletemplate/index.html delete mode 100644 application/admin/view/general/database/index.html delete mode 100644 application/admin/view/test/add.html delete mode 100644 application/admin/view/test/edit.html delete mode 100644 application/admin/view/test/index.html delete mode 100644 application/admin/view/wechat/.DS_Store delete mode 100644 application/admin/view/wechat/autoreply/add.html delete mode 100644 application/admin/view/wechat/autoreply/edit.html delete mode 100644 application/admin/view/wechat/autoreply/index.html delete mode 100644 application/admin/view/wechat/config/add.html delete mode 100644 application/admin/view/wechat/config/edit.html delete mode 100644 application/admin/view/wechat/config/index.html delete mode 100644 application/admin/view/wechat/menu/index.html delete mode 100644 application/admin/view/wechat/response/add.html delete mode 100644 application/admin/view/wechat/response/edit.html delete mode 100644 application/admin/view/wechat/response/index.html delete mode 100644 application/admin/view/wechat/response/select.html delete mode 100644 application/common/model/MoneyLog.php delete mode 100644 application/common/model/WechatAutoreply.php delete mode 100644 application/common/model/WechatConfig.php delete mode 100644 application/common/model/WechatContext.php delete mode 100644 application/common/model/WechatResponse.php delete mode 100644 application/index/controller/cms/Archives.php delete mode 100644 application/index/controller/cms/Diyform.php delete mode 100644 application/index/lang/zh-cn/cms/archives.php delete mode 100644 application/index/lang/zh-cn/cms/diyform.php delete mode 100644 application/index/view/cms/archives/fields.html delete mode 100644 application/index/view/cms/archives/my.html delete mode 100644 application/index/view/cms/archives/post.html delete mode 100644 application/index/view/cms/common/fields.html delete mode 100644 application/index/view/cms/diyform/index.html delete mode 100644 public/admin.php.bak delete mode 100644 public/assets/js/backend/cms/archives.js delete mode 100644 public/assets/js/backend/cms/block.js delete mode 100644 public/assets/js/backend/cms/channel.js delete mode 100644 public/assets/js/backend/cms/comment.js delete mode 100644 public/assets/js/backend/cms/diydata.js delete mode 100644 public/assets/js/backend/cms/diyform.js delete mode 100644 public/assets/js/backend/cms/fields.js delete mode 100644 public/assets/js/backend/cms/modelx.js delete mode 100644 public/assets/js/backend/cms/page.js delete mode 100644 public/assets/js/backend/cms/tags.js delete mode 100644 public/assets/js/backend/docs.js delete mode 100644 public/assets/js/backend/example/baidumap.js delete mode 100644 public/assets/js/backend/example/bootstraptable.js delete mode 100644 public/assets/js/backend/example/colorbadge.js delete mode 100644 public/assets/js/backend/example/controllerjump.js delete mode 100644 public/assets/js/backend/example/customsearch.js delete mode 100644 public/assets/js/backend/example/cxselect.js delete mode 100644 public/assets/js/backend/example/multitable.js delete mode 100644 public/assets/js/backend/example/relationmodel.js delete mode 100644 public/assets/js/backend/example/tabletemplate.js delete mode 100644 public/assets/js/backend/general/database.js delete mode 100644 public/assets/js/backend/test.js delete mode 100644 public/assets/js/backend/wechat/autoreply.js delete mode 100644 public/assets/js/backend/wechat/config.js delete mode 100644 public/assets/js/backend/wechat/menu.js delete mode 100644 public/assets/js/backend/wechat/response.js delete mode 100644 public/assets/js/frontend/cms/archives.js delete mode 100644 public/assets/js/frontend/cms/diyform.js diff --git a/application/.DS_Store b/application/.DS_Store deleted file mode 100644 index 4086246eb3bf9d2ec47424119ec9a3bcd5c6ad38..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5ZVd?88J zNz)5sZzPr+zmox6yK&|+pPe(ohS%@aYlb38*VbNmZY)1OF=-U0re@$VXJ<~FM%;B$ zH*F_nw{;|I!Vf%cSKPEQun*!me79Y%DuQm^oZpF~)D={$PP3+8Q&3a_fKse;=_ukB9;`-X#z%jkd;2A+&&Sl?td* zxxQj>l@5MO$JrV)g({tKIWqL4N9Ov5!sY1Tw`4fuwn8e20b<}I17oUc;`zV#_5J^2 z64i(SV&Gpf!1KG#ZW*Se&(@L2;aO{eo`RxaT&D0n1q^uh6|`q)E^I z0q^1mcjFJx=+(O?5B>o!Cf@X&k4mwccrr%z-ON1iz8~}MJe!@_K?vb&-I+s3M+j-q zIL7*+`-N~nZ(Y)(EWLnOjN#gipk}+w?uv~J5d#qe{~iPU+wDVD#E^ps>imAc+BKI3 z;q2@O+|wKDJ9S!%_xBINr6&e&n>(ywhE`Y)vX;Lk?x;g-rRS`0r>(Cu=KjzvdxMfj zNgrEcUT9H|_#LUmP3k$Uk!5wy35up1Z<9LVPDxMZe6kCvIm;s(G@v$hX}A}UYjBnH ziT(Zg^o+4E-<&b_=N9Hbzj7(vZ0d)aHgz$*c&kurK6-NS^x5+lhi~4>mw;i#5;Cf= z4evndV1$-;)ry8+wi)@T>qndn3=W+c))OP6iLpd7nH--;PL7w7hb89OqFL9hFScv}^pI;-2; z0SWWGLfL1on_~eDDf0>)-a=7S4@q^!+h$OaQ@UE?VZjFR1Hi8Qe8KX4%d3#=-fh>i ziM#4$Ss1cvp295nlZygo%_>u`lDhg?@)%ELE=WyBsW!Emj@Lb_O2C$4rebx(z%m`|hKkE5Y)O>q2&=;fR+X_jpE${r}qU&;KGQ>LLar2L4Y5aBSIJ&cfW(-r6-wzSkPi?n2|j q<606$3Uq2a77E{rC!q-epTQNtjKY>guz*BA0)mF9ix~K;415P44&XHa diff --git a/application/admin/controller/Docs.php b/application/admin/controller/Docs.php deleted file mode 100644 index 1900b63e..00000000 --- a/application/admin/controller/Docs.php +++ /dev/null @@ -1,214 +0,0 @@ -docsdata = Service::getDocsData(); - } - - /** - * 查看 - */ - public function index() - { - //设置过滤方法 - $this->request->filter(['strip_tags']); - if ($this->request->isAjax()) - { - $search = $this->request->request("search"); - list($where, $sort, $order, $offset, $limit) = $this->buildparams(); - $list = []; - foreach ($this->docsdata as $type => $pages) - { - foreach ($pages as $index => $page) - { - if (!$search || stripos($page['relative'], $search) !== false || stripos($page['title'], $search) !== false) - { - $page['relativeurl'] = addon_url("docs/index/index") . "?md={$page['relative']}"; - $list[] = $page; - } - } - } - $total = count($list); - $result = array("total" => $total, "rows" => array_slice($list, $offset, $limit)); - return json($result); - } - return $this->view->fetch(); - } - - /** - * 添加 - */ - public function add() - { - if ($this->request->isPost()) - { - $params = $this->request->post("row/a"); - if ($params) - { - try - { - if (!$params['md']) - { - throw new Exception("MD文件不能为空"); - } - $config = get_addon_config('docs'); - //未设置后缀 - if (stripos($params['md'], ".{$config['suffix']}") === false) - { - $params['md'] .= ".{$config['suffix']}"; - } - if (mb_substr_count($params['md'], "/") > 1) - { - throw new Exception("MD文件中只能包含一个/字符"); - } - if (!Validate::is($params['md'], "/^[A-Za-z0-9\-\_\.]+$/")) - { - throw new Exception("MD文件只能是字母数字下划线"); - } - $row = Service::getMarkdownData($params['md']); - if ($row) - { - throw new Exception("对应的MD文件已经存在"); - } - Service::setMarkdownData($params['md'], $params); - $this->success(); - } - catch (Exception $e) - { - $this->error($e->getMessage()); - } - } - $this->error(__('Parameter %s can not be empty', '')); - } - return $this->view->fetch(); - } - - /** - * 编辑 - */ - public function edit($ids = NULL) - { - $row = Service::getMarkdownData($ids, true, false); - if (!$row) - $this->error(__('No Results were found')); - if ($this->request->isPost()) - { - $params = $this->request->post("row/a"); - if ($params) - { - try - { - Service::setMarkdownData($ids, $params); - $this->success(); - } - catch (Exception $e) - { - $this->error($e->getMessage()); - } - } - $this->error(__('Parameter %s can not be empty', '')); - } - $this->view->assign("row", $row); - return $this->view->fetch(); - } - - /** - * 删除 - */ - public function del($ids = "") - { - if ($ids) - { - $row = Service::getMarkdownData($ids, false, false); - if (!$row) - $this->error(__('No Results were found')); - try - { - unlink(Service::getDocsSourceDir() . $row['relative']); - Service::refreshDocsData(); - $this->success(); - } - catch (Exception $e) - { - $this->error($e->getMessage()); - } - } - $this->error(__('Parameter %s can not be empty', 'ids')); - } - - /** - * 刷新 - */ - public function refresh() - { - Service::refreshDocsData(); - $this->success(); - } - - /** - * 导出 - */ - public function export() - { - //重新生成一次文档 - Service::build(); - - $distDir = Service::getDocsDistDir(); - $zipFile = RUNTIME_PATH . 'addons' . DS . 'export-docs-' . date('YmdHis') . '.zip'; - - $rootPath = realpath($distDir); - - $zip = new ZipArchive(); - $zip->open($zipFile, ZipArchive::CREATE | ZipArchive::OVERWRITE); - - $files = new RecursiveIteratorIterator( - new RecursiveDirectoryIterator($rootPath), RecursiveIteratorIterator::LEAVES_ONLY - ); - - foreach ($files as $name => $file) - { - if (!$file->isDir()) - { - $filePath = $file->getRealPath(); - $relativePath = substr($filePath, strlen($rootPath) + 1); - - $zip->addFile($filePath, $relativePath); - } - } - - $zip->close(); - Http::sendToBrowser($zipFile); - } - - /** - * 批量更新 - * @internal - */ - public function multi($ids = "") - { - return; - } - -} diff --git a/application/admin/controller/Test.php b/application/admin/controller/Test.php deleted file mode 100644 index 7149b87d..00000000 --- a/application/admin/controller/Test.php +++ /dev/null @@ -1,50 +0,0 @@ -model = new \app\admin\model\Test; - $this->view->assign("weekList", $this->model->getWeekList()); - $this->view->assign("flagList", $this->model->getFlagList()); - $this->view->assign("genderdataList", $this->model->getGenderdataList()); - $this->view->assign("hobbydataList", $this->model->getHobbydataList()); - $this->view->assign("statusList", $this->model->getStatusList()); - $this->view->assign("stateList", $this->model->getStateList()); - } - - /** - * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 - * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 - * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 - */ - - /** - * 导入 - */ - /* - public function import() - { - return parent::import(); - } - */ - - -} diff --git a/application/admin/controller/cms/Ajax.php b/application/admin/controller/cms/Ajax.php deleted file mode 100644 index f937fa15..00000000 --- a/application/admin/controller/cms/Ajax.php +++ /dev/null @@ -1,59 +0,0 @@ -request->request("keyValue"); - if (!$keyValue) { - $name = $this->request->request("name"); - if ($name) { - $files[] = ['name' => $name . '.html']; - } - //设置过滤方法 - $this->request->filter(['strip_tags']); - $config = get_addon_config('cms'); - $themeDir = ADDON_PATH . 'cms' . DS . 'view' . DS . $config['theme'] . DS; - $dh = opendir($themeDir); - while (false !== ($filename = readdir($dh))) { - if ($filename == '.' || $filename == '..') - continue; - $files[] = ['name' => $filename]; - } - } else { - $files[] = ['name' => $keyValue]; - } - return $result = ['total' => count($files), 'list' => $files]; - } - -} diff --git a/application/admin/controller/cms/Archives.php b/application/admin/controller/cms/Archives.php deleted file mode 100644 index 3365ebe6..00000000 --- a/application/admin/controller/cms/Archives.php +++ /dev/null @@ -1,363 +0,0 @@ -model = model('Archives'); - - $channelList = []; - $disabledIds = []; - $all = collection(Channel::order("weigh desc,id desc")->select())->toArray(); - foreach ($all as $k => $v) { - $state = ['opened' => true]; - if ($v['type'] != 'list') { - $disabledIds[] = $v['id']; - } - if ($v['type'] == 'link') { - $state['checkbox_disabled'] = true; - } - $channelList[] = [ - 'id' => $v['id'], - 'parent' => $v['parent_id'] ? $v['parent_id'] : '#', - 'text' => __($v['name']), - 'type' => $v['type'], - 'state' => $state - ]; - } - $tree = Tree::instance()->init($all, 'parent_id'); - $channelOptions = $tree->getTree(0, "", '', $disabledIds); - $this->view->assign('channelOptions', $channelOptions); - $this->assignconfig('channelList', $channelList); - - $this->view->assign("flagList", $this->model->getFlagList()); - $this->view->assign("statusList", $this->model->getStatusList()); - } - - /** - * 查看 - */ - public function index() - { - //设置过滤方法 - $this->request->filter(['strip_tags']); - if ($this->request->isAjax()) { - $this->relationSearch = TRUE; - //如果发送的来源是Selectpage,则转发到Selectpage - if ($this->request->request('keyField')) { - return $this->selectpage(); - } - list($where, $sort, $order, $offset, $limit) = $this->buildparams(); - $total = $this->model - ->with('Channel') - ->where($where) - ->order($sort, $order) - ->count(); - - $list = $this->model - ->with('Channel') - ->where($where) - ->order($sort, $order) - ->limit($offset, $limit) - ->select(); - - $result = array("total" => $total, "rows" => $list); - - return json($result); - } - - $modelList = \app\admin\model\Modelx::all(); - $this->view->assign('modelList', $modelList); - return $this->view->fetch(); - } - - /** - * 副表内容 - */ - public function content($model_id = null) - { - $model = \app\admin\model\Modelx::get($model_id); - if (!$model) { - $this->error('未找到对应模型'); - } - $fieldsList = \app\admin\model\Fields::where('model_id', $model['id'])->where('type', '<>', 'text')->select(); - - //设置过滤方法 - $this->request->filter(['strip_tags']); - if ($this->request->isAjax()) { - //如果发送的来源是Selectpage,则转发到Selectpage - if ($this->request->request('keyField')) { - return $this->selectpage(); - } - $fields = []; - foreach ($fieldsList as $index => $item) { - $fields[] = "addon." . $item['name']; - } - $table = $this->model->getTable(); - list($where, $sort, $order, $offset, $limit) = $this->buildparams(); - $sort = 'main.id'; - $total = Db::table($table) - ->alias('main') - ->join('cms_channel channel', 'channel.id=main.channel_id', 'LEFT') - ->join($model['table'] . ' addon', 'addon.id=main.id', 'LEFT') - ->field('main.id,main.channel_id,main.title,channel.name as channel_name,addon.id as aid' . ($fields ? ',' . implode(',', $fields) : '')) - ->where($where) - ->order($sort, $order) - ->count(); - - $list = Db::table($table) - ->alias('main') - ->join('cms_channel channel', 'channel.id=main.channel_id', 'LEFT') - ->join($model['table'] . ' addon', 'addon.id=main.id', 'LEFT') - ->field('main.id,main.channel_id,main.title,channel.name as channel_name,addon.id as aid' . ($fields ? ',' . implode(',', $fields) : '')) - ->where($where) - ->order($sort, $order) - ->limit($offset, $limit) - ->select(); - $result = array("total" => $total, "rows" => $list); - - return json($result); - } - $fields = []; - foreach ($fieldsList as $index => $item) { - $fields[] = ['field' => $item['name'], 'title' => $item['title'], 'type' => $item['type'], 'content' => $item['content_list']]; - } - $this->assignconfig('fields', $fields); - $this->view->assign('fieldsList', $fieldsList); - $this->view->assign('model', $model); - $this->assignconfig('model_id', $model_id); - $modelList = \app\admin\model\Modelx::all(); - $this->view->assign('modelList', $modelList); - return $this->view->fetch(); - } - - /** - * 编辑 - * - * @param mixed $ids - */ - public function edit($ids = NULL) - { - $row = $this->model->get($ids); - if (!$row) - $this->error(__('No Results were found')); - $adminIds = $this->getDataLimitAdminIds(); - if (is_array($adminIds)) { - if (!in_array($row[$this->dataLimitField], $adminIds)) { - $this->error(__('You have no permission')); - } - } - if ($this->request->isPost()) { - return parent::edit($ids); - } - $channel = Channel::get($row['channel_id']); - if (!$channel) { - $this->error(__('No specified channel found')); - } - $model = \app\admin\model\Modelx::get($channel['model_id']); - if (!$model) { - $this->error(__('No specified model found')); - } - $addon = db($model['table'])->where('id', $row['id'])->find(); - if ($addon) { - $row = array_merge($row->toArray(), $addon); - } - - $all = collection(Channel::order("weigh desc,id desc")->select())->toArray(); - foreach ($all as $k => $v) { - if ($v['type'] != 'list' || $v['model_id'] != $channel['model_id']) { - $disabledIds[] = $v['id']; - } - } - $tree = Tree::instance()->init($all, 'parent_id'); - $channelOptions = $tree->getTree(0, "", $row['channel_id'], $disabledIds); - $this->view->assign('channelOptions', $channelOptions); - $this->view->assign("row", $row); - return $this->view->fetch(); - } - - /** - * 删除 - * @param mixed $ids - */ - public function del($ids = "") - { - \app\admin\model\Archives::event('after_delete', function ($row) { - Channel::where('id', $row['channel_id'])->where('items', '>', 0)->setDec('items'); - }); - return parent::del($ids); - } - - /** - * 还原 - * @param mixed $ids - */ - public function restore($ids = "") - { - $pk = $this->model->getPk(); - $adminIds = $this->getDataLimitAdminIds(); - if (is_array($adminIds)) { - $this->model->where($this->dataLimitField, 'in', $adminIds); - } - if ($ids) { - $this->model->where($pk, 'in', $ids); - } - $archivesChannelIds = $this->model->onlyTrashed()->column('id,channel_id'); - $archivesChannelIds = array_filter($archivesChannelIds); - $this->model->where('id', 'in', array_keys($archivesChannelIds)); - $count = $this->model->restore('1=1'); - if ($count) { - $channelNums = array_count_values($archivesChannelIds); - foreach ($channelNums as $k => $v) { - Channel::where('id', $k)->setInc('items', $v); - } - $this->success(); - } - $this->error(__('No rows were updated')); - - } - - /** - * 移动 - */ - public function move($ids = "") - { - if ($ids) { - $channel_id = $this->request->post('channel_id'); - $pk = $this->model->getPk(); - $adminIds = $this->getDataLimitAdminIds(); - if (is_array($adminIds)) { - $this->model->where($this->dataLimitField, 'in', $adminIds); - } - $this->model->where($pk, 'in', $ids); - $channel = Channel::get($channel_id); - if ($channel && $channel['type'] === 'list') { - $channelNums = \app\admin\model\Archives:: - with('channel') - ->where('archives.' . $pk, 'in', $ids) - ->where('channel_id', '<>', $channel['id']) - ->field('channel_id,COUNT(*) AS nums') - ->group('channel_id') - ->select(); - $result = $this->model - ->where('model_id', '=', $channel['model_id']) - ->where('channel_id', '<>', $channel['id']) - ->update(['channel_id' => $channel_id]); - if ($result) { - $count = 0; - foreach ($channelNums as $k => $v) { - if ($v['channel']) { - Channel::where('id', $v['channel_id'])->where('items', '>', 0)->setDec('items', min($v['channel']['items'], $v['nums'])); - } - $count += $v['nums']; - } - Channel::where('id', $channel_id)->setInc('items', $count); - $this->success(); - } else { - $this->error(__('No rows were updated')); - } - } else { - $this->error(__('No rows were updated')); - } - $this->error(__('Parameter %s can not be empty', 'ids')); - } - } - - /** - * 获取栏目列表 - * @internal - */ - public function get_channel_fields() - { - $this->view->engine->layout(false); - $channel_id = $this->request->post('channel_id'); - $archives_id = $this->request->post('archives_id'); - $channel = Channel::get($channel_id, 'model'); - if ($channel && $channel['type'] === 'list') { - - $values = []; - if ($archives_id) { - $values = db($channel['model']['table'])->where('id', $archives_id)->find(); - } - - $fields = \app\admin\model\Fields::where('model_id', $channel['model_id']) - ->order('weigh desc,id desc') - ->select(); - foreach ($fields as $k => $v) { - //优先取编辑的值,再次取默认值 - $v->value = isset($values[$v['name']]) ? $values[$v['name']] : (is_null($v['defaultvalue']) ? '' : $v['defaultvalue']); - $v->rule = str_replace(',', '; ', $v->rule); - if (in_array($v->type, ['checkbox', 'lists', 'images'])) { - $checked = ''; - if ($v['minimum'] && $v['maximum']) - $checked = "{$v['minimum']}~{$v['maximum']}"; - else if ($v['minimum']) - $checked = "{$v['minimum']}~"; - else if ($v['maximum']) - $checked = "~{$v['maximum']}"; - if ($checked) - $v->rule .= (';checked(' . $checked . ')'); - } - if (in_array($v->type, ['checkbox', 'radio']) && stripos($v->rule, 'required') !== false) { - $v->rule = str_replace('required', 'checked', $v->rule); - } - if (in_array($v->type, ['selects'])) { - $v->extend .= (' ' . 'data-max-options="' . $v['maximum'] . '"'); - } - } - - $this->view->assign('fields', $fields); - $this->view->assign('values', $values); - $this->success('', null, ['html' => $this->view->fetch('fields')]); - } else { - $this->error(__('Please select channel')); - } - $this->error(__('Parameter %s can not be empty', 'ids')); - } - - /** - * 检测元素是否可用 - * @internal - */ - public function check_element_available() - { - $id = $this->request->request('id'); - $name = $this->request->request('name'); - $value = $this->request->request('value'); - $name = substr($name, 4, -1); - if (!$name) { - $this->error(__('Parameter %s can not be empty', 'name')); - } - if ($id) { - $this->model->where('id', '<>', $id); - } - $exist = $this->model->where($name, $value)->find(); - if ($exist) { - $this->error(__('The data already exist')); - } else { - $this->success(); - } - } - -} diff --git a/application/admin/controller/cms/Block.php b/application/admin/controller/cms/Block.php deleted file mode 100644 index 800ac737..00000000 --- a/application/admin/controller/cms/Block.php +++ /dev/null @@ -1,55 +0,0 @@ -model = model('Block'); - $this->view->assign("statusList", $this->model->getStatusList()); - } - - public function selectpage_type() - { - $list = []; - $word = (array)$this->request->request("q_word/a"); - $field = $this->request->request('showField'); - $keyValue = $this->request->request('keyValue'); - if (!$keyValue) { - if (array_filter($word)) { - foreach ($word as $k => $v) { - $list[] = ['id' => $v, $field => $v]; - } - } - $typeArr = \app\admin\model\Block::column('type'); - $typeArr = array_unique($typeArr); - foreach ($typeArr as $index => $item) { - $list[] = ['id' => $item, $field => $item]; - } - } else { - $list[] = ['id' => $keyValue, $field => $keyValue]; - } - return json(['total' => count($list), 'list' => $list]); - } - - public function import() - { - return parent::import(); - } - -} diff --git a/application/admin/controller/cms/Channel.php b/application/admin/controller/cms/Channel.php deleted file mode 100644 index 197581cc..00000000 --- a/application/admin/controller/cms/Channel.php +++ /dev/null @@ -1,181 +0,0 @@ -request->filter(['strip_tags']); - $this->model = model('Channel'); - - $tree = Tree::instance(); - $tree->init(collection($this->model->order('weigh desc,id desc')->select())->toArray(), 'parent_id'); - $this->channelList = $tree->getTreeList($tree->getTreeArray(0), 'name'); - $this->modelList = \app\admin\model\Modelx::order('id asc')->select(); - - $this->view->assign("modelList", $this->modelList); - $this->view->assign("channelList", $this->channelList); - $this->view->assign("typeList", ChannelModel::getTypeList()); - $this->view->assign("statusList", ChannelModel::getStatusList()); - } - - /** - * 查看 - */ - public function index() - { - - if ($this->request->isAjax()) { - $search = $this->request->request("search"); - $model_id = $this->request->request("model_id"); - //构造父类select列表选项数据 - $list = []; - if ($search) { - foreach ($this->channelList as $k => $v) { - if (stripos($v['name'], $search) !== false || stripos($v['nickname'], $search) !== false) { - $list[] = $v; - } - } - } else { - $list = $this->channelList; - } - foreach ($list as $index => $item) { - if ($model_id && $model_id != $item['model_id']) { - unset($list[$index]); - } - } - $list = array_values($list); - $modelNameArr = []; - foreach ($this->modelList as $k => $v) { - $modelNameArr[$v['id']] = $v['name']; - } - foreach ($list as $k => &$v) { - $v['model_name'] = $v['model_id'] && isset($modelNameArr[$v['model_id']]) ? $modelNameArr[$v['model_id']] : __('None'); - } - $total = count($list); - $result = array("total" => $total, "rows" => $list); - - return json($result); - } - return $this->view->fetch(); - } - - /** - * 添加 - */ - public function add() - { - if ($this->request->isPost()) { - $params = $this->request->post("row/a"); - if ($params) { - if ($this->dataLimit && $this->dataLimitFieldAutoFill) { - $params[$this->dataLimitField] = $this->auth->id; - } - try { - //是否采用模型验证 - if ($this->modelValidate) { - $name = basename(str_replace('\\', '/', get_class($this->model))); - $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : true) : $this->modelValidate; - $this->model->validate($validate); - } - $nameArr = array_filter(explode("\n", str_replace("\r\n", "\n", $params['name']))); - if (count($nameArr) > 1) { - foreach ($nameArr as $index => $item) { - $itemArr = array_filter(explode('|', $item)); - $params['name'] = $itemArr[0]; - $params['diyname'] = isset($itemArr[1]) ? $itemArr[1] : ''; - $result = $this->model->allowField(true)->isUpdate(false)->data($params)->save(); - } - } else { - $result = $this->model->allowField(true)->save($params); - } - if ($result !== false) { - $this->success(); - } else { - $this->error($this->model->getError()); - } - } catch (\think\exception\PDOException $e) { - $this->error($e->getMessage()); - } - } - $this->error(__('Parameter %s can not be empty', '')); - } - return $this->view->fetch(); - } - - /** - * Selectpage搜索 - * - * @internal - */ - public function selectpage() - { - return parent::selectpage(); - } - - /** - * 检测元素是否可用 - * @internal - */ - public function check_element_available() - { - $id = $this->request->request('id'); - $name = $this->request->request('name'); - $value = $this->request->request('value'); - $name = substr($name, 4, -1); - if (!$name) { - $this->error(__('Parameter %s can not be empty', 'name')); - } - if ($name == 'diyname') { - if ($id) { - $this->model->where('id', '<>', $id); - } - $exist = $this->model->where($name, $value)->find(); - if ($exist) { - $this->error(__('The data already exist')); - } else { - $this->success(); - } - } else if ($name == 'name') { - $nameArr = array_filter(explode("\n", str_replace("\r\n", "\n", $value))); - if (count($nameArr) > 1) { - foreach ($nameArr as $index => $item) { - $itemArr = array_filter(explode('|', $item)); - if (!isset($itemArr[1])) { - $this->error('格式:分类名称|自定义名称'); - } - $exist = \app\admin\model\Channel::getByDiyname($itemArr[1]); - if ($exist) { - $this->error('自定义名称[' . $itemArr[1] . ']已经存在'); - } - } - $this->success(); - } else { - $this->success(); - } - } - } - -} diff --git a/application/admin/controller/cms/Comment.php b/application/admin/controller/cms/Comment.php deleted file mode 100644 index ff45e2b2..00000000 --- a/application/admin/controller/cms/Comment.php +++ /dev/null @@ -1,64 +0,0 @@ -model = model('Comment'); - $this->view->assign("typeList", $this->model->getTypeList()); - $this->view->assign("statusList", $this->model->getStatusList()); - } - - /** - * 查看 - */ - public function index() - { - $this->relationSearch = true; - //设置过滤方法 - $this->request->filter(['strip_tags']); - if ($this->request->isAjax()) - { - //如果发送的来源是Selectpage,则转发到Selectpage - if ($this->request->request('keyField')) - { - return $this->selectpage(); - } - list($where, $sort, $order, $offset, $limit) = $this->buildparams(); - $total = $this->model - ->with('archives') - ->where($where) - ->order($sort, $order) - ->count(); - - $list = $this->model - ->with('archives') - ->where($where) - ->order($sort, $order) - ->limit($offset, $limit) - ->select(); - - $list = collection($list)->toArray(); - $result = array("total" => $total, "rows" => $list); - - return json($result); - } - return $this->view->fetch(); - } -} diff --git a/application/admin/controller/cms/Diydata.php b/application/admin/controller/cms/Diydata.php deleted file mode 100644 index 900c9af9..00000000 --- a/application/admin/controller/cms/Diydata.php +++ /dev/null @@ -1,178 +0,0 @@ -request->param('diyform_id'); - $this->diyform = \app\admin\model\Diyform::get($diyform_id); - if (!$this->diyform) { - $this->error('未找到对应自定义表单'); - } - $this->model = \think\Db::name($this->diyform['table']); - $this->assignconfig('diyform_id', $diyform_id); - } - - /** - * 查看 - */ - public function index() - { - $fieldsList = \app\admin\model\Fields::where('diyform_id', $this->diyform['id'])->where('type', '<>', 'text')->select(); - $fields = []; - foreach ($fieldsList as $index => $item) { - $fields[] = ['field' => $item['name'], 'title' => $item['title'], 'type' => $item['type'], 'content' => $item['content_list']]; - } - $this->assignconfig('fields', $fields); - $diyformList = \app\admin\model\Diyform::all(); - $this->view->assign('diyform', $this->diyform); - $this->view->assign('diyformList', $diyformList); - return parent::index(); - } - - /** - * 添加 - */ - public function add() - { - $this->assignFields(); - if ($this->request->isPost()) { - $params = $this->request->post("row/a"); - if ($params) { - if ($this->dataLimit && $this->dataLimitFieldAutoFill) { - $params[$this->dataLimitField] = $this->auth->id; - } - try { - $result = $this->model->insert($params); - if ($result !== false) { - $this->success(); - } else { - $this->error($this->model->getError()); - } - } catch (\think\exception\PDOException $e) { - $this->error($e->getMessage()); - } catch (\think\Exception $e) { - $this->error($e->getMessage()); - } - } - $this->error(__('Parameter %s can not be empty', '')); - } - return $this->view->fetch(); - } - - /** - * 编辑 - */ - public function edit($ids = NULL) - { - $row = $this->model->where('id', $ids)->find(); - if (!$row) - $this->error(__('No Results were found')); - $adminIds = $this->getDataLimitAdminIds(); - if (is_array($adminIds)) { - if (!in_array($row[$this->dataLimitField], $adminIds)) { - $this->error(__('You have no permission')); - } - } - if ($this->request->isPost()) { - $params = $this->request->post("row/a"); - if ($params) { - try { - $result = $this->model->where('id', $ids)->update($params); - if ($result !== false) { - $this->success(); - } else { - $this->error($row->getError()); - } - } catch (\think\exception\PDOException $e) { - $this->error($e->getMessage()); - } catch (\think\Exception $e) { - $this->error($e->getMessage()); - } - } - $this->error(__('Parameter %s can not be empty', '')); - } - - $this->assignFields($ids); - $this->view->assign("row", $row); - return $this->view->fetch(); - } - - /** - * 删除 - */ - public function del($ids = "") - { - if ($ids) { - $pk = $this->model->getPk(); - $adminIds = $this->getDataLimitAdminIds(); - if (is_array($adminIds)) { - $count = $this->model->where($this->dataLimitField, 'in', $adminIds); - } - $count = $this->model->where($pk, 'in', $ids)->delete(); - if ($count) { - $this->success(); - } else { - $this->error(__('No rows were deleted')); - } - } - $this->error(__('Parameter %s can not be empty', 'ids')); - } - - private function assignFields($diydata_id = 0) - { - $values = []; - if ($diydata_id) { - $values = db($this->diyform['table'])->where('id', $diydata_id)->find(); - } - $fields = \app\admin\model\Fields::where('diyform_id', $this->diyform['id']) - ->order('weigh desc,id desc') - ->select(); - foreach ($fields as $k => $v) { - $v->value = isset($values[$v['name']]) ? $values[$v['name']] : ''; - $v->rule = str_replace(',', '; ', $v->rule); - if (in_array($v->type, ['checkbox', 'lists', 'images'])) { - $checked = ''; - if ($v['minimum'] && $v['maximum']) - $checked = "{$v['minimum']}~{$v['maximum']}"; - else if ($v['minimum']) - $checked = "{$v['minimum']}~"; - else if ($v['maximum']) - $checked = "~{$v['maximum']}"; - if ($checked) - $v->rule .= (';checked(' . $checked . ')'); - } - if (in_array($v->type, ['checkbox', 'radio']) && stripos($v->rule, 'required') !== false) { - $v->rule = str_replace('required', 'checked', $v->rule); - } - if (in_array($v->type, ['selects'])) { - $v->extend .= (' ' . 'data-max-options="' . $v['maximum'] . '"'); - } - } - - $this->view->assign('fields', $fields); - $this->view->assign('values', $values); - } - -} diff --git a/application/admin/controller/cms/Diyform.php b/application/admin/controller/cms/Diyform.php deleted file mode 100644 index 0252e775..00000000 --- a/application/admin/controller/cms/Diyform.php +++ /dev/null @@ -1,27 +0,0 @@ -model = model('Diyform'); - $this->view->assign("statusList", $this->model->getStatusList()); - } - -} diff --git a/application/admin/controller/cms/Fields.php b/application/admin/controller/cms/Fields.php deleted file mode 100644 index ff965666..00000000 --- a/application/admin/controller/cms/Fields.php +++ /dev/null @@ -1,114 +0,0 @@ -model = model('Fields'); - $this->view->assign("statusList", $this->model->getStatusList()); - $this->view->assign('typeList', Config::getTypeList()); - $this->view->assign('regexList', Config::getRegexList()); - } - - /** - * 查看 - */ - public function index() - { - $model_id = $this->request->param('model_id', 0); - $diyform_id = $this->request->param('diyform_id', 0); - $condition = $model_id ? ['model_id' => $model_id] : ['diyform_id' => $diyform_id]; - //设置过滤方法 - $this->request->filter(['strip_tags']); - if ($this->request->isAjax()) { - list($where, $sort, $order, $offset, $limit) = $this->buildparams(); - $total = $this->model - ->where($condition) - ->where($where) - ->order($sort, $order) - ->count(); - - $list = $this->model - ->where($condition) - ->where($where) - ->order($sort, $order) - ->limit($offset, $limit) - ->select(); - - $result = array("total" => $total, "rows" => $list); - - return json($result); - } - $this->assignconfig('model_id', $model_id); - $this->assignconfig('diyform_id', $diyform_id); - $this->view->assign('model_id', $model_id); - $this->view->assign('diyform_id', $diyform_id); - - $model = $model_id ? \app\admin\model\Modelx::get($model_id) : \app\admin\model\Diyform::get($diyform_id); - $this->view->assign('model', $model); - $modelList = $model_id ? \app\admin\model\Modelx::all() : \app\admin\model\Diyform::all(); - $this->view->assign('modelList', $modelList); - - return $this->view->fetch(); - } - - /** - * 添加 - */ - public function add() - { - $model_id = $this->request->param('model_id', 0); - $diyform_id = $this->request->param('diyform_id', 0); - $this->view->assign('model_id', $model_id); - $this->view->assign('diyform_id', $diyform_id); - return parent::add(); - } - - /** - * 规则列表 - * @internal - */ - public function rulelist() - { - //主键 - $primarykey = $this->request->request("keyField"); - //主键值 - $keyValue = $this->request->request("keyValue", ""); - - $keyValueArr = array_filter(explode(',', $keyValue)); - $regexList = Config::getRegexList(); - $list = []; - foreach ($regexList as $k => $v) { - if ($keyValueArr) { - if (in_array($k, $keyValueArr)) { - $list[] = ['id' => $k, 'name' => $v]; - } - } else { - $list[] = ['id' => $k, 'name' => $v]; - } - } - return json(['list' => $list]); - } - -} diff --git a/application/admin/controller/cms/Modelx.php b/application/admin/controller/cms/Modelx.php deleted file mode 100644 index 7005bdcd..00000000 --- a/application/admin/controller/cms/Modelx.php +++ /dev/null @@ -1,26 +0,0 @@ -model = model('Modelx'); - } - -} diff --git a/application/admin/controller/cms/Page.php b/application/admin/controller/cms/Page.php deleted file mode 100644 index 2a0a54c2..00000000 --- a/application/admin/controller/cms/Page.php +++ /dev/null @@ -1,63 +0,0 @@ -model = model('Page'); - $this->view->assign("flagList", $this->model->getFlagList()); - $this->view->assign("statusList", $this->model->getStatusList()); - } - - public function index() - { - $typeArr = \app\admin\model\Page::column('type'); - $this->view->assign('typeList', $typeArr); - return parent::index(); - } - - /** - * 动态下拉选择类型 - * @internal - */ - public function selectpage_type() - { - $list = []; - $word = (array)$this->request->request("q_word/a"); - $field = $this->request->request('showField'); - $keyValue = $this->request->request('keyValue'); - if (!$keyValue) { - if (array_filter($word)) { - foreach ($word as $k => $v) { - $list[] = ['id' => $v, $field => $v]; - } - } - $typeArr = \app\admin\model\Page::column('type'); - $typeArr = array_unique($typeArr); - foreach ($typeArr as $index => $item) { - $list[] = ['id' => $item, $field => $item]; - } - } else { - $list[] = ['id' => $keyValue, $field => $keyValue]; - } - return json(['total' => count($list), 'list' => $list]); - } - -} diff --git a/application/admin/controller/cms/Tags.php b/application/admin/controller/cms/Tags.php deleted file mode 100644 index 07077ba3..00000000 --- a/application/admin/controller/cms/Tags.php +++ /dev/null @@ -1,46 +0,0 @@ -model = model('Tags'); - } - - /** - * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法 - * 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑 - * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 - */ - public function selectpage() - { - $response = parent::selectpage(); - $word = (array)$this->request->request("q_word/a"); - if (array_filter($word)) { - $result = $response->getData(); - foreach ($word as $k => $v) { - array_unshift($result['list'], ['id' => $v, 'name' => $v]); - $result['total']++; - } - $response->data($result); - } - return $response; - } - -} diff --git a/application/admin/controller/example/Baidumap.php b/application/admin/controller/example/Baidumap.php deleted file mode 100644 index c8e6e186..00000000 --- a/application/admin/controller/example/Baidumap.php +++ /dev/null @@ -1,41 +0,0 @@ -model = model('AdminLog'); - } - - /** - * 查找地图 - */ - public function map() - { - return $this->view->fetch(); - } - - /** - * 搜索列表 - */ - public function selectpage() - { - $this->model = model('Area'); - return parent::selectpage(); - } - -} diff --git a/application/admin/controller/example/Bootstraptable.php b/application/admin/controller/example/Bootstraptable.php deleted file mode 100644 index fc7ac345..00000000 --- a/application/admin/controller/example/Bootstraptable.php +++ /dev/null @@ -1,121 +0,0 @@ -model = model('AdminLog'); - } - - /** - * 查看 - */ - public function index() - { - if ($this->request->isAjax()) { - list($where, $sort, $order, $offset, $limit) = $this->buildparams(NULL); - $total = $this->model - ->where($where) - ->order($sort, $order) - ->count(); - $list = $this->model - ->where($where) - ->order($sort, $order) - ->limit($offset, $limit) - ->select(); - $result = array("total" => $total, "rows" => $list, "extend" => ['money' => mt_rand(100000,999999), 'price' => 200]); - - return json($result); - } - return $this->view->fetch(); - } - - /** - * 详情 - */ - public function detail($ids) - { - $row = $this->model->get(['id' => $ids]); - if (!$row) - $this->error(__('No Results were found')); - if ($this->request->isAjax()) { - $this->success("Ajax请求成功", null, ['id' => $ids]); - } - $this->view->assign("row", $row->toArray()); - return $this->view->fetch(); - } - - /** - * 启用 - */ - public function start($ids = '') - { - $this->success("模拟启动成功"); - } - - /** - * 暂停 - */ - public function pause($ids = '') - { - $this->success("模拟暂停成功"); - } - - /** - * 切换 - */ - public function change($ids = '') - { - $this->success("模拟切换成功"); - } - - /** - * 联动搜索 - */ - public function cxselect() - { - $type = $this->request->get('type'); - $group_id = $this->request->get('group_id'); - $list = null; - if ($group_id !== '') { - if ($type == 'group') { - $groupIds = $this->auth->getChildrenGroupIds(true); - $list = \app\admin\model\AuthGroup::where('id', 'in', $groupIds)->field('id as value, name')->select(); - } else { - $adminIds = \app\admin\model\AuthGroupAccess::where('group_id', 'in', $group_id)->column('uid'); - $list = \app\admin\model\Admin::where('id', 'in', $adminIds)->field('id as value, username AS name')->select(); - } - } - $this->success('', null, $list); - } - - /** - * 搜索下拉列表 - */ - public function searchlist() - { - $result = $this->model->limit(10)->select(); - $searchlist = []; - foreach ($result as $key => $value) { - $searchlist[] = ['id' => $value['url'], 'name' => $value['url']]; - } - $data = ['searchlist' => $searchlist]; - $this->success('', null, $data); - } - -} diff --git a/application/admin/controller/example/Colorbadge.php b/application/admin/controller/example/Colorbadge.php deleted file mode 100644 index 4d0bc213..00000000 --- a/application/admin/controller/example/Colorbadge.php +++ /dev/null @@ -1,24 +0,0 @@ -model = model('AdminLog'); - } - -} diff --git a/application/admin/controller/example/Controllerjump.php b/application/admin/controller/example/Controllerjump.php deleted file mode 100644 index 2bd1540e..00000000 --- a/application/admin/controller/example/Controllerjump.php +++ /dev/null @@ -1,24 +0,0 @@ -model = model('AdminLog'); - } - -} diff --git a/application/admin/controller/example/Customsearch.php b/application/admin/controller/example/Customsearch.php deleted file mode 100644 index a245876e..00000000 --- a/application/admin/controller/example/Customsearch.php +++ /dev/null @@ -1,26 +0,0 @@ -model = model('AdminLog'); - $ipList = $this->model->whereTime('createtime', '-37 days')->group("ip")->column("ip,ip as aa"); - $this->view->assign("ipList", $ipList); - } - -} diff --git a/application/admin/controller/example/Cxselect.php b/application/admin/controller/example/Cxselect.php deleted file mode 100644 index 391c0977..00000000 --- a/application/admin/controller/example/Cxselect.php +++ /dev/null @@ -1,23 +0,0 @@ -loadlang('general/attachment'); - $this->loadlang('general/crontab'); - return $this->view->fetch(); - } - - public function table1() - { - $this->model = model('Attachment'); - //设置过滤方法 - $this->request->filter(['strip_tags']); - if ($this->request->isAjax()) - { - //如果发送的来源是Selectpage,则转发到Selectpage - if ($this->request->request('keyField')) - { - return $this->selectpage(); - } - list($where, $sort, $order, $offset, $limit) = $this->buildparams(); - $total = $this->model - ->where($where) - ->order($sort, $order) - ->count(); - - $list = $this->model - ->where($where) - ->order($sort, $order) - ->limit($offset, $limit) - ->select(); - - $result = array("total" => $total, "rows" => $list); - - return json($result); - } - return $this->view->fetch('index'); - } - - public function table2() - { - $this->model = model('AdminLog'); - //设置过滤方法 - $this->request->filter(['strip_tags']); - if ($this->request->isAjax()) - { - //如果发送的来源是Selectpage,则转发到Selectpage - if ($this->request->request('keyField')) - { - return $this->selectpage(); - } - list($where, $sort, $order, $offset, $limit) = $this->buildparams(); - $total = $this->model - ->where($where) - ->order($sort, $order) - ->count(); - - $list = $this->model - ->where($where) - ->order($sort, $order) - ->limit($offset, $limit) - ->select(); - - $result = array("total" => $total, "rows" => $list); - - return json($result); - } - return $this->view->fetch('index'); - } - -} diff --git a/application/admin/controller/example/Relationmodel.php b/application/admin/controller/example/Relationmodel.php deleted file mode 100644 index fef6e69c..00000000 --- a/application/admin/controller/example/Relationmodel.php +++ /dev/null @@ -1,52 +0,0 @@ -model = model('AdminLog'); - } - - /** - * 查看 - */ - public function index() - { - $this->relationSearch = true; - $this->searchFields = "admin.username,id"; - if ($this->request->isAjax()) - { - list($where, $sort, $order, $offset, $limit) = $this->buildparams(); - $total = $this->model - ->with("admin") - ->where($where) - ->order($sort, $order) - ->count(); - $list = $this->model - ->with("admin") - ->where($where) - ->order($sort, $order) - ->limit($offset, $limit) - ->select(); - $result = array("total" => $total, "rows" => $list); - - return json($result); - } - return $this->view->fetch(); - } - -} diff --git a/application/admin/controller/example/Tabletemplate.php b/application/admin/controller/example/Tabletemplate.php deleted file mode 100644 index fcc5c35f..00000000 --- a/application/admin/controller/example/Tabletemplate.php +++ /dev/null @@ -1,60 +0,0 @@ -model = model('AdminLog'); - } - - /** - * 查看 - */ - public function index() - { - if ($this->request->isAjax()) - { - list($where, $sort, $order, $offset, $limit) = $this->buildparams(NULL); - $total = $this->model - ->where($where) - ->order($sort, $order) - ->count(); - $list = $this->model - ->where($where) - ->order($sort, $order) - ->limit($offset, $limit) - ->select(); - $result = array("total" => $total, "rows" => $list); - - return json($result); - } - return $this->view->fetch(); - } - - /** - * 详情 - */ - public function detail($ids) - { - $row = $this->model->get(['id' => $ids]); - if (!$row) - $this->error(__('No Results were found')); - $this->view->assign("row", $row->toArray()); - return $this->view->fetch(); - } - -} diff --git a/application/admin/controller/general/Database.php b/application/admin/controller/general/Database.php deleted file mode 100644 index cfadf2e5..00000000 --- a/application/admin/controller/general/Database.php +++ /dev/null @@ -1,290 +0,0 @@ - $row) { - $tables[] = ['name' => reset($row), 'rows' => 0]; - } - $data['tables'] = $tables; - $data['saved_sql'] = []; - $this->view->assign($data); - return $this->view->fetch(); - } - - /** - * SQL查询 - */ - public function query() - { - $do_action = $this->request->post('do_action'); - - echo ''; - if ($do_action == '') - exit(__('Invalid parameters')); - - $tablename = $this->request->post("tablename/a"); - - if (in_array($do_action, array('doquery', 'optimizeall', 'repairall'))) { - $this->$do_action(); - } else if (count($tablename) == 0) { - exit(__('Invalid parameters')); - } else { - foreach ($tablename as $table) { - $this->$do_action($table); - echo "
"; - } - } - } - - /** - * 备份列表 - * @internal - */ - public function backuplist() - { - $config = get_addon_config('database'); - $backupDir = ROOT_PATH . 'public' . DS . $config['backupDir']; - - $backuplist = []; - foreach (glob($backupDir . "*.zip") as $filename) { - $time = filemtime($filename); - $backuplist[$time] = - [ - 'file' => str_replace($backupDir, '', $filename), - 'date' => date("Y-m-d H:i:s", $time), - 'size' => format_bytes(filesize($filename)) - ]; - } - krsort($backuplist); - - $this->success("", null, ['backuplist' => array_values($backuplist)]); - } - - /** - * 还原 - */ - public function restore($ids = '') - { - $config = get_addon_config('database'); - $backupDir = ROOT_PATH . 'public' . DS . $config['backupDir']; - if ($this->request->isPost()) { - - $action = $this->request->request('action'); - $file = $this->request->request('file'); - $file = $backupDir . $file; - if ($action == 'restore') { - try { - $dir = RUNTIME_PATH . 'database' . DS; - if (!is_dir($dir)) { - mkdir($dir, 0755); - } - - if (class_exists('ZipArchive')) { - $zip = new ZipArchive; - if ($zip->open($file) !== TRUE) { - throw new Exception(__('Can not open zip file')); - } - if (!$zip->extractTo($dir)) { - $zip->close(); - throw new Exception(__('Can not unzip file')); - } - $zip->close(); - $filename = basename($file); - $sqlFile = $dir . str_replace('.zip', '.sql', $filename); - if (!is_file($sqlFile)) { - throw new Exception(__('Sql file not found')); - } - $filesize = filesize($sqlFile); - $list = Db::query('SELECT @@global.max_allowed_packet'); - if (isset($list[0]['@@global.max_allowed_packet']) && $filesize >= $list[0]['@@global.max_allowed_packet']) { - Db::execute('SET @@global.max_allowed_packet = ' . ($filesize + 1024)); - //throw new Exception('备份文件超过配置max_allowed_packet大小,请修改Mysql服务器配置'); - } - $sql = file_get_contents($sqlFile); - - Db::clear(); - //必须重连一次 - Db::connect([], true)->query("select 1"); - Db::getPdo()->exec($sql); - - } - } catch (Exception $e) { - $this->error($e->getMessage()); - } catch (PDOException $e) { - $this->error($e->getMessage()); - } - $this->success(__('Restore successful')); - - } else if ($action == 'delete') { - unlink($file); - $this->success(__('Delete successful')); - } - } - } - - /** - * 备份 - */ - public function backup() - { - $config = get_addon_config('database'); - $backupDir = ROOT_PATH . 'public' . DS . $config['backupDir']; - if ($this->request->isPost()) { - $database = config('database'); - try { - $backup = new Backup($database['hostname'], $database['username'], $database['database'], $database['password'], $database['hostport']); - $backup->setIgnoreTable($config['backupIgnoreTables'])->backup($backupDir); - } catch (Exception $e) { - $this->error($e->getMessage()); - } - $this->success(__('Backup successful')); - } - return; - } - - private function viewinfo($name) - { - $row = Db::query("SHOW CREATE TABLE `{$name}`"); - $row = array_values($row[0]); - $info = $row[1]; - echo "{$info};"; - } - - private function viewdata($name = '') - { - $sqlquery = "SELECT * FROM `{$name}`"; - $this->doquery($sqlquery); - } - - private function optimize($name = '') - { - if (Db::execute("OPTIMIZE TABLE `{$name}`")) { - echo __('Optimize table %s done', $name); - } else { - echo __('Optimize table %s fail', $name); - } - } - - private function optimizeall($name = '') - { - $list = Db::query("SHOW TABLES"); - foreach ($list as $key => $row) { - $name = reset($row); - if (Db::execute("OPTIMIZE TABLE {$name}")) { - echo __('Optimize table %s done', $name); - } else { - echo __('Optimize table %s fail', $name); - } - echo "
"; - } - } - - private function repair($name = '') - { - if (Db::execute("REPAIR TABLE `{$name}`")) { - echo __('Repair table %s done', $name); - } else { - echo __('Repair table %s fail', $name); - } - } - - private function repairall($name = '') - { - $list = Db::query("SHOW TABLES"); - foreach ($list as $key => $row) { - $name = reset($row); - if (Db::execute("REPAIR TABLE {$name}")) { - echo __('Repair table %s done', $name); - } else { - echo __('Repair table %s fail', $name); - } - echo "
"; - } - } - - private function doquery($sql = null) - { - $sqlquery = $sql ? $sql : $this->request->post('sqlquery'); - if ($sqlquery == '') - exit(__('SQL can not be empty')); - $sqlquery = str_replace("\r", "", $sqlquery); - $sqls = preg_split("/;[ \t]{0,}\n/i", $sqlquery); - $maxreturn = 100; - $r = ''; - foreach ($sqls as $key => $val) { - if (trim($val) == '') - continue; - $val = rtrim($val, ';'); - $r .= "SQL:{$val} "; - if (preg_match("/^(select|explain)(.*)/i ", $val)) { - Debug::remark("begin"); - $limit = stripos(strtolower($val), "limit") !== false ? true : false; - $count = Db::execute($val); - if ($count > 0) { - $resultlist = Db::query($val . (!$limit && $count > $maxreturn ? ' LIMIT ' . $maxreturn : '')); - } else { - $resultlist = []; - } - Debug::remark("end"); - $time = Debug::getRangeTime('begin', 'end', 4); - - $usedseconds = __('Query took %s seconds', $time) . "
"; - if ($count <= 0) { - $r .= __('Query returned an empty result'); - } else { - $r .= (__('Total:%s', $count) . (!$limit && $count > $maxreturn ? ',' . __('Max output:%s', $maxreturn) : "")); - } - $r = $r . ',' . $usedseconds; - $j = 0; - foreach ($resultlist as $m => $n) { - $j++; - if (!$limit && $j > $maxreturn) - break; - $r .= "
"; - $r .= "" . __('Row:%s', $j) . "
"; - foreach ($n as $k => $v) { - $r .= "{$k}:{$v}
\r\n"; - } - } - } else { - Debug::remark("begin"); - $count = Db::execute($val); - Debug::remark("end"); - $time = Debug::getRangeTime('begin', 'end', 4); - $r .= __('Query affected %s rows and took %s seconds', $count, $time) . "
"; - } - } - echo $r; - } - -} diff --git a/application/admin/controller/wechat/Autoreply.php b/application/admin/controller/wechat/Autoreply.php deleted file mode 100644 index 95b288d4..00000000 --- a/application/admin/controller/wechat/Autoreply.php +++ /dev/null @@ -1,67 +0,0 @@ -model = model('WechatAutoreply'); - } - - /** - * 编辑 - */ - public function edit($ids = NULL) - { - $row = $this->model->get(['id' => $ids]); - if (!$row) - $this->error(__('No Results were found')); - if ($this->request->isPost()) { - $params = $this->request->post("row/a"); - if ($params) { - $row->save($params); - $this->success(); - } - $this->error(); - } - $response = WechatResponse::get(['eventkey' => $row['eventkey']]); - $this->view->assign("response", $response); - $this->view->assign("row", $row); - return $this->view->fetch(); - } - - /** - * 判断文本是否唯一 - * @internal - */ - public function check_text_unique() - { - $row = $this->request->post("row/a"); - $except = $this->request->post("except"); - $text = isset($row['text']) ? $row['text'] : ''; - if ($this->model->where('text', $text)->where(function ($query) use ($except) { - if ($except) { - $query->where('text', '<>', $except); - } - })->count() == 0) { - $this->success(); - } else { - $this->error(__('Text already exists')); - } - } - -} diff --git a/application/admin/controller/wechat/Config.php b/application/admin/controller/wechat/Config.php deleted file mode 100644 index 9b964d5b..00000000 --- a/application/admin/controller/wechat/Config.php +++ /dev/null @@ -1,126 +0,0 @@ -model = model('WechatConfig'); - } - - /** - * 添加 - */ - public function add() - { - if ($this->request->isPost()) { - $params = $this->request->post("row/a"); - if ($params) { - foreach ($params as $k => &$v) { - $v = is_array($v) ? implode(',', $v) : $v; - } - - if ($params['mode'] == 'json') { - //JSON字段 - $fieldarr = $valuearr = []; - $field = $this->request->post('field/a'); - $value = $this->request->post('value/a'); - foreach ($field as $k => $v) { - if ($v != '') { - $fieldarr[] = $field[$k]; - $valuearr[] = $value[$k]; - } - } - $params['value'] = json_encode(array_combine($fieldarr, $valuearr), JSON_UNESCAPED_UNICODE); - } - unset($params['mode']); - try { - //是否采用模型验证 - if ($this->modelValidate) { - $name = basename(str_replace('\\', '/', get_class($this->model))); - $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : true) : $this->modelValidate; - $this->model->validate($validate); - } - $result = $this->model->save($params); - if ($result !== false) { - $this->success(); - } else { - $this->error($this->model->getError()); - } - } catch (\think\exception\PDOException $e) { - $this->error($e->getMessage()); - } - } - $this->error(__('Parameter %s can not be empty', '')); - } - return $this->view->fetch(); - } - - /** - * 编辑 - */ - public function edit($ids = NULL) - { - $row = $this->model->get($ids); - if (!$row) - $this->error(__('No Results were found')); - if ($this->request->isPost()) { - $params = $this->request->post("row/a"); - if ($params) { - foreach ($params as $k => &$v) { - $v = is_array($v) ? implode(',', $v) : $v; - } - - if ($params['mode'] == 'json') { - //JSON字段 - $fieldarr = $valuearr = []; - $field = $this->request->post('field/a'); - $value = $this->request->post('value/a'); - foreach ($field as $k => $v) { - if ($v != '') { - $fieldarr[] = $field[$k]; - $valuearr[] = $value[$k]; - } - } - $params['value'] = json_encode(array_combine($fieldarr, $valuearr), JSON_UNESCAPED_UNICODE); - } - unset($params['mode']); - try { - //是否采用模型验证 - if ($this->modelValidate) { - $name = basename(str_replace('\\', '/', get_class($this->model))); - $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : true) : $this->modelValidate; - $row->validate($validate); - } - $result = $row->save($params); - if ($result !== false) { - $this->success(); - } else { - $this->error($row->getError()); - } - } catch (\think\exception\PDOException $e) { - $this->error($e->getMessage()); - } - } - $this->error(__('Parameter %s can not be empty', '')); - } - $this->view->assign("row", $row); - $this->view->assign("value", (array)json_decode($row->value, true)); - return $this->view->fetch(); - } - -} diff --git a/application/admin/controller/wechat/Menu.php b/application/admin/controller/wechat/Menu.php deleted file mode 100644 index 3912e801..00000000 --- a/application/admin/controller/wechat/Menu.php +++ /dev/null @@ -1,90 +0,0 @@ -wechatcfg = \app\common\model\WechatConfig::get(['name' => 'menu']); - } - - /** - * 查看 - */ - public function index() - { - $responselist = array(); - $all = WechatResponse::all(); - foreach ($all as $k => $v) { - $responselist[$v['eventkey']] = $v['title']; - } - $this->view->assign('responselist', $responselist); - $this->view->assign('menu', (array)json_decode($this->wechatcfg->value, TRUE)); - return $this->view->fetch(); - } - - /** - * 修改 - */ - public function edit($ids = NULL) - { - $menu = $this->request->post("menu"); - $menu = (array)json_decode($menu, TRUE); - $this->wechatcfg->value = json_encode($menu, JSON_UNESCAPED_UNICODE); - $this->wechatcfg->save(); - $this->success(); - } - - /** - * 同步 - */ - public function sync($ids = NULL) - { - $app = new Application(get_addon_config('wechat')); - try { - $hasError = false; - $menu = json_decode($this->wechatcfg->value, TRUE); - foreach ($menu as $k => $v) { - if (isset($v['sub_button'])) { - foreach ($v['sub_button'] as $m => $n) { - if (isset($n['key']) && !$n['key']) { - $hasError = true; - break 2; - } - } - } else if (isset($v['key']) && !$v['key']) { - $hasError = true; - break; - } - } - if (!$hasError) { - $ret = $app->menu->add($menu); - if ($ret->errcode == 0) { - $this->success(); - } else { - $this->error($ret->errmsg); - } - } else { - $this->error(__('Invalid parameters')); - } - } catch (Exception $e) { - $this->error($e->getMessage()); - } - } - -} diff --git a/application/admin/controller/wechat/Response.php b/application/admin/controller/wechat/Response.php deleted file mode 100644 index 3741553a..00000000 --- a/application/admin/controller/wechat/Response.php +++ /dev/null @@ -1,79 +0,0 @@ -model = model('WechatResponse'); - } - - /** - * 选择素材 - */ - public function select() - { - return $this->view->fetch(); - } - - /** - * 添加 - */ - public function add() - { - if ($this->request->isPost()) { - $params = $this->request->post("row/a"); - $params['eventkey'] = isset($params['eventkey']) && $params['eventkey'] ? $params['eventkey'] : uniqid(); - $params['content'] = json_encode($params['content']); - $params['createtime'] = time(); - if ($params) { - $this->model->save($params); - $this->success(); - $this->content = $params; - } - $this->error(); - } - $appConfig = Wechat::appConfig(); - $this->view->applist = $appConfig; - return $this->view->fetch(); - } - - /** - * 编辑 - */ - public function edit($ids = NULL) - { - $row = $this->model->get($ids); - if (!$row) - $this->error(__('No Results were found')); - if ($this->request->isPost()) { - $params = $this->request->post("row/a"); - $params['eventkey'] = isset($params['eventkey']) && $params['eventkey'] ? $params['eventkey'] : uniqid(); - $params['content'] = json_encode($params['content']); - if ($params) { - $row->save($params); - $this->success(); - } - $this->error(); - } - $this->view->assign("row", $row); - $appConfig = Wechat::appConfig(); - $this->view->applist = $appConfig; - return $this->view->fetch(); - } - -} diff --git a/application/admin/lang/zh-cn/cms/archives.php b/application/admin/lang/zh-cn/cms/archives.php deleted file mode 100644 index f73f91f0..00000000 --- a/application/admin/lang/zh-cn/cms/archives.php +++ /dev/null @@ -1,48 +0,0 @@ - '栏目', - 'Channel_id' => '栏目ID', - 'Channel_name' => '栏目名称', - 'Channel list' => '栏目列表', - 'Addon list' => '副表列表', - 'Model' => '模型', - 'Model_id' => '模型ID', - 'User_id' => '发布会员', - 'Title' => '文章标题', - 'Flag' => '标志', - 'Image' => '缩略图', - 'Keywords' => '关键字', - 'Description' => '描述', - 'Tags' => 'TAG', - 'Weigh' => '权重', - 'Views' => '浏览', - 'Comments' => '评论', - 'Likes' => '点赞', - 'Dislikes' => '点踩', - 'Diyname' => '自定义URL', - 'Createtime' => '创建时间', - 'Updatetime' => '更新时间', - 'Deletetime' => '删除时间', - 'Recycle bin' => '回收站', - 'Restore' => '还原', - 'Restore all' => '还原全部', - 'Destroy' => '销毁', - 'Destroy all' => '清空回收站', - 'Nothing need restore' => '没有需要还原的数据', - 'Move tips' => '只能将数据移动到相同模型的栏目下,不同模型的数据移动将被忽略', - 'Are you sure you want to truncate?' => '确认清空回收站?', - 'Can not be digital' => '不能为数字', - 'Please select channel' => '请选择分类', - 'The data already exist' => '已经存在', - 'Status' => '状态', - 'Status normal' => '正常', - 'Status hidden' => '隐藏', - 'Status rejected' => '已拒绝', - 'Status pulloff' => '已下线', - 'Set to rejected' => '设为拒绝', - 'Set to pulloff' => '设为下线', - 'Array key' => '键', - 'Array value' => '值', - 'Publish' => '发布' -]; \ No newline at end of file diff --git a/application/admin/lang/zh-cn/cms/block.php b/application/admin/lang/zh-cn/cms/block.php deleted file mode 100644 index b97f34d6..00000000 --- a/application/admin/lang/zh-cn/cms/block.php +++ /dev/null @@ -1,13 +0,0 @@ - '类型', - 'Name' => '名称', - 'Title' => '标题', - 'Image' => '图片', - 'Url' => '链接', - 'Content' => '内容', - 'Createtime' => '添加时间', - 'Updatetime' => '更新时间', - 'Status' => '状态' -]; diff --git a/application/admin/lang/zh-cn/cms/channel.php b/application/admin/lang/zh-cn/cms/channel.php deleted file mode 100644 index 32f878be..00000000 --- a/application/admin/lang/zh-cn/cms/channel.php +++ /dev/null @@ -1,30 +0,0 @@ - '类型', - 'Model_id' => '模型ID', - 'Model_name' => '模型名称', - 'Parent_id' => '父ID', - 'Parent_ids' => '父ID集合', - 'Child_ids' => '子ID集合', - 'Name' => '名称', - 'Image' => '图片', - 'Keywords' => '关键字', - 'Description' => '描述', - 'Diyname' => '自定义名称', - 'Outlink' => '外部链接', - 'Items' => '文章数量', - 'Weigh' => '权重', - 'Channeltpl' => '栏目页模板', - 'Listtpl' => '列表页模板', - 'Showtpl' => '详情页模板', - 'Pagesize' => '分页大小', - 'Createtime' => '创建时间', - 'Updatetime' => '更新时间', - 'The data already exist' => '已经存在', - 'Iscontribute' => '是否允许投稿', - 'Status' => '状态', - 'Channel' => '栏目', - 'List' => '列表', - 'Link' => '外部链接' -]; diff --git a/application/admin/lang/zh-cn/cms/comment.php b/application/admin/lang/zh-cn/cms/comment.php deleted file mode 100644 index 6b48b392..00000000 --- a/application/admin/lang/zh-cn/cms/comment.php +++ /dev/null @@ -1,19 +0,0 @@ - 'ID', - 'Type' => '类型', - 'Archives' => '文档', - 'Page' => '单页', - 'Aid' => '关联ID', - 'Pid' => '父ID', - 'User_id' => '会员ID', - 'Content' => '内容', - 'Comments' => '评论数', - 'Ip' => 'IP', - 'Useragent' => 'User Agent', - 'Subscribe' => '订阅', - 'Createtime' => '创建时间', - 'Updatetime' => '更新时间', - 'Status' => '状态' -]; diff --git a/application/admin/lang/zh-cn/cms/diydata.php b/application/admin/lang/zh-cn/cms/diydata.php deleted file mode 100644 index 1d9aee53..00000000 --- a/application/admin/lang/zh-cn/cms/diydata.php +++ /dev/null @@ -1,8 +0,0 @@ - '会员ID', - 'Createtime' => '添加时间', - 'Updatetime' => '更新时间', - 'Status' => '状态' -]; diff --git a/application/admin/lang/zh-cn/cms/diyform.php b/application/admin/lang/zh-cn/cms/diyform.php deleted file mode 100644 index 4f1fe7ab..00000000 --- a/application/admin/lang/zh-cn/cms/diyform.php +++ /dev/null @@ -1,16 +0,0 @@ - '类型', - 'Name' => '名称', - 'Table' => '表名', - 'Keywords' => '关键字', - 'Description' => '描述', - 'Successtips' => '成功提交提示文字', - 'Diyname' => '自定义名称', - 'Needlogin' => '是否需要登录', - 'Formtpl' => '表单模板', - 'Createtime' => '添加时间', - 'Updatetime' => '更新时间', - 'Status' => '状态' -]; diff --git a/application/admin/lang/zh-cn/cms/fields.php b/application/admin/lang/zh-cn/cms/fields.php deleted file mode 100644 index 3e471538..00000000 --- a/application/admin/lang/zh-cn/cms/fields.php +++ /dev/null @@ -1,45 +0,0 @@ - '模型ID', - 'Name' => '名称', - 'Type' => '类型', - 'Title' => '标题', - 'Content' => '条目列表', - 'Rule' => '验证规则', - 'Validate Msg' => '错误消息', - 'Validate Ok' => '成功消息', - 'Validate Tip' => '提示消息', - 'Extend' => '扩展信息', - 'Weigh' => '排序', - 'Setting' => '字段设置', - 'Length' => '字段长度', - 'Decimals' => '小数点长度', - 'Minimum' => '最少选择', - 'Maximum' => '最大选择', - 'Defaultvalue' => '默认值', - 'Iscontribute' => '是否可投稿', - 'Isfilter' => '是否列表筛选', - 'String' => '字符', - 'Text' => '文本', - 'Editor' => '编辑器', - 'Number' => '数字', - 'Date' => '日期', - 'Time' => '时间', - 'Datetime' => '日期时间', - 'Image' => '图片', - 'Images' => '图片(多)', - 'File' => '文件', - 'Files' => '文件(多)', - 'Select' => '列表', - 'Selects' => '列表(多选)', - 'Switch' => '开关', - 'Checkbox' => '复选', - 'Radio' => '单选', - 'Array' => '数组', - 'Array key' => '键名', - 'Array value' => '键值', - 'Createtime' => '添加时间', - 'Updatetime' => '更新时间', - 'Status' => '状态' -]; diff --git a/application/admin/lang/zh-cn/cms/modelx.php b/application/admin/lang/zh-cn/cms/modelx.php deleted file mode 100644 index 0a469027..00000000 --- a/application/admin/lang/zh-cn/cms/modelx.php +++ /dev/null @@ -1,15 +0,0 @@ - '模型名称', - 'Table' => '表名', - 'Fields' => '字段列表', - 'Channeltpl' => '栏目页模板', - 'Listtpl' => '列表页模板', - 'Showtpl' => '详情页模板', - 'Main list' => '主表列表', - 'Addon list' => '副表列表', - 'Createtime' => '创建时间', - 'Updatetime' => '更新时间', - 'Setting' => '配置' -]; diff --git a/application/admin/lang/zh-cn/cms/page.php b/application/admin/lang/zh-cn/cms/page.php deleted file mode 100644 index 44154bb4..00000000 --- a/application/admin/lang/zh-cn/cms/page.php +++ /dev/null @@ -1,22 +0,0 @@ - 'ID', - 'Category_id' => '分类ID', - 'Type' => '类型', - 'Title' => '标题', - 'Keywords' => '关键字', - 'Description' => '描述', - 'Flag' => '标志', - 'Image' => '图片', - 'Content' => '内容', - 'Icon' => '图标', - 'Views' => '点击', - 'Comments' => '评论', - 'Diyname' => '自定义', - 'Showtpl' => '视图模板', - 'Createtime' => '创建时间', - 'Updatetime' => '更新时间', - 'Weigh' => '权重', - 'Status' => '状态' -]; diff --git a/application/admin/lang/zh-cn/cms/tags.php b/application/admin/lang/zh-cn/cms/tags.php deleted file mode 100644 index 68e086b8..00000000 --- a/application/admin/lang/zh-cn/cms/tags.php +++ /dev/null @@ -1,7 +0,0 @@ - '标签名称', - 'Archives' => '文档ID集合', - 'Nums' => '文档数量' -]; diff --git a/application/admin/lang/zh-cn/crm/tenant/tags.php b/application/admin/lang/zh-cn/crm/tenant/tags.php deleted file mode 100644 index 4ce31483..00000000 --- a/application/admin/lang/zh-cn/crm/tenant/tags.php +++ /dev/null @@ -1,8 +0,0 @@ - 'ID', - 'Name' => '标签名称', - 'Tenant_ids' => '租客集合', - 'Nums' => '租客数量' -]; diff --git a/application/admin/lang/zh-cn/docs.php b/application/admin/lang/zh-cn/docs.php deleted file mode 100644 index 707e6b53..00000000 --- a/application/admin/lang/zh-cn/docs.php +++ /dev/null @@ -1,17 +0,0 @@ - '名称', - 'title' => '标题', - 'type' => '分类', - 'sort' => '排序', - 'relative' => '文件位置', - 'contributeurl' => '贡献URL', - 'source' => 'MD源内容', - 'preview' => '预览', - 'order' => '排序', - 'isnew' => '新标识', - 'markdown file' => 'MD文件名称', - 'refresh docs' => '刷新缓存', - 'export html' => '导出HTML', -]; diff --git a/application/admin/lang/zh-cn/general/database.php b/application/admin/lang/zh-cn/general/database.php deleted file mode 100644 index 581ca15f..00000000 --- a/application/admin/lang/zh-cn/general/database.php +++ /dev/null @@ -1,43 +0,0 @@ - '查询结果', - 'Basic query' => '基础查询', - 'View structure' => '查看表结构', - 'View data' => '查看表数据', - 'Backup and Restore' => '备份与还原', - 'Backup now' => '立即备份', - 'File' => '文件', - 'Size' => '大小', - 'Date' => '备份日期', - 'Restore' => '还原', - 'Delete' => '删除', - 'Optimize' => '优化表', - 'Repair' => '修复表', - 'Optimize all' => '优化全部表', - 'Repair all' => '修复全部表', - 'Backup successful' => '备份成功', - 'Restore successful' => '还原成功', - 'Delete successful' => '删除成功', - 'Can not open zip file' => '无法打开备份文件', - 'Can not unzip file' => '无法解压备份文件', - 'Sql file not found' => '未找到SQL文件', - 'Table:%s' => '总计:%s个表', - 'Record:%s' => '记录:%s条', - 'Data:%s' => '占用:%s', - 'Index:%s' => '索引:%s', - 'SQL Result:' => '查询结果:', - 'SQL can not be empty' => 'SQL语句不能为空', - 'Max output:%s' => '最大返回%s条', - 'Total:%s' => '共有%s条记录! ', - 'Row:%s' => '记录:%s', - 'Executes one or multiple queries which are concatenated by a semicolon' => '请输入SQL语句,支持批量查询,多条SQL以分号(;)分格', - 'Query affected %s rows and took %s seconds' => '共影响%s条记录! 耗时:%s秒!', - 'Query returned an empty result' => '返回结果为空!', - 'Query took %s seconds' => '耗时%s秒!', - 'Optimize table %s done' => '优化表[%s]成功', - 'Repair table %s done' => '修复表[%s]成功', - 'Optimize table %s fail' => '优化表[%s]失败', - 'Repair table %s fail' => '修复表[%s]失败' -]; - diff --git a/application/admin/lang/zh-cn/test.php b/application/admin/lang/zh-cn/test.php deleted file mode 100644 index c3bab261..00000000 --- a/application/admin/lang/zh-cn/test.php +++ /dev/null @@ -1,47 +0,0 @@ - 'ID', - 'Admin_id' => '管理员ID', - 'Category_id' => '分类ID(单选)', - 'Category_ids' => '分类ID(多选)', - 'Week' => '星期(单选)', - 'Week monday' => '星期一', - 'Week tuesday' => '星期二', - 'Week wednesday' => '星期三', - 'Flag' => '标志(多选)', - 'Flag hot' => '热门', - 'Flag index' => '首页', - 'Flag recommend' => '推荐', - 'Genderdata' => '性别(单选)', - 'Genderdata male' => '男', - 'Genderdata female' => '女', - 'Hobbydata' => '爱好(多选)', - 'Hobbydata music' => '音乐', - 'Hobbydata reading' => '读书', - 'Hobbydata swimming' => '游泳', - 'Title' => '标题', - 'Content' => '内容', - 'Image' => '图片', - 'Images' => '图片组', - 'Attachfile' => '附件', - 'Keywords' => '关键字', - 'Description' => '描述', - 'City' => '省市', - 'Price' => '价格', - 'Views' => '点击', - 'Startdate' => '开始日期', - 'Activitytime' => '活动时间(datetime)', - 'Year' => '年', - 'Times' => '时间', - 'Refreshtime' => '刷新时间(int)', - 'Createtime' => '创建时间', - 'Updatetime' => '更新时间', - 'Weigh' => '权重', - 'Switch' => '开关', - 'Status' => '状态', - 'State' => '状态值', - 'State 0' => '禁用', - 'State 1' => '正常', - 'State 2' => '推荐', -]; diff --git a/application/admin/lang/zh-cn/wechat/autoreply.php b/application/admin/lang/zh-cn/wechat/autoreply.php deleted file mode 100644 index 6ba7061c..00000000 --- a/application/admin/lang/zh-cn/wechat/autoreply.php +++ /dev/null @@ -1,8 +0,0 @@ - '文本', - 'Event key' => '响应标识', - 'Remark' => '备注', - 'Text already exists' => '文本已经存在', -]; diff --git a/application/admin/lang/zh-cn/wechat/config.php b/application/admin/lang/zh-cn/wechat/config.php deleted file mode 100644 index fbbd04a1..00000000 --- a/application/admin/lang/zh-cn/wechat/config.php +++ /dev/null @@ -1,10 +0,0 @@ - '配置名称', - 'value' => '配置值', - 'Json key' => '键', - 'Json value' => '值', - 'createtime' => '创建时间', - 'updatetime' => '更新时间' -]; diff --git a/application/admin/lang/zh-cn/wechat/response.php b/application/admin/lang/zh-cn/wechat/response.php deleted file mode 100644 index 37bb3bd7..00000000 --- a/application/admin/lang/zh-cn/wechat/response.php +++ /dev/null @@ -1,8 +0,0 @@ - '资源标题', - 'Event key' => '事件标识', - 'Text' => '文本', - 'App' => '应用', -]; diff --git a/application/admin/model/Archives.php b/application/admin/model/Archives.php deleted file mode 100644 index 282851ea..00000000 --- a/application/admin/model/Archives.php +++ /dev/null @@ -1,138 +0,0 @@ - $data['id'], ':diyname' => $diyname, ':channel' => $data['channel_id']]); - } - - protected static function init() - { - self::afterInsert(function ($row) { - $pk = $row->getPk(); - $channel = Channel::get($row['channel_id']); - $row->getQuery()->where($pk, $row[$pk])->update(['model_id' => $channel ? $channel['model_id'] : 0, 'weigh' => $row[$pk]]); - Channel::where('id', $row['channel_id'])->setInc('items'); - }); - self::beforeWrite(function ($row) { - //在更新之前对数组进行处理 - foreach ($row->getData() as $k => $value) { - if (is_array($value) && isset($value['field'])) { - $value = json_encode(Config::getArrayData($value), JSON_UNESCAPED_UNICODE); - } else { - $value = is_array($value) ? implode(',', $value) : $value; - } - $row->$k = $value; - } - }); - self::afterWrite(function ($row) { - if (isset($row['channel_id'])) { - //在更新成功后刷新副表、TAGS表数据、栏目表 - $channel = Channel::get($row->channel_id); - if ($channel) { - $model = Modelx::get($channel['model_id']); - if ($model && isset($row['content'])) { - $values = array_intersect_key($row->getData(), array_flip($model->fields)); - $values['id'] = $row['id']; - $values['content'] = $row['content']; - db($model['table'])->insert($values, TRUE); - } - } - } - if (isset($row['tags'])) { - $tags = array_filter(explode(',', $row['tags'])); - if ($tags) { - $tagslist = Tags::where('name', 'in', $tags)->select(); - foreach ($tagslist as $k => $v) { - $archives = explode(',', $v['archives']); - if (!in_array($row['id'], $archives)) { - $archives[] = $row['id']; - $v->archives = implode(',', $archives); - $v->nums++; - $v->save(); - } - $tags = array_diff($tags, [$v['name']]); - } - $list = []; - foreach ($tags as $k => $v) { - $list[] = ['name' => $v, 'archives' => $row['id'], 'nums' => 1]; - } - if ($list) { - (new Tags())->saveAll($list); - } - } - } - }); - } - - public function getFlagList() - { - return ['hot' => __('Hot'), 'new' => __('New'), 'recommend' => __('Recommend')]; - } - - public function getStatusList() - { - return ['normal' => __('Normal'), 'hidden' => __('Hidden'), 'rejected' => __('Status rejected'), 'pulloff' => __('Status pulloff')]; - } - - public function getFlagTextAttr($value, $data) - { - $value = $value ? $value : $data['flag']; - $valueArr = $value ? explode(',', $value) : []; - $list = $this->getFlagList(); - return implode(',', array_intersect_key($list, array_flip($valueArr))); - } - - public function getStatusTextAttr($value, $data) - { - $value = $value ? $value : $data['status']; - $list = $this->getStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - public function getPublishtimeTextAttr($value, $data) - { - $value = $value ? $value : $data['publishtime']; - return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; - } - - protected function setPublishtimeAttr($value) - { - return $value && !is_numeric($value) ? strtotime($value) : $value; - } - - public function channel() - { - return $this->belongsTo('Channel', 'channel_id', '', [], 'LEFT')->setEagerlyType(0); - } - -} diff --git a/application/admin/model/Area.php b/application/admin/model/Area.php deleted file mode 100644 index 82690691..00000000 --- a/application/admin/model/Area.php +++ /dev/null @@ -1,16 +0,0 @@ - __('Normal'), 'hidden' => __('Hidden')]; - } - - public function getStatusTextAttr($value, $data) - { - $value = $value ? $value : $data['status']; - $list = $this->getStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } - -} diff --git a/application/admin/model/Channel.php b/application/admin/model/Channel.php deleted file mode 100644 index 96afae73..00000000 --- a/application/admin/model/Channel.php +++ /dev/null @@ -1,97 +0,0 @@ - $data['id'], ':diyname' => $diyname]); - } - - protected static function init() - { - self::afterInsert(function ($row) { - //创建时自动添加权重值 - $pk = $row->getPk(); - $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); - }); - self::afterDelete(function ($row) { - //删除时,删除子节点,同时将所有相关文档移入回收站 - static $tree; - if (!$tree) { - $tree = \fast\Tree::instance(); - $tree->init(collection(Channel::order('weigh desc,id desc')->field('id,parent_id,name,type,diyname,status')->select())->toArray(), 'parent_id'); - } - $childIds = $tree->getChildrenIds($row['id']); - if ($childIds) { - Channel::destroy(function ($query) use ($childIds) { - $query->where('id', 'in', $childIds); - }); - } - $childIds[] = $row['id']; - db('cms_archives')->where('channel_id', 'in', $childIds)->update(['deletetime' => time()]); - }); - self::afterWrite(function ($row) { - $changed = $row->getChangedData(); - //隐藏时判断是否有子节点,有则隐藏 - if (isset($changed['status']) && $changed['status'] == 'hidden') { - static $tree; - if (!$tree) { - $tree = \fast\Tree::instance(); - $tree->init(collection(Channel::order('weigh desc,id desc')->field('id,parent_id,name,type,diyname,status')->select())->toArray(), 'parent_id'); - } - $childIds = $tree->getChildrenIds($row['id']); - db('cms_channel')->where('id', 'in', $childIds)->update(['status' => 'hidden']); - } - }); - } - - public static function getTypeList() - { - return ['channel' => __('Channel'), 'list' => __('List'), 'link' => __('Link')]; - } - - public static function getStatusList() - { - return ['normal' => __('Normal'), 'hidden' => __('Hidden')]; - } - - public function getTypeTextAttr($value, $data) - { - $value = $value ? $value : $data['type']; - $list = $this->getTypeList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - public function getStatusTextAttr($value, $data) - { - $value = $value ? $value : $data['status']; - $list = $this->getStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - public function model() - { - return $this->belongsTo('Modelx', 'model_id')->setEagerlyType(0); - } - -} diff --git a/application/admin/model/Comment.php b/application/admin/model/Comment.php deleted file mode 100644 index 77ea8be3..00000000 --- a/application/admin/model/Comment.php +++ /dev/null @@ -1,58 +0,0 @@ - __('Archives'), 'page' => __('Page')]; - } - - public function getStatusList() - { - return ['normal' => __('Normal'), 'hidden' => __('Hidden')]; - } - - - public function getTypeTextAttr($value, $data) - { - $value = $value ? $value : $data['type']; - $list = $this->getTypeList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - public function getStatusTextAttr($value, $data) - { - $value = $value ? $value : $data['status']; - $list = $this->getStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - public function archives() - { - return $this->belongsTo('Archives', 'aid', '', [], 'LEFT')->setEagerlyType(0); - } - -} diff --git a/application/admin/model/Diyform.php b/application/admin/model/Diyform.php deleted file mode 100644 index a8691446..00000000 --- a/application/admin/model/Diyform.php +++ /dev/null @@ -1,59 +0,0 @@ -query($sql); - }); - } - - public function getUrlAttr($value, $data) - { - $diyname = $data['diyname'] ? $data['diyname'] : $data['id']; - return addon_url('cms/diyform/index', [':id' => $data['id'], ':diyname' => $diyname]); - } - - public function getFieldsAttr($value, $data) - { - return is_array($value) ? $value : ($value ? explode(',', $value) : []); - } - public function getStatusList() - { - return ['normal' => __('Normal'), 'hidden' => __('Hidden')]; - } - - public function getStatusTextAttr($value, $data) - { - $value = $value ? $value : $data['status']; - $list = $this->getStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } - -} diff --git a/application/admin/model/Fields.php b/application/admin/model/Fields.php deleted file mode 100644 index 2c45369d..00000000 --- a/application/admin/model/Fields.php +++ /dev/null @@ -1,143 +0,0 @@ -error = $error; - } - - protected static function init() - { - $beforeUpdateCallback = function ($row) { - - }; - - $afterInsertCallback = function ($row) { - //为了避免引起更新的事件回调,这里采用直接执行SQL的写法 - $row->query($row->fetchSql(true)->update(['id' => $row['id'], 'weigh' => $row['id']])); - $field = $row['model_id'] ? 'model_id' : 'diyform_id'; - $model = $row['model_id'] ? Modelx::get($row[$field]) : Diyform::get($row[$field]); - if ($model) { - $sql = Alter::instance() - ->setTable($model['table']) - ->setName($row['name']) - ->setLength($row['length']) - ->setContent($row['content']) - ->setDecimals($row['decimals']) - ->setDefaultvalue($row['defaultvalue']) - ->setComment($row['title']) - ->setType($row['type']) - ->getAddSql(); - try { - db()->query($sql); - $fields = Fields::where($field, $model['id'])->field('name')->column('name'); - $model->fields = implode(',', $fields); - $model->save(); - } catch (PDOException $e) { - $row->getQuery()->where('id', $row->id)->delete(); - throw new Exception($e->getMessage()); - } - } - }; - $afterUpdateCallback = function ($row) { - $field = $row['model_id'] ? 'model_id' : 'diyform_id'; - $model = $row['model_id'] ? Modelx::get($row[$field]) : Diyform::get($row[$field]); - if ($model) { - $alter = Alter::instance(); - if (isset($row['oldname']) && $row['oldname'] != $row['name']) { - $alter->setOldname($row['oldname']); - } - $sql = $alter - ->setTable($model['table']) - ->setName($row['name']) - ->setLength($row['length']) - ->setContent($row['content']) - ->setDecimals($row['decimals']) - ->setDefaultvalue($row['defaultvalue']) - ->setComment($row['title']) - ->setType($row['type']) - ->getModifySql(); - db()->query($sql); - $fields = Fields::where($field, $model['id'])->field('name')->column('name'); - $model->fields = implode(',', $fields); - $model->save(); - } - }; - - self::beforeInsert($beforeUpdateCallback); - self::beforeUpdate($beforeUpdateCallback); - - self::afterInsert($afterInsertCallback); - self::afterUpdate($afterUpdateCallback); - - self::afterDelete(function ($row) { - $field = $row['model_id'] ? 'model_id' : 'diyform_id'; - $model = $row['model_id'] ? Modelx::get($row[$field]) : Diyform::get($row[$field]); - if ($model) { - $sql = Alter::instance() - ->setTable($model['table']) - ->setName($row['name']) - ->getDropSql(); - try { - db()->query($sql); - } catch (PDOException $e) { - - } - } - }); - } - - public function getContentListAttr($value, $data) - { - return in_array($data['type'], self::$listField) ? Config::decode($data['content']) : $data['content']; - } - - public function getStatusList() - { - return ['normal' => __('Normal'), 'hidden' => __('Hidden')]; - } - - public function getStatusTextAttr($value, $data) - { - $value = $value ? $value : $data['status']; - $list = $this->getStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - public function model() - { - return $this->belongsTo('Modelx', 'model_id')->setEagerlyType(0); - } - - public function diyform() - { - return $this->belongsTo('Diyform', 'diyform_id')->setEagerlyType(0); - } - -} diff --git a/application/admin/model/Modelx.php b/application/admin/model/Modelx.php deleted file mode 100644 index 1419b167..00000000 --- a/application/admin/model/Modelx.php +++ /dev/null @@ -1,36 +0,0 @@ -query($sql); - }); - } - - public function getFieldsAttr($value, $data) - { - return is_array($value) ? $value : ($value ? explode(',', $value) : []); - } - -} diff --git a/application/admin/model/Page.php b/application/admin/model/Page.php deleted file mode 100644 index d2aca16f..00000000 --- a/application/admin/model/Page.php +++ /dev/null @@ -1,61 +0,0 @@ -save(['weigh' => $row['id']]); - }); - } - - public function getUrlAttr($value, $data) - { - return addon_url('cms/page/index', [':diyname' => $data['diyname']]); - } - - public function getStatusList() - { - return ['normal' => __('Normal'), 'hidden' => __('Hidden')]; - } - - public function getStatusTextAttr($value, $data) - { - $value = $value ? $value : $data['status']; - $list = $this->getStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - public function getFlagList() - { - return ['hot' => __('Hot'), 'index' => __('Index'), 'recommend' => __('Recommend')]; - } - - public function getFlagTextAttr($value, $data) - { - $value = $value ? $value : $data['flag']; - $valueArr = explode(',', $value); - $list = $this->getFlagList(); - return implode(',', array_intersect_key($list, array_flip($valueArr))); - } - -} diff --git a/application/admin/model/Tags.php b/application/admin/model/Tags.php deleted file mode 100644 index 688ae4ac..00000000 --- a/application/admin/model/Tags.php +++ /dev/null @@ -1,27 +0,0 @@ - $data['name']]); - } - -} diff --git a/application/admin/model/Test.php b/application/admin/model/Test.php deleted file mode 100644 index 21b1fa4d..00000000 --- a/application/admin/model/Test.php +++ /dev/null @@ -1,143 +0,0 @@ -getPk(); - $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); - }); - } - - - public function getWeekList() - { - return ['monday' => __('Week monday'), 'tuesday' => __('Week tuesday'), 'wednesday' => __('Week wednesday')]; - } - - public function getFlagList() - { - return ['hot' => __('Flag hot'), 'index' => __('Flag index'), 'recommend' => __('Flag recommend')]; - } - - public function getGenderdataList() - { - return ['male' => __('Genderdata male'), 'female' => __('Genderdata female')]; - } - - public function getHobbydataList() - { - return ['music' => __('Hobbydata music'), 'reading' => __('Hobbydata reading'), 'swimming' => __('Hobbydata swimming')]; - } - - public function getStatusList() - { - return ['normal' => __('Normal'), 'hidden' => __('Hidden')]; - } - - public function getStateList() - { - return ['0' => __('State 0'), '1' => __('State 1'), '2' => __('State 2')]; - } - - - public function getWeekTextAttr($value, $data) - { - $value = $value ? $value : $data['week']; - $list = $this->getWeekList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - public function getFlagTextAttr($value, $data) - { - $value = $value ? $value : $data['flag']; - $valueArr = explode(',', $value); - $list = $this->getFlagList(); - return implode(',', array_intersect_key($list, array_flip($valueArr))); - } - - - public function getGenderdataTextAttr($value, $data) - { - $value = $value ? $value : $data['genderdata']; - $list = $this->getGenderdataList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - public function getHobbydataTextAttr($value, $data) - { - $value = $value ? $value : $data['hobbydata']; - $valueArr = explode(',', $value); - $list = $this->getHobbydataList(); - return implode(',', array_intersect_key($list, array_flip($valueArr))); - } - - - public function getRefreshtimeTextAttr($value, $data) - { - $value = $value ? $value : $data['refreshtime']; - return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; - } - - - public function getStatusTextAttr($value, $data) - { - $value = $value ? $value : $data['status']; - $list = $this->getStatusList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - - public function getStateTextAttr($value, $data) - { - $value = $value ? $value : $data['state']; - $list = $this->getStateList(); - return isset($list[$value]) ? $list[$value] : ''; - } - - protected function setFlagAttr($value) - { - return is_array($value) ? implode(',', $value) : $value; - } - - protected function setHobbydataAttr($value) - { - return is_array($value) ? implode(',', $value) : $value; - } - - protected function setRefreshtimeAttr($value) - { - return $value && !is_numeric($value) ? strtotime($value) : $value; - } - - -} diff --git a/application/admin/validate/Archives.php b/application/admin/validate/Archives.php deleted file mode 100644 index 8f8cebc2..00000000 --- a/application/admin/validate/Archives.php +++ /dev/null @@ -1,27 +0,0 @@ - [], - 'edit' => [], - ]; - -} diff --git a/application/admin/validate/Block.php b/application/admin/validate/Block.php deleted file mode 100644 index eb60cd58..00000000 --- a/application/admin/validate/Block.php +++ /dev/null @@ -1,27 +0,0 @@ - [], - 'edit' => [], - ]; - -} diff --git a/application/admin/validate/Channel.php b/application/admin/validate/Channel.php deleted file mode 100644 index 7df3d444..00000000 --- a/application/admin/validate/Channel.php +++ /dev/null @@ -1,27 +0,0 @@ - [], - 'edit' => [], - ]; - -} diff --git a/application/admin/validate/Comment.php b/application/admin/validate/Comment.php deleted file mode 100644 index ffddfd09..00000000 --- a/application/admin/validate/Comment.php +++ /dev/null @@ -1,27 +0,0 @@ - [], - 'edit' => [], - ]; - -} diff --git a/application/admin/validate/CrmTenant.php b/application/admin/validate/CrmTenant.php deleted file mode 100644 index cc7cea17..00000000 --- a/application/admin/validate/CrmTenant.php +++ /dev/null @@ -1,27 +0,0 @@ - [], - 'edit' => [], - ]; - -} diff --git a/application/admin/validate/CrmTenantTags.php b/application/admin/validate/CrmTenantTags.php deleted file mode 100644 index c1368b3d..00000000 --- a/application/admin/validate/CrmTenantTags.php +++ /dev/null @@ -1,27 +0,0 @@ - [], - 'edit' => [], - ]; - -} diff --git a/application/admin/validate/Fields.php b/application/admin/validate/Fields.php deleted file mode 100644 index 34941a5b..00000000 --- a/application/admin/validate/Fields.php +++ /dev/null @@ -1,49 +0,0 @@ - 'require|unique:fields,model_id^name', - 'title|管理员' => 'require', - 'model_id|模型ID' => 'require|integer', - 'status|状态' => 'require|in:normal,hidden', - ]; - - /** - * 提示消息 - */ - protected $message = [ - ]; - - /** - * 验证场景 - */ - protected $scene = [ - 'add' => [ - 'name', 'title', 'model_id', 'status' - ], - 'edit' => [ - 'name', 'title', 'model_id', 'status' - ], - ]; - - public function __construct(array $rules = array(), $message = array(), $field = array()) - { - //如果是编辑模式,则排除下主键 - $ids = request()->param("ids"); - if ($ids) - { - $this->rule['name|名称'] .= ",{$ids}"; - } - parent::__construct($rules, $message, $field); - } - -} diff --git a/application/admin/validate/Modelx.php b/application/admin/validate/Modelx.php deleted file mode 100644 index 8b96be18..00000000 --- a/application/admin/validate/Modelx.php +++ /dev/null @@ -1,27 +0,0 @@ - [], - 'edit' => [], - ]; - -} diff --git a/application/admin/validate/Page.php b/application/admin/validate/Page.php deleted file mode 100644 index 4eb69a6a..00000000 --- a/application/admin/validate/Page.php +++ /dev/null @@ -1,27 +0,0 @@ - [], - 'edit' => [], - ]; - -} diff --git a/application/admin/validate/Tags.php b/application/admin/validate/Tags.php deleted file mode 100644 index cc9f954f..00000000 --- a/application/admin/validate/Tags.php +++ /dev/null @@ -1,27 +0,0 @@ - [], - 'edit' => [], - ]; - -} diff --git a/application/admin/validate/Test.php b/application/admin/validate/Test.php deleted file mode 100644 index b9603418..00000000 --- a/application/admin/validate/Test.php +++ /dev/null @@ -1,27 +0,0 @@ - [], - 'edit' => [], - ]; - -} diff --git a/application/admin/view/cms/archives/add.html b/application/admin/view/cms/archives/add.html deleted file mode 100644 index 50f9ce5d..00000000 --- a/application/admin/view/cms/archives/add.html +++ /dev/null @@ -1,198 +0,0 @@ -
-
-
-
-
- -
-
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- -
- -
-
- -
- - -
- -
-
    -
    -
    -
    - -
    - -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    - -
    - -
    -
    -
    -
    -
    相关信息
    -
    -
    -
    -
    -
    - -
    -
    - - - -
    -
    -
    -
    - -
    -
    - - - -
    -
    -
    -
    - -
    -
    - - - -
    -
    -
    -
    - -
    -
    - - -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    状态
    -
    -
    -
    -
    -
    - -
    - - - -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/application/admin/view/cms/archives/content.html b/application/admin/view/cms/archives/content.html deleted file mode 100644 index c9c95410..00000000 --- a/application/admin/view/cms/archives/content.html +++ /dev/null @@ -1,29 +0,0 @@ -
    - -
    - {:build_heading(null,FALSE)} - -
    - -
    -
    -
    -
    -
    - {:build_toolbar('refresh,edit,del')} -
    - -
    -
    -
    - -
    -
    -
    \ No newline at end of file diff --git a/application/admin/view/cms/archives/edit.html b/application/admin/view/cms/archives/edit.html deleted file mode 100644 index a51d1816..00000000 --- a/application/admin/view/cms/archives/edit.html +++ /dev/null @@ -1,207 +0,0 @@ -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    - -
    - -
    -
    - -
    - - -
    - -
    -
      -
      -
      -
      - -
      - -
      -
      - -
      - -
      -
      -
      - -
      - -
      -
      -
      -
      - -
      - -
      -
      -
      - -
      - -
      -
      -
      - -
      - -
      -
      -
      -
      -
      - -
      - -
      - -
      -
      -
      -
      -
      相关信息
      -
      -
      -
      -
      -
      - -
      -
      - - - -
      -
      -
      -
      - -
      -
      - - - -
      -
      -
      -
      - -
      -
      - - - -
      -
      -
      -
      - -
      -
      - - -
      -
      -
      -
      - -
      -
      - -
      -
      -
      -
      - -
      -
      -
      -
      -
      -
      状态
      -
      -
      -
      -
      -
      - -
      - - - -
      -
      -
      - -
      - -
      -
      -
      - -
      -
      - - - - -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      \ No newline at end of file diff --git a/application/admin/view/cms/archives/fields.html b/application/admin/view/cms/archives/fields.html deleted file mode 100644 index 31a551c1..00000000 --- a/application/admin/view/cms/archives/fields.html +++ /dev/null @@ -1,102 +0,0 @@ -{foreach $fields as $item} - -
      -
      {$item.title}
      -
      - {switch $item.type} - {case string} - - {/case} - {case value="text" break="0"}{/case} - {case editor} - - {/case} - {case array} - {php}$arrList=isset($values[$item['name']])?(array)json_decode($item['value'],true):$item['content_list'];{/php} -
      -
      - {:__('Array key')} - {:__('Array value')} -
      - - {foreach $arrList as $key => $vo} -
      - - - - -
      - {/foreach} -
      {:__('Append')}
      -
      - {/case} - {case date} - - {/case} - {case time} - - {/case} - {case datetime} - - {/case} - {case number} - - {/case} - {case checkbox} - {foreach name="item.content_list" item="vo"} - - {/foreach} - {/case} - {case radio} - {foreach name="item.content_list" item="vo"} - - {/foreach} - {/case} - {case value="select" break="0"}{/case} - {case value="selects"} - - {/case} - {case value="image" break="0"}{/case} - {case value="images"} -
      - -
      - - -
      - -
      -
        - {/case} - {case value="file" break="0"}{/case} - {case value="files"} -
        - -
        - - -
        - -
        - {/case} - {case switch} - - - - - {/case} - {case bool} - - - {/case} - {case custom} - {$item.content} - {/case} - {/switch} -
        -
        -{/foreach} \ No newline at end of file diff --git a/application/admin/view/cms/archives/index.html b/application/admin/view/cms/archives/index.html deleted file mode 100644 index ec56548f..00000000 --- a/application/admin/view/cms/archives/index.html +++ /dev/null @@ -1,93 +0,0 @@ - -
        - -
        -
        - {:build_heading()} -
        -
        -
        -
        - {:build_toolbar('refresh,add,del',['add'=>[url('cms.archives/add'), 'btn btn-success btn-addtabs', 'fa fa-plus', __('Add'), __('Add')]])} - {:__('Move')} - - {:__('Recycle bin')} - - - -
        - -
        -
        -
        - -
        -
        -
        -
        - diff --git a/application/admin/view/cms/archives/recyclebin.html b/application/admin/view/cms/archives/recyclebin.html deleted file mode 100644 index ab39d45a..00000000 --- a/application/admin/view/cms/archives/recyclebin.html +++ /dev/null @@ -1,23 +0,0 @@ -
        - {:build_heading()} - -
        -
        -
        - -
        - -
        -
        -
        diff --git a/application/admin/view/cms/block/add.html b/application/admin/view/cms/block/add.html deleted file mode 100644 index 4014ddd7..00000000 --- a/application/admin/view/cms/block/add.html +++ /dev/null @@ -1,66 +0,0 @@ -
        - -
        - -
        - -
        -
        -
        - -
        - -
        -
        -
        - -
        - -
        -
        -
        - -
        -
        - -
        - - -
        - -
        -
          -
          -
          -
          - -
          - -
          -
          -
          - -
          - -
          -
          -
          - -
          - -
          - {foreach name="statusList" item="vo"} - - {/foreach} -
          - -
          -
          - -
          diff --git a/application/admin/view/cms/block/edit.html b/application/admin/view/cms/block/edit.html deleted file mode 100644 index d27f6632..00000000 --- a/application/admin/view/cms/block/edit.html +++ /dev/null @@ -1,66 +0,0 @@ -
          - -
          - -
          - -
          -
          -
          - -
          - -
          -
          -
          - -
          - -
          -
          -
          - -
          -
          - -
          - - -
          - -
          -
            -
            -
            -
            - -
            - -
            -
            -
            - -
            - -
            -
            -
            - -
            - -
            - {foreach name="statusList" item="vo"} - - {/foreach} -
            - -
            -
            - -
            diff --git a/application/admin/view/cms/block/index.html b/application/admin/view/cms/block/index.html deleted file mode 100644 index 2206b204..00000000 --- a/application/admin/view/cms/block/index.html +++ /dev/null @@ -1,28 +0,0 @@ -
            - {:build_heading()} - -
            -
            -
            -
            -
            - {:build_toolbar('refresh,add,edit,del')} - -
            - -
            -
            -
            - -
            -
            -
            diff --git a/application/admin/view/cms/channel/add.html b/application/admin/view/cms/channel/add.html deleted file mode 100644 index cd2caf07..00000000 --- a/application/admin/view/cms/channel/add.html +++ /dev/null @@ -1,130 +0,0 @@ -
            - -
            - -
            - -
            - {foreach name="typeList" item="vo"} - - {/foreach} -
            -
            -
            - - 栏目: 栏目类型下不可以发布文章,但可以添加子栏目、列表、链接
            - 列表: 列表类型下可以发布文章,但不能添加子栏目
            - 链接: 链接类型下不可以发布文章和子级栏目
            -
            -
            -
            -
            -
            - -
            - -
            -
            -
            - -
            - -
            -
            -
            - -
            - -
            -
            -
            - -
            -
            - -
            - - -
            - -
            -
              -
              -
              -
              - -
              - -
              -
              -
              - -
              - -
              -
              -
              - -
              - -
              -
              - -
              - -
              - -
              -
              -
              - -
              - -
              -
              -
              - -
              - -
              -
              -
              - -
              - -
              -
              -
              - -
              - -
              - {foreach name="statusList" item="vo"} - - {/foreach} -
              - -
              -
              - -
              diff --git a/application/admin/view/cms/channel/edit.html b/application/admin/view/cms/channel/edit.html deleted file mode 100644 index 3c6425f6..00000000 --- a/application/admin/view/cms/channel/edit.html +++ /dev/null @@ -1,136 +0,0 @@ -
              - -
              - -
              - -
              - {foreach name="typeList" item="vo"} - - {/foreach} -
              -
              -
              - - 栏目: 栏目类型下不可以发布文章,但可以添加子栏目、列表、链接
              - 列表: 列表类型下可以发布文章,但不能添加子栏目
              - 链接: 链接类型下不可以发布文章和子级栏目
              -
              -
              -
              -
              -
              - -
              - -
              -
              -
              - -
              - -
              -
              -
              - -
              - -
              -
              -
              - -
              -
              - -
              - - -
              - -
              -
                -
                -
                -
                - -
                - -
                -
                -
                - -
                - -
                -
                -
                - -
                - -
                -
                - -
                - -
                - -
                -
                -
                - -
                - -
                -
                -
                - -
                - -
                -
                -
                - -
                - -
                -
                -
                - -
                - -
                -
                -
                - -
                - -
                - {foreach name="statusList" item="vo"} - - {/foreach} -
                - -
                -
                - -
                diff --git a/application/admin/view/cms/channel/index.html b/application/admin/view/cms/channel/index.html deleted file mode 100644 index 701f4490..00000000 --- a/application/admin/view/cms/channel/index.html +++ /dev/null @@ -1,37 +0,0 @@ -
                - -
                - {:build_heading(null,FALSE)} - -
                - -
                -
                -
                -
                -
                - {:build_toolbar('refresh,add,edit,del')} - -
                - -
                -
                -
                - -
                -
                -
                diff --git a/application/admin/view/cms/comment/add.html b/application/admin/view/cms/comment/add.html deleted file mode 100644 index fedb1faf..00000000 --- a/application/admin/view/cms/comment/add.html +++ /dev/null @@ -1,82 +0,0 @@ -
                - -
                - -
                - - - -
                -
                -
                - -
                - -
                -
                -
                - -
                - -
                -
                -
                - -
                - -
                -
                -
                - -
                - -
                -
                -
                - -
                - -
                -
                -
                - -
                - -
                -
                -
                - -
                - -
                -
                -
                - -
                - {:build_radios('row[subscribe]', [1=>'是', 0=>'否'])} -
                -
                -
                - -
                - -
                - {foreach name="statusList" item="vo"} - - {/foreach} -
                - -
                -
                - -
                diff --git a/application/admin/view/cms/comment/edit.html b/application/admin/view/cms/comment/edit.html deleted file mode 100644 index 876badd5..00000000 --- a/application/admin/view/cms/comment/edit.html +++ /dev/null @@ -1,82 +0,0 @@ -
                - -
                - -
                - - - -
                -
                -
                - -
                - -
                -
                -
                - -
                - -
                -
                -
                - -
                - -
                -
                -
                - -
                - -
                -
                -
                - -
                - -
                -
                -
                - -
                - -
                -
                -
                - -
                - -
                -
                -
                - -
                - {:build_radios('row[subscribe]', [1=>'是', 0=>'否'], $row['subscribe'])} -
                -
                -
                - -
                - -
                - {foreach name="statusList" item="vo"} - - {/foreach} -
                - -
                -
                - -
                diff --git a/application/admin/view/cms/comment/index.html b/application/admin/view/cms/comment/index.html deleted file mode 100644 index e33e5f01..00000000 --- a/application/admin/view/cms/comment/index.html +++ /dev/null @@ -1,32 +0,0 @@ -
                - {:build_heading()} - - -
                diff --git a/application/admin/view/cms/diydata/add.html b/application/admin/view/cms/diydata/add.html deleted file mode 100644 index 25b0bf9f..00000000 --- a/application/admin/view/cms/diydata/add.html +++ /dev/null @@ -1,17 +0,0 @@ -
                - -
                - -
                - -
                -
                - {include file="cms/diydata/fields"} - -
                diff --git a/application/admin/view/cms/diydata/edit.html b/application/admin/view/cms/diydata/edit.html deleted file mode 100644 index 8af9cc36..00000000 --- a/application/admin/view/cms/diydata/edit.html +++ /dev/null @@ -1,17 +0,0 @@ -
                - -
                - -
                - -
                -
                - {include file="cms/diydata/fields"} - -
                diff --git a/application/admin/view/cms/diydata/fields.html b/application/admin/view/cms/diydata/fields.html deleted file mode 100644 index 0c237b1b..00000000 --- a/application/admin/view/cms/diydata/fields.html +++ /dev/null @@ -1,102 +0,0 @@ -{foreach $fields as $item} - -
                -
                {$item.title}
                -
                - {switch $item.type} - {case string} - - {/case} - {case value="text" break="0"}{/case} - {case editor} - - {/case} - {case array} - {php}$arrList=isset($values[$item['name']])?(array)json_decode($item['value'],true):$item['content_list'];{/php} -
                -
                - {:__('Array key')} - {:__('Array value')} -
                - - {foreach $arrList as $key => $vo} -
                - - - - -
                - {/foreach} -
                {:__('Append')}
                -
                - {/case} - {case date} - - {/case} - {case time} - - {/case} - {case datetime} - - {/case} - {case number} - - {/case} - {case checkbox} - {foreach name="item.content_list" item="vo"} - - {/foreach} - {/case} - {case radio} - {foreach name="item.content_list" item="vo"} - - {/foreach} - {/case} - {case value="select" break="0"}{/case} - {case value="selects"} - - {/case} - {case value="image" break="0"}{/case} - {case value="images"} -
                - -
                - - -
                - -
                -
                  - {/case} - {case value="file" break="0"}{/case} - {case value="files"} -
                  - -
                  - - -
                  - -
                  - {/case} - {case switch} - - - - - {/case} - {case bool} - - - {/case} - {case custom} - {$item.content} - {/case} - {/switch} -
                  -
                  -{/foreach} \ No newline at end of file diff --git a/application/admin/view/cms/diydata/index.html b/application/admin/view/cms/diydata/index.html deleted file mode 100644 index 9f9a3fee..00000000 --- a/application/admin/view/cms/diydata/index.html +++ /dev/null @@ -1,29 +0,0 @@ -
                  - -
                  - {:build_heading(null,FALSE)} - -
                  - -
                  -
                  -
                  -
                  -
                  - {:build_toolbar('refresh,add,edit,del')} -
                  - -
                  -
                  -
                  - -
                  -
                  -
                  diff --git a/application/admin/view/cms/diyform/add.html b/application/admin/view/cms/diyform/add.html deleted file mode 100644 index a03a443b..00000000 --- a/application/admin/view/cms/diyform/add.html +++ /dev/null @@ -1,79 +0,0 @@ -
                  - -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - - - - -
                  -
                  -
                  - -
                  - -
                  - {foreach name="statusList" item="vo"} - - {/foreach} -
                  - -
                  -
                  - -
                  diff --git a/application/admin/view/cms/diyform/edit.html b/application/admin/view/cms/diyform/edit.html deleted file mode 100644 index 1bb71021..00000000 --- a/application/admin/view/cms/diyform/edit.html +++ /dev/null @@ -1,79 +0,0 @@ -
                  - -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - - - - -
                  -
                  -
                  - -
                  - -
                  - {foreach name="statusList" item="vo"} - - {/foreach} -
                  - -
                  -
                  - -
                  diff --git a/application/admin/view/cms/diyform/index.html b/application/admin/view/cms/diyform/index.html deleted file mode 100644 index 54399162..00000000 --- a/application/admin/view/cms/diyform/index.html +++ /dev/null @@ -1,24 +0,0 @@ -
                  - {:build_heading()} - -
                  -
                  -
                  -
                  -
                  - {:build_toolbar('refresh,add,edit,del')} -
                  - -
                  -
                  -
                  - -
                  -
                  -
                  diff --git a/application/admin/view/cms/diyform/tpl.html b/application/admin/view/cms/diyform/tpl.html deleted file mode 100644 index 7b49a6b4..00000000 --- a/application/admin/view/cms/diyform/tpl.html +++ /dev/null @@ -1,66 +0,0 @@ - - - \ No newline at end of file diff --git a/application/admin/view/cms/fields/add.html b/application/admin/view/cms/fields/add.html deleted file mode 100644 index ac8a7098..00000000 --- a/application/admin/view/cms/fields/add.html +++ /dev/null @@ -1,131 +0,0 @@ -
                  - - -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  - - - -
                  - -
                  - -
                  -
                  - -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  - -
                  - -
                  - - - - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  - {foreach name="statusList" item="vo"} - - {/foreach} -
                  - -
                  -
                  - -
                  diff --git a/application/admin/view/cms/fields/edit.html b/application/admin/view/cms/fields/edit.html deleted file mode 100644 index 2ffaa1e0..00000000 --- a/application/admin/view/cms/fields/edit.html +++ /dev/null @@ -1,132 +0,0 @@ -
                  - - - -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  - - - -
                  - -
                  - -
                  -
                  - -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  - -
                  - -
                  - - - - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  - {foreach name="statusList" item="vo"} - - {/foreach} -
                  - -
                  -
                  - -
                  diff --git a/application/admin/view/cms/fields/index.html b/application/admin/view/cms/fields/index.html deleted file mode 100644 index b0e151b8..00000000 --- a/application/admin/view/cms/fields/index.html +++ /dev/null @@ -1,36 +0,0 @@ -
                  - -
                  - {:build_heading(null,FALSE)} - -
                  - -
                  -
                  -
                  -
                  - - -
                  -
                  -
                  - -
                  -
                  -
                  diff --git a/application/admin/view/cms/modelx/add.html b/application/admin/view/cms/modelx/add.html deleted file mode 100644 index 46961faa..00000000 --- a/application/admin/view/cms/modelx/add.html +++ /dev/null @@ -1,40 +0,0 @@ -
                  - -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  - -
                  diff --git a/application/admin/view/cms/modelx/edit.html b/application/admin/view/cms/modelx/edit.html deleted file mode 100644 index 3f538850..00000000 --- a/application/admin/view/cms/modelx/edit.html +++ /dev/null @@ -1,40 +0,0 @@ -
                  - -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  - -
                  diff --git a/application/admin/view/cms/modelx/index.html b/application/admin/view/cms/modelx/index.html deleted file mode 100644 index 54399162..00000000 --- a/application/admin/view/cms/modelx/index.html +++ /dev/null @@ -1,24 +0,0 @@ -
                  - {:build_heading()} - -
                  -
                  -
                  -
                  -
                  - {:build_toolbar('refresh,add,edit,del')} -
                  - -
                  -
                  -
                  - -
                  -
                  -
                  diff --git a/application/admin/view/cms/modelx/tpl.html b/application/admin/view/cms/modelx/tpl.html deleted file mode 100644 index 7b49a6b4..00000000 --- a/application/admin/view/cms/modelx/tpl.html +++ /dev/null @@ -1,66 +0,0 @@ - - - \ No newline at end of file diff --git a/application/admin/view/cms/page/add.html b/application/admin/view/cms/page/add.html deleted file mode 100644 index 607581e0..00000000 --- a/application/admin/view/cms/page/add.html +++ /dev/null @@ -1,96 +0,0 @@ -
                  - -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - -
                  -
                  -
                  - -
                  - - - -
                  -
                  -
                  - -
                  -
                  - -
                  - - -
                  - -
                  -
                    -
                    -
                    -
                    - -
                    - -
                    -
                    -
                    - -
                    - -
                    -
                    -
                    - -
                    - -
                    -
                    -
                    - -
                    - -
                    -
                    -
                    - -
                    - -
                    - {foreach name="statusList" item="vo"} - - {/foreach} -
                    - -
                    -
                    - -
                    diff --git a/application/admin/view/cms/page/edit.html b/application/admin/view/cms/page/edit.html deleted file mode 100644 index 34b048b2..00000000 --- a/application/admin/view/cms/page/edit.html +++ /dev/null @@ -1,107 +0,0 @@ -
                    -
                    - -
                    - -
                    -
                    -
                    - -
                    - -
                    -
                    -
                    - -
                    - -
                    -
                    -
                    - -
                    - -
                    -
                    -
                    - -
                    - - - -
                    -
                    -
                    - -
                    -
                    - -
                    - - -
                    - -
                    -
                      -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      - {foreach name="statusList" item="vo"} - - {/foreach} -
                      - -
                      -
                      - -
                      diff --git a/application/admin/view/cms/page/index.html b/application/admin/view/cms/page/index.html deleted file mode 100644 index 36d4cf91..00000000 --- a/application/admin/view/cms/page/index.html +++ /dev/null @@ -1,36 +0,0 @@ -
                      -
                      - {:build_heading(null,FALSE)} - -
                      - -
                      -
                      -
                      -
                      -
                      - {:build_toolbar('refresh,add,edit,del')} - -
                      - -
                      -
                      -
                      - -
                      -
                      -
                      diff --git a/application/admin/view/cms/tags/add.html b/application/admin/view/cms/tags/add.html deleted file mode 100644 index 5b6a2fac..00000000 --- a/application/admin/view/cms/tags/add.html +++ /dev/null @@ -1,28 +0,0 @@ -
                      - -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      - -
                      diff --git a/application/admin/view/cms/tags/edit.html b/application/admin/view/cms/tags/edit.html deleted file mode 100644 index 97ff20cf..00000000 --- a/application/admin/view/cms/tags/edit.html +++ /dev/null @@ -1,28 +0,0 @@ -
                      - -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      - -
                      diff --git a/application/admin/view/cms/tags/index.html b/application/admin/view/cms/tags/index.html deleted file mode 100644 index a0379d73..00000000 --- a/application/admin/view/cms/tags/index.html +++ /dev/null @@ -1,21 +0,0 @@ -
                      - {:build_heading()} - -
                      -
                      -
                      -
                      -
                      - {:build_toolbar('refresh,delete')} -
                      - -
                      -
                      -
                      - -
                      -
                      -
                      diff --git a/application/admin/view/docs/add.html b/application/admin/view/docs/add.html deleted file mode 100644 index edeeafab..00000000 --- a/application/admin/view/docs/add.html +++ /dev/null @@ -1,63 +0,0 @@ - -
                      - -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      -
                      -
                      -
                      -
                      - -
                      - - -
                      -
                      - -
                      diff --git a/application/admin/view/docs/edit.html b/application/admin/view/docs/edit.html deleted file mode 100644 index 646d4b19..00000000 --- a/application/admin/view/docs/edit.html +++ /dev/null @@ -1,57 +0,0 @@ - -
                      - -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      -
                      -
                      -
                      -
                      - -
                      - - -
                      -
                      - -
                      diff --git a/application/admin/view/docs/index.html b/application/admin/view/docs/index.html deleted file mode 100644 index 018345bf..00000000 --- a/application/admin/view/docs/index.html +++ /dev/null @@ -1,23 +0,0 @@ -
                      - {:build_heading()} - -
                      -
                      -
                      -
                      - - -
                      -
                      -
                      - -
                      -
                      -
                      \ No newline at end of file diff --git a/application/admin/view/example/baidumap/index.html b/application/admin/view/example/baidumap/index.html deleted file mode 100644 index d282f847..00000000 --- a/application/admin/view/example/baidumap/index.html +++ /dev/null @@ -1,21 +0,0 @@ -
                      - {:build_heading()} - -
                      -
                      -
                      -
                      -
                      - {:build_toolbar('refresh,delete')} - 地图 -
                      - - -
                      - -
                      -
                      - -
                      -
                      -
                      \ No newline at end of file diff --git a/application/admin/view/example/baidumap/map.html b/application/admin/view/example/baidumap/map.html deleted file mode 100644 index 933125d5..00000000 --- a/application/admin/view/example/baidumap/map.html +++ /dev/null @@ -1,30 +0,0 @@ -{__NOLAYOUT__} - - - - {include file="common/meta" /} - - - - - -
                      - {include file="common/script" /} - - \ No newline at end of file diff --git a/application/admin/view/example/bootstraptable/detail.html b/application/admin/view/example/bootstraptable/detail.html deleted file mode 100644 index 82f035dc..00000000 --- a/application/admin/view/example/bootstraptable/detail.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - {volist name="row" id="vo" } - - - - - {/volist} - {if $Think.get.dialog} - - - - - {/if} - -
                      {:__('Title')}{:__('Content')}
                      {$key}{$vo}
                      回传数据 -
                      - - 回传数据 -
                      -
                      - \ No newline at end of file diff --git a/application/admin/view/example/bootstraptable/index.html b/application/admin/view/example/bootstraptable/index.html deleted file mode 100644 index 46052964..00000000 --- a/application/admin/view/example/bootstraptable/index.html +++ /dev/null @@ -1,49 +0,0 @@ -
                      - {:build_heading()} - -
                      - -
                      -
                      - \ No newline at end of file diff --git a/application/admin/view/example/colorbadge/index.html b/application/admin/view/example/colorbadge/index.html deleted file mode 100644 index 8d61a3a5..00000000 --- a/application/admin/view/example/colorbadge/index.html +++ /dev/null @@ -1,21 +0,0 @@ -
                      - {:build_heading()} - -
                      -
                      -
                      -
                      -
                      - {:build_toolbar('refresh,delete')} -
                      - - -
                      - - -
                      -
                      - -
                      -
                      -
                      \ No newline at end of file diff --git a/application/admin/view/example/controllerjump/index.html b/application/admin/view/example/controllerjump/index.html deleted file mode 100644 index 8d61a3a5..00000000 --- a/application/admin/view/example/controllerjump/index.html +++ /dev/null @@ -1,21 +0,0 @@ -
                      - {:build_heading()} - -
                      -
                      -
                      -
                      -
                      - {:build_toolbar('refresh,delete')} -
                      - - -
                      - - -
                      -
                      - -
                      -
                      -
                      \ No newline at end of file diff --git a/application/admin/view/example/customsearch/index.html b/application/admin/view/example/customsearch/index.html deleted file mode 100644 index 571e25d3..00000000 --- a/application/admin/view/example/customsearch/index.html +++ /dev/null @@ -1,116 +0,0 @@ -
                      - {:build_heading()} - -
                      -
                      -
                      -
                      -
                      - {:build_toolbar('refresh')} -
                      - - -
                      - -
                      -
                      - -
                      -
                      -
                      - - \ No newline at end of file diff --git a/application/admin/view/example/cxselect/index.html b/application/admin/view/example/cxselect/index.html deleted file mode 100644 index 2d78b77b..00000000 --- a/application/admin/view/example/cxselect/index.html +++ /dev/null @@ -1,160 +0,0 @@ - -
                      - {:build_heading()} - -
                      -
                      -
                      -
                      -
                      -
                      -
                      - -
                      -
                      省市区联动(通过AJAX读取数据)
                      -
                      -
                      -
                      -
                      - - - -
                      -
                      -
                      -
                      -
                      -
                      - -
                      -
                      -
                      -
                      -
                      - - - -
                      -
                      -
                      -
                      -
                      -
                      - -
                      -
                      -
                      - -
                      -
                      -
                      -
                      -
                      类别联动(Ajax读取数据)
                      -
                      -
                      -
                      -
                      - - -
                      -
                      -
                      -
                      -
                      -
                      - -
                      -
                      -
                      -
                      -
                      - - -
                      -
                      -
                      -
                      -
                      -
                      - -
                      -
                      - -
                      -
                      -
                      -
                      -
                      -
                      省市区联动(通过JSON渲染数据)
                      -
                      -
                      -
                      - -
                      - - - -
                      -
                      -
                      -
                      -
                      -
                      - -
                      -
                      -
                      -
                      - -
                      - - - -
                      -
                      -
                      -
                      -
                      -
                      - -
                      -
                      -
                      - -
                      -
                      -
                      -
                      -
                      -
                      - -
                      -
                      -
                      \ No newline at end of file diff --git a/application/admin/view/example/multitable/index.html b/application/admin/view/example/multitable/index.html deleted file mode 100644 index 38b662be..00000000 --- a/application/admin/view/example/multitable/index.html +++ /dev/null @@ -1,27 +0,0 @@ -
                      -
                      -
                      多表格(Multitable)用于展示在一个页面展示多个表格数据,并且每次切换时刷新
                      - -
                      -
                      -
                      -
                      -
                      - {:build_toolbar('refresh')} -
                      - -
                      -
                      -
                      -
                      - {:build_toolbar('refresh')} -
                      - -
                      -
                      -
                      -
                      -
                      \ No newline at end of file diff --git a/application/admin/view/example/relationmodel/index.html b/application/admin/view/example/relationmodel/index.html deleted file mode 100644 index 8d61a3a5..00000000 --- a/application/admin/view/example/relationmodel/index.html +++ /dev/null @@ -1,21 +0,0 @@ -
                      - {:build_heading()} - -
                      -
                      -
                      -
                      -
                      - {:build_toolbar('refresh,delete')} -
                      - - -
                      - - -
                      -
                      - -
                      -
                      -
                      \ No newline at end of file diff --git a/application/admin/view/example/tabletemplate/index.html b/application/admin/view/example/tabletemplate/index.html deleted file mode 100644 index 4d470e67..00000000 --- a/application/admin/view/example/tabletemplate/index.html +++ /dev/null @@ -1,67 +0,0 @@ -
                      - {:build_heading()} - -
                      -
                      -
                      -
                      -
                      - {:build_toolbar('refresh,delete')} - 获取选中项 - 切换视图 -
                      - - -
                      - -
                      -
                      - -
                      -
                      -
                      - - - \ No newline at end of file diff --git a/application/admin/view/general/database/index.html b/application/admin/view/general/database/index.html deleted file mode 100644 index ac48b1f7..00000000 --- a/application/admin/view/general/database/index.html +++ /dev/null @@ -1,114 +0,0 @@ - -
                      - {:build_heading()} - -
                      -
                      -
                      -
                      - {if $auth->check('general/database/query')} -
                      -
                      -

                      {:__('SQL Result')}:

                      -
                      -
                      -
                      - - {:__('Backup and Restore')} -
                      - - - -
                      -
                      -
                      - -
                      -
                      - -
                      -
                      - -
                      - -
                      - - - -
                      - {else /} -
                      - {/if} -
                      -
                      - -
                      -
                      -
                      - - \ No newline at end of file diff --git a/application/admin/view/test/add.html b/application/admin/view/test/add.html deleted file mode 100644 index 4b50d024..00000000 --- a/application/admin/view/test/add.html +++ /dev/null @@ -1,208 +0,0 @@ -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      -
                      - {foreach name="genderdataList" item="vo"} - - {/foreach} -
                      -
                      -
                      -
                      - -
                      - -
                      - {foreach name="hobbydataList" item="vo"} - - {/foreach} -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      - -
                      -
                      -
                      - -
                      -
                      - - -
                      - - -
                      -
                      -
                        -
                        -
                        -
                        - -
                        -
                        - - -
                        - - -
                        -
                        -
                          -
                          -
                          -
                          - -
                          -
                          - - -
                          - - -
                          -
                          - -
                          -
                          -
                          - -
                          - -
                          -
                          -
                          - -
                          - -
                          -
                          -
                          - -
                          -
                          -
                          -
                          -
                          - -
                          - -
                          -
                          -
                          - -
                          - -
                          -
                          -
                          - -
                          - -
                          -
                          -
                          - -
                          - -
                          -
                          -
                          - -
                          - -
                          -
                          -
                          - -
                          - -
                          -
                          -
                          - -
                          - -
                          -
                          -
                          - -
                          - -
                          -
                          -
                          - -
                          - -
                          -
                          -
                          - -
                          -
                          - {foreach name="statusList" item="vo"} - - {/foreach} -
                          -
                          -
                          -
                          - -
                          -
                          - {foreach name="stateList" item="vo"} - - {/foreach} -
                          -
                          -
                          - -
                          \ No newline at end of file diff --git a/application/admin/view/test/edit.html b/application/admin/view/test/edit.html deleted file mode 100644 index b5bfa59a..00000000 --- a/application/admin/view/test/edit.html +++ /dev/null @@ -1,208 +0,0 @@ -
                          -
                          - -
                          - -
                          -
                          -
                          - -
                          - -
                          -
                          -
                          - -
                          - -
                          -
                          -
                          - -
                          - -
                          -
                          -
                          - -
                          -
                          - {foreach name="genderdataList" item="vo"} - - {/foreach} -
                          -
                          -
                          -
                          - -
                          - -
                          - {foreach name="hobbydataList" item="vo"} - - {/foreach} -
                          - -
                          -
                          -
                          - -
                          - -
                          -
                          -
                          - -
                          - -
                          -
                          -
                          - -
                          -
                          - - -
                          - - -
                          -
                          -
                            -
                            -
                            -
                            - -
                            -
                            - - -
                            - - -
                            -
                            -
                              -
                              -
                              -
                              - -
                              -
                              - - -
                              - - -
                              -
                              - -
                              -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              -
                              -
                              -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              -
                              - {foreach name="statusList" item="vo"} - - {/foreach} -
                              -
                              -
                              -
                              - -
                              -
                              - {foreach name="stateList" item="vo"} - - {/foreach} -
                              -
                              -
                              - -
                              \ No newline at end of file diff --git a/application/admin/view/test/index.html b/application/admin/view/test/index.html deleted file mode 100644 index d3a50a31..00000000 --- a/application/admin/view/test/index.html +++ /dev/null @@ -1,30 +0,0 @@ -
                              - {:build_heading()} - -
                              \ No newline at end of file diff --git a/application/admin/view/wechat/.DS_Store b/application/admin/view/wechat/.DS_Store deleted file mode 100644 index 527971697796a8e1d32ae52e012f6d93df9e3d41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeI1&yUhT6vyA};@U2R)VM~H)udM=hq9|{xFPOdj7AbRY>aELmG07{wxlf(LP$7y z@aliyPZIwC@9w(lpP*-d{0n;X%?}U@c+;rNka^!S^WHS`$xO=|0Du&mwH!bO02HiL zwIrG;h4#}rQ5HlC?Iaiv5P%I0aG_(hC%k2YBp?Y$0+N6vAPM{p1n`|ri!$TA&wHhn z1SEmEBtV}JI##L$p?$9G(Se4g0H_IUW(BV?4`4C6(1OrDR~Cw6^6Y_#P$E(c!o#s& zr|zf)p?$7A90(5wBJNB?hC{V#Ndk1+s9-`9BJjua_po8PzJ(iU z)oQp-7#YR~vapyqwsc%kmy@YvI;o}7$@J}V-EWs8GiruKGpK53%1+I;%wWfY_C}+=KtyrD=4_~}II6Qju_T9%%pE)lgo;k1*`Wfr2X>o?Xk*A8(e#uQ6D9Y-&i<+v*&|@*BsLb+e!X?WRK!dV!#q`56_W2Xi8WB6xIkx43xq)Y=}p0bbWK6>UCv$5?PHf6)i|f@PUq&+*7hQZ4Tw>h#5YkElb4_58&pt!*|E<~Q z|8vbqPF@oD-wBY!W_h!SvmE};jZc{7+B()dSZSeteXcA74NJ#SSvrn7`oj>fb#$dM V1)+Ve*n&kK1TYNJNCJP9z<1X}dK~}& diff --git a/application/admin/view/wechat/autoreply/add.html b/application/admin/view/wechat/autoreply/add.html deleted file mode 100644 index faffae44..00000000 --- a/application/admin/view/wechat/autoreply/add.html +++ /dev/null @@ -1,51 +0,0 @@ - - -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              - -
                              -
                              -
                              - - -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              - {:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')])} -
                              -
                              - - -
                              diff --git a/application/admin/view/wechat/autoreply/edit.html b/application/admin/view/wechat/autoreply/edit.html deleted file mode 100644 index 69473ef7..00000000 --- a/application/admin/view/wechat/autoreply/edit.html +++ /dev/null @@ -1,51 +0,0 @@ - - -
                              - -
                              - -
                              - -
                              -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              -
                              - - 选择现有资源
                              资源名:{:$response['title']}
                              - 添加新资源 -
                              -
                              -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              - {:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')], $row['status'])} -
                              -
                              - -
                              diff --git a/application/admin/view/wechat/autoreply/index.html b/application/admin/view/wechat/autoreply/index.html deleted file mode 100644 index f4dacfa6..00000000 --- a/application/admin/view/wechat/autoreply/index.html +++ /dev/null @@ -1,28 +0,0 @@ -
                              - {:build_heading()} - -
                              -
                              -
                              -
                              -
                              - {:build_toolbar()} - -
                              - -
                              -
                              -
                              - -
                              -
                              -
                              diff --git a/application/admin/view/wechat/config/add.html b/application/admin/view/wechat/config/add.html deleted file mode 100644 index 015f524f..00000000 --- a/application/admin/view/wechat/config/add.html +++ /dev/null @@ -1,45 +0,0 @@ -
                              - -
                              - -
                              - -
                              -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              -

                              - {:__('Json editor')} - {:__('Insert link')} -

                              - -
                              -
                              - {:__('Json key')} - {:__('Json value')} -
                              -
                              - - - - -
                              -
                              {:__('Append')}
                              -
                              -
                              -
                              - -
                              diff --git a/application/admin/view/wechat/config/edit.html b/application/admin/view/wechat/config/edit.html deleted file mode 100644 index 334731cf..00000000 --- a/application/admin/view/wechat/config/edit.html +++ /dev/null @@ -1,47 +0,0 @@ -
                              - -
                              - -
                              - -
                              -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              -

                              - {:__('Json editor')} - {:__('Insert link')} -

                              - -
                              -
                              - {:__('Json key')} - {:__('Json value')} -
                              - {foreach $value as $key => $vo} -
                              - - - - -
                              - {/foreach} -
                              {:__('Append')}
                              -
                              -
                              -
                              - -
                              diff --git a/application/admin/view/wechat/config/index.html b/application/admin/view/wechat/config/index.html deleted file mode 100644 index 48c139e1..00000000 --- a/application/admin/view/wechat/config/index.html +++ /dev/null @@ -1,28 +0,0 @@ -
                              - {:build_heading()} - -
                              -
                              -
                              -
                              - - -
                              -
                              -
                              - -
                              -
                              -
                              diff --git a/application/admin/view/wechat/menu/index.html b/application/admin/view/wechat/menu/index.html deleted file mode 100644 index ebc1fdfb..00000000 --- a/application/admin/view/wechat/menu/index.html +++ /dev/null @@ -1,84 +0,0 @@ - -
                              - {:build_heading()} - -
                              -
                              -
                              -
                              -
                              -
                              -
                              {$site.name}
                              - -
                              -
                              - -
                              - 点击左侧菜单进行编辑操作 -
                              -
                              -
                              -
                              -
                              - 可直接拖动菜单排序 -
                              - -
                              -
                              -
                              - -
                              -
                              -
                              - diff --git a/application/admin/view/wechat/response/add.html b/application/admin/view/wechat/response/add.html deleted file mode 100644 index 6d718a5d..00000000 --- a/application/admin/view/wechat/response/add.html +++ /dev/null @@ -1,48 +0,0 @@ -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              - - - - -
                              -
                              -
                              - -
                              -
                              - -
                              - {:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')])} -
                              -
                              -
                              -
                              -
                              - - -
                              -
                              - -
                              - \ No newline at end of file diff --git a/application/admin/view/wechat/response/edit.html b/application/admin/view/wechat/response/edit.html deleted file mode 100644 index 9ee6d32a..00000000 --- a/application/admin/view/wechat/response/edit.html +++ /dev/null @@ -1,52 +0,0 @@ -
                              - -
                              - -
                              - -
                              -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              - -
                              -
                              -
                              - -
                              - {:build_radios('row[type]', ['text' => __('Text'), 'app' => __('App')], $row['type'])} -
                              -
                              -
                              - -
                              -
                              -
                              -
                              - {:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')], $row['status'])} -
                              -
                              - - -
                              - \ No newline at end of file diff --git a/application/admin/view/wechat/response/index.html b/application/admin/view/wechat/response/index.html deleted file mode 100644 index 9c3bca15..00000000 --- a/application/admin/view/wechat/response/index.html +++ /dev/null @@ -1,21 +0,0 @@ -
                              - {:build_heading()} - -
                              -
                              -
                              -
                              -
                              - {:build_toolbar();} -
                              - -
                              -
                              -
                              - -
                              -
                              -
                              diff --git a/application/admin/view/wechat/response/select.html b/application/admin/view/wechat/response/select.html deleted file mode 100644 index 6139835a..00000000 --- a/application/admin/view/wechat/response/select.html +++ /dev/null @@ -1,16 +0,0 @@ -
                              - {:build_heading()} - -
                              -
                              -
                              -
                              - - -
                              -
                              -
                              - -
                              -
                              -
                              diff --git a/application/common/model/MoneyLog.php b/application/common/model/MoneyLog.php deleted file mode 100644 index 9b3f8377..00000000 --- a/application/common/model/MoneyLog.php +++ /dev/null @@ -1,23 +0,0 @@ - $name]); - return $item ? $item->value : ''; - } - -} diff --git a/application/common/model/WechatContext.php b/application/common/model/WechatContext.php deleted file mode 100644 index 2eeb495d..00000000 --- a/application/common/model/WechatContext.php +++ /dev/null @@ -1,16 +0,0 @@ -request->get('id'); - $archives = $id ? \app\admin\model\Archives::get($id) : null; - - if ($archives) { - $channel = Channel::get($archives['channel_id']); - if (!$channel) { - $this->error(__('未找到指定栏目')); - } - $model = \addons\cms\model\Modelx::get($channel['model_id']); - if (!$model) { - $this->error(__('未找到指定模型')); - } - if ($archives['user_id'] != $this->auth->id) { - $this->error("无法进行越权操作!"); - } - } else { - $model = null; - $model_id = $this->request->request('model_id'); - // 如果有model_id则调用指定模型 - if ($model_id) { - $model = Modelx::get($model_id); - } - } - - // 如果来源于提交 - if ($this->request->isPost()) { - $row = $this->request->post('row/a'); - $token = $this->request->post('token'); - $rule = [ - 'title|标题' => 'require|length:3,100', - 'channel_id|栏目' => 'require|integer', - 'content|内容' => 'require', - '__token__' => 'token', - ]; - - $msg = [ - 'title.require' => '标题不能为空', - 'title.length' => '标题长度限制在3~100个字符', - 'channel_id' => '栏目不能为空', - 'content.require' => '内容不能为空', - ]; - $row['__token__'] = $token; - $validate = new Validate($rule, $msg); - $result = $validate->check($row); - if (!$result) { - $this->error($validate->getError(), null, ['token' => $this->request->token()]); - } - - $row['user_id'] = $this->auth->id; - $row['status'] = 'hidden'; - try { - if ($archives) { - $archives->allowField(true)->save($row); - } else { - (new \app\admin\model\Archives)->allowField(true)->save($row); - } - } catch (Exception $e) { - $this->error("发生错误:" . $e->getMessage()); - } - $this->success("发布成功!请等待审核!"); - exit; - } - - // 合并主副表 - if ($archives) { - $addon = db($model['table'])->where('id', $archives['id'])->find(); - if ($addon) { - $archives = array_merge($archives->toArray(), $addon); - } - } - - $channel = new Channel(); - if ($model) { - $channel->where('model_id', $model['id']); - } - // 读取可发布的栏目列表 - $disabledIds = []; - $channelList = collection( - $channel->where('type', '<>', 'link') - ->where("((type='list' AND iscontribute='1') OR type='channel')") - ->order("weigh desc,id desc") - ->cache(false) - ->select() - )->toArray(); - $channelParents = []; - foreach ($channelList as $index => $item) { - if ($item['parent_id']) { - $channelParents[] = $item['parent_id']; - } - } - foreach ($channelList as $k => $v) { - if ($v['type'] != 'list') { - $disabledIds[] = $v['id']; - } - if ($v['type'] == 'channel' && !in_array($v['id'], $channelParents)) { - unset($channelList[$k]); - } - } - $tree = Tree::instance()->init($channelList, 'parent_id'); - $channelOptions = $tree->getTree(0, "", $archives ? $archives['channel_id'] : '', $disabledIds); - $this->view->assign('channelOptions', $channelOptions); - $this->view->assign([ - 'archives' => $archives, - 'channelOptions' => $channelOptions, - 'categoryList' => '' - ]); - $this->assignconfig('archives_id', $archives ? $archives['id'] : 0); - - $modelName = $model ? $model['name'] : '文章'; - $this->view->assign('title', $archives ? "修改{$modelName}" : "发布{$modelName}"); - $this->view->assign('model', $model); - return $this->view->fetch(); - } - - /** - * 我的发布 - * @return string - * @throws \think\Exception - * @throws \think\exception\DbException - */ - public function my() - { - $archives = new \addons\cms\model\Archives; - $model = null; - $model_id = $this->request->request('model_id'); - // 如果有model_id则调用指定模型 - if ($model_id) { - $model = Modelx::get($model_id); - if ($model) { - $archives->where('model_id', $model_id); - } - } - $config = ['query' => []]; - if ($model) { - $config['query']['model_id'] = $model_id; - } - $archivesList = $archives->where('user_id', $this->auth->id) - ->order('id', 'desc') - ->paginate(10, null, $config); - $this->view->assign('archivesList', $archivesList); - $this->view->assign('title', '我发布的' . ($model ? $model['name'] : '文章')); - $this->view->assign('model', $model); - return $this->view->fetch(); - } - - /** - * 获取栏目列表 - * @internal - */ - public function get_channel_fields() - { - $this->view->engine->layout(false); - $channel_id = $this->request->post('channel_id'); - $archives_id = $this->request->post('archives_id'); - $channel = Channel::get($channel_id, 'model'); - if ($channel && $channel['type'] === 'list') { - - $values = []; - if ($archives_id) { - $values = db($channel['model']['table'])->where('id', $archives_id)->find(); - } - - $fields = Fields::where('model_id', $channel['model_id']) - ->where('iscontribute', 1) - ->where('status', 'normal') - ->order('weigh desc,id desc') - ->select(); - foreach ($fields as $k => $v) { - //优先取编辑的值,再次取默认值 - $v->value = isset($values[$v['name']]) ? $values[$v['name']] : (is_null($v['defaultvalue']) ? '' : $v['defaultvalue']); - $v->rule = str_replace(',', '; ', $v->rule); - if (in_array($v->type, ['checkbox', 'lists', 'images'])) { - $checked = ''; - if ($v['minimum'] && $v['maximum']) - $checked = "{$v['minimum']}~{$v['maximum']}"; - else if ($v['minimum']) - $checked = "{$v['minimum']}~"; - else if ($v['maximum']) - $checked = "~{$v['maximum']}"; - if ($checked) - $v->rule .= (';checked(' . $checked . ')'); - } - if (in_array($v->type, ['checkbox', 'radio']) && stripos($v->rule, 'required') !== false) { - $v->rule = str_replace('required', 'checked', $v->rule); - } - if (in_array($v->type, ['selects'])) { - $v->extend .= (' ' . 'data-max-options="' . $v['maximum'] . '"'); - } - } - - $this->view->assign('fields', $fields); - $this->view->assign('values', $values); - $this->success('', null, ['html' => $this->view->fetch('fields')]); - } else { - $this->error(__('请选择栏目')); - } - $this->error(__('参数不能为空', 'ids')); - } -} diff --git a/application/index/controller/cms/Diyform.php b/application/index/controller/cms/Diyform.php deleted file mode 100644 index c032a440..00000000 --- a/application/index/controller/cms/Diyform.php +++ /dev/null @@ -1,54 +0,0 @@ -request->param('diyname'); - if ($diyname && !is_numeric($diyname)) { - $diyform = DiyformModel::getByDiyname($diyname); - } else { - $id = $diyname ? $diyname : $this->request->get('id', ''); - $diyform = DiyformModel::get($id); - } - if (!$diyform || $diyform['status'] == 'hidden') { - $this->error(__('表单未找到')); - } - $fields = DiyformModel::getDiyformFields($diyform['id']); - $this->view->assign('diyform', $diyform); - $this->view->assign('fields', $fields); - - return $this->view->fetch(); - } -} diff --git a/application/index/lang/zh-cn/cms/archives.php b/application/index/lang/zh-cn/cms/archives.php deleted file mode 100644 index d0599f4a..00000000 --- a/application/index/lang/zh-cn/cms/archives.php +++ /dev/null @@ -1,14 +0,0 @@ - '栏目', - 'Tags' => '标签', - 'Keywords' => '关键字', - 'Description' => '描述', - 'Upload' => '上传', - 'Image' => '缩略图' - - - - - -]; \ No newline at end of file diff --git a/application/index/lang/zh-cn/cms/diyform.php b/application/index/lang/zh-cn/cms/diyform.php deleted file mode 100644 index d3a04625..00000000 --- a/application/index/lang/zh-cn/cms/diyform.php +++ /dev/null @@ -1,7 +0,0 @@ - '上传', - 'Array key' => '键', - 'Array value' => '值', - -]; \ No newline at end of file diff --git a/application/index/view/cms/archives/fields.html b/application/index/view/cms/archives/fields.html deleted file mode 100644 index 646e2362..00000000 --- a/application/index/view/cms/archives/fields.html +++ /dev/null @@ -1,100 +0,0 @@ -{foreach $fields as $item} - -
                              -
                              {$item.title}
                              -
                              - {switch $item.type} - {case string} - - {/case} - {case value="text" break="0"}{/case} - {case editor} - - {/case} - {case array} - {php}$arrList=isset($values[$item['name']])?(array)json_decode($item['value'],true):$item['content_list'];{/php} -
                              -
                              - {:__('Array key')} - {:__('Array value')} -
                              - - {foreach $arrList as $key => $vo} -
                              - - - - -
                              - {/foreach} -
                              {:__('Append')}
                              -
                              - {/case} - {case date} - - {/case} - {case time} - - {/case} - {case datetime} - - {/case} - {case number} - - {/case} - {case checkbox} - {foreach name="item.content_list" item="vo"} - - {/foreach} - {/case} - {case radio} - {foreach name="item.content_list" item="vo"} - - {/foreach} - {/case} - {case value="select" break="0"}{/case} - {case value="selects"} - - {/case} - {case value="image" break="0"}{/case} - {case value="images"} -
                              - -
                              - - -
                              -
                              -
                                - {/case} - {case value="file" break="0"}{/case} - {case value="files"} -
                                - -
                                - - -
                                -
                                - {/case} - {case switch} - - - - - {/case} - {case bool} - - - {/case} - {case custom} - {$item.content} - {/case} - {/switch} -
                                -
                                -{/foreach} \ No newline at end of file diff --git a/application/index/view/cms/archives/my.html b/application/index/view/cms/archives/my.html deleted file mode 100644 index 4f247432..00000000 --- a/application/index/view/cms/archives/my.html +++ /dev/null @@ -1,65 +0,0 @@ - -
                                -
                                -
                                -
                                - {include file="common/sidenav" /} -
                                -
                                -
                                -
                                -
                                -

                                {$title}

                                - 发布{:$model?$model.name:'文章'} -
                                - {volist name='archivesList' id='item'} -
                                -
                                -
                                - - - -
                                -
                                -
                                -

                                - {$item.title} -

                                -

                                发布时间:{$item.createtime|datetime}

                                -
                                - {if $item['status'] == 'normal'} - 立即查看 - {elseif $item['status'] == 'rejected'} - 被拒绝 - {elseif $item['status'] == 'pulloff'} - 已下架 - {elseif $item['status'] == 'hidden' /} - 正在审核 - {/if} -
                                -
                                -
                                -
                                - {/volist} -
                                {$archivesList->render()}
                                -
                                -
                                -
                                -
                                -
                                -
                                \ No newline at end of file diff --git a/application/index/view/cms/archives/post.html b/application/index/view/cms/archives/post.html deleted file mode 100644 index 28187c30..00000000 --- a/application/index/view/cms/archives/post.html +++ /dev/null @@ -1,107 +0,0 @@ - - - -
                                -
                                -
                                -
                                - {include file="common/sidenav" /} -
                                -
                                -
                                -
                                - {if $archives && $archives['status']=='normal'} -
                                - 温馨提示:当前{:$model?$model.name:'文章'}已经发布,如果修改将重新进入审核 -
                                - {/if} -
                                -

                                {:$archives?'修改':'发布'}{:$model?$model.name:'文章'}

                                -
                                -
                                -
                                -
                                - {:token()} -
                                - -
                                - -
                                -
                                -
                                - -
                                - -
                                -
                                - -
                                - -
                                -
                                - -
                                - - -
                                -
                                -
                                  -
                                  -
                                  -
                                  - -
                                  - -
                                  -
                                  -
                                  - -
                                  - -
                                  -
                                  -
                                  - -
                                  - -
                                  -
                                  -
                                  - -
                                  - -
                                  -
                                  -
                                  - - -
                                  -
                                  -
                                  -
                                  -
                                  -
                                  -
                                  -
                                  -
                                  \ No newline at end of file diff --git a/application/index/view/cms/common/fields.html b/application/index/view/cms/common/fields.html deleted file mode 100644 index 646e2362..00000000 --- a/application/index/view/cms/common/fields.html +++ /dev/null @@ -1,100 +0,0 @@ -{foreach $fields as $item} - -
                                  -
                                  {$item.title}
                                  -
                                  - {switch $item.type} - {case string} - - {/case} - {case value="text" break="0"}{/case} - {case editor} - - {/case} - {case array} - {php}$arrList=isset($values[$item['name']])?(array)json_decode($item['value'],true):$item['content_list'];{/php} -
                                  -
                                  - {:__('Array key')} - {:__('Array value')} -
                                  - - {foreach $arrList as $key => $vo} -
                                  - - - - -
                                  - {/foreach} -
                                  {:__('Append')}
                                  -
                                  - {/case} - {case date} - - {/case} - {case time} - - {/case} - {case datetime} - - {/case} - {case number} - - {/case} - {case checkbox} - {foreach name="item.content_list" item="vo"} - - {/foreach} - {/case} - {case radio} - {foreach name="item.content_list" item="vo"} - - {/foreach} - {/case} - {case value="select" break="0"}{/case} - {case value="selects"} - - {/case} - {case value="image" break="0"}{/case} - {case value="images"} -
                                  - -
                                  - - -
                                  -
                                  -
                                    - {/case} - {case value="file" break="0"}{/case} - {case value="files"} -
                                    - -
                                    - - -
                                    -
                                    - {/case} - {case switch} - - - - - {/case} - {case bool} - - - {/case} - {case custom} - {$item.content} - {/case} - {/switch} -
                                    -
                                    -{/foreach} \ No newline at end of file diff --git a/application/index/view/cms/diyform/index.html b/application/index/view/cms/diyform/index.html deleted file mode 100644 index 34c2b6c8..00000000 --- a/application/index/view/cms/diyform/index.html +++ /dev/null @@ -1,46 +0,0 @@ - - - -
                                    -
                                    -
                                    -
                                    - {include file="common/sidenav" /} -
                                    -
                                    -
                                    -
                                    -
                                    -

                                    {$diyform.title}

                                    -
                                    -
                                    -
                                    -
                                    - - {:token()} - {include file="cms/common/fields" /} - - - -
                                    -
                                    -
                                    -
                                    -
                                    -
                                    -
                                    -
                                    -
                                    \ No newline at end of file diff --git a/public/admin.php.bak b/public/admin.php.bak deleted file mode 100644 index a1c1350d..00000000 --- a/public/admin.php.bak +++ /dev/null @@ -1,38 +0,0 @@ - -// +---------------------------------------------------------------------- -// [ 后台入口文件 ] -// 使用此文件可以达到隐藏admin模块的效果 -// 建议将admin.php改成其它任意的文件名,同时修改config.php中的'deny_module_list',把admin模块也添加进去 -// 定义应用目录 -define('APP_PATH', __DIR__ . '/../application/'); - -// 判断是否安装FastAdmin -if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) -{ - header("location:./install.php"); - exit; -} - -// 加载框架引导文件 -require __DIR__ . '/../thinkphp/base.php'; - -// 绑定到admin模块 -\think\Route::bind('admin'); - -// 关闭路由 -\think\App::route(false); - -// 设置根url -\think\Url::root(''); - -// 执行应用 -\think\App::run()->send(); diff --git a/public/assets/js/backend/cms/archives.js b/public/assets/js/backend/cms/archives.js deleted file mode 100644 index 034ec916..00000000 --- a/public/assets/js/backend/cms/archives.js +++ /dev/null @@ -1,476 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function ($, undefined, Backend, Table, Form, Template) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'cms/archives/index', - add_url: 'cms/archives/add', - edit_url: 'cms/archives/edit', - del_url: 'cms/archives/del', - multi_url: 'cms/archives/multi', - dragsort_url: '', - table: 'archives', - } - }); - - var table = $("#table"); - - //在表格内容渲染完成后回调的事件 - table.on('post-body.bs.table', function (e, settings, json, xhr) { - $(".btn-editone", this) - .off("click") - .removeClass("btn-editone") - .addClass("btn-addtabs") - .prop("title", __('Edit')); - }); - //当双击单元格时 - table.on('dbl-click-row.bs.table', function (e, row, element, field) { - $(".btn-addtabs", element).trigger("click"); - }); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - pk: 'id', - sortName: 'weigh', - searchFormVisible: Fast.api.query("model_id") ? true : false, - columns: [ - [ - {checkbox: true}, - {field: 'id', title: __('Id'), sortable: true}, - { - field: 'user_id', - title: __('User_id'), - visible: false, - addclass: 'selectpage', - extend: 'data-source="user/user/index" data-field="nickname"', - operate: '=', - formatter: Table.api.formatter.search - }, - { - field: 'channel_id', - title: __('Channel_id'), - visible: false, - operate: false, - formatter: Table.api.formatter.search - }, - { - field: 'channel.name', - title: __('Channel'), - operate: false, - formatter: function (value, row, index) { - return '' + value + ''; - } - }, - { - field: 'title', title: __('Title'), align: 'left', formatter: function (value, row, index) { - return '
                                    ' + value + '
                                    ' + Table.api.formatter.flag.call(this, row['flag'], row, index); - } - }, - {field: 'image', title: __('Image'), operate: false, formatter: Table.api.formatter.image}, - {field: 'views', title: __('Views'), operate: 'BETWEEN', sortable: true}, - {field: 'comments', title: __('Comments'), operate: 'BETWEEN', sortable: true}, - {field: 'weigh', title: __('Weigh'), operate: false}, - { - field: 'url', title: __('Url'), operate: false, formatter: function (value, row, index) { - return ''; - } - }, - { - field: 'createtime', - title: __('Createtime'), - visible: false, - operate: 'RANGE', - addclass: 'datetimerange', - formatter: Table.api.formatter.datetime - }, - { - field: 'updatetime', - title: __('Updatetime'), - sortable: true, - operate: 'RANGE', - addclass: 'datetimerange', - formatter: Table.api.formatter.datetime - }, - {field: 'status', title: __('Status'), searchList: {"normal": __('Status normal'), "hidden": __('Status hidden'), "rejected": __('Status rejected'), "pulloff": __('Status pulloff')}, formatter: Table.api.formatter.status}, - { - field: 'operate', - title: __('Operate'), - table: table, - events: Table.api.events.operate, - formatter: Table.api.formatter.operate - } - ] - ] - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - - $(document).on("click", "a.btn-channel", function () { - $("#archivespanel").toggleClass("col-md-9", $("#channelbar").hasClass("hidden")); - $("#channelbar").toggleClass("hidden"); - }); - - require(['jstree'], function () { - //全选和展开 - $(document).on("click", "#checkall", function () { - $("#channeltree").jstree($(this).prop("checked") ? "check_all" : "uncheck_all"); - }); - $(document).on("click", "#expandall", function () { - $("#channeltree").jstree($(this).prop("checked") ? "open_all" : "close_all"); - }); - $('#channeltree').on("changed.jstree", function (e, data) { - var options = table.bootstrapTable('getOptions'); - options.pageNumber = 1; - options.queryParams = function (params) { - params.filter = JSON.stringify(data.selected.length > 0 ? {channel_id: data.selected.join(",")} : {}); - params.op = JSON.stringify(data.selected.length > 0 ? {channel_id: 'in'} : {}); - return params; - }; - table.bootstrapTable('refresh', {}); - return false; - }); - $('#channeltree').jstree({ - "themes": { - "stripes": true - }, - "checkbox": { - "keep_selected_style": false, - }, - "types": { - "channel": { - "icon": "fa fa-th", - }, - "list": { - "icon": "fa fa-list", - }, - "link": { - "icon": "fa fa-link", - }, - "disabled": { - "check_node": false, - "uncheck_node": false - } - }, - 'plugins': ["types", "checkbox"], - "core": { - "multiple": true, - 'check_callback': true, - "data": Config.channelList - } - }); - }); - - $(document).on('click', '.btn-move', function () { - var ids = Table.api.selectedids(table); - Layer.open({ - title: __('Move'), - content: Template("channeltpl", {}), - btn: [__('Move')], - yes: function (index, layero) { - var channel_id = $("select[name='channel']", layero).val(); - if (channel_id == 0) { - Toastr.error(__('Please select channel')); - return; - } - Fast.api.ajax({ - url: "cms/archives/move/ids/" + ids.join(","), - type: "post", - data: {channel_id: channel_id}, - }, function () { - table.bootstrapTable('refresh', {}); - Layer.close(index); - }); - }, - success: function (layero, index) { - } - }); - }); - }, - content: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'cms/archives/content/model_id/' + Config.model_id, - add_url: '', - edit_url: 'cms/archives/edit', - del_url: 'cms/archives/del', - multi_url: '', - table: '', - } - }); - - var table = $("#table"); - //在表格内容渲染完成后回调的事件 - table.on('post-body.bs.table', function (e, settings, json, xhr) { - $(".btn-editone", this) - .off("click") - .removeClass("btn-editone") - .addClass("btn-addtabs") - .prop("title", __('Edit')); - }); - //默认字段 - var columns = [ - {checkbox: true}, - //这里因为涉及到关联多个表,因为用了两个字段来操作,一个隐藏,一个搜索 - {field: 'main.id', title: __('Id'), visible: false}, - {field: 'id', title: __('Id'), operate: false}, - { - field: 'channel_id', - title: __('Channel_id'), - addclass: 'selectpage', - extend: 'data-source="cms/channel/index"', - formatter: Table.api.formatter.search - }, - {field: 'channel_name', title: __('Channel_name'), operate: false} - ]; - //动态追加字段 - $.each(Config.fields, function (i, j) { - var data = {field: j.field, title: j.title, operate: 'like'}; - //如果是图片,加上formatter - if (j.type == 'image') { - data.formatter = Table.api.formatter.image; - } else if (j.type == 'images') { - data.formatter = Table.api.formatter.images; - } else if (j.type == 'radio' || j.type == 'check' || j.type == 'select' || j.type == 'selects') { - data.formatter = Controller.api.formatter.content; - data.extend = j.content; - } - columns.push(data); - }); - //追加操作字段 - columns.push({ - field: 'operate', - title: __('Operate'), - table: table, - events: Table.api.events.operate, - formatter: Table.api.formatter.operate - }); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - pk: 'id', - sortName: 'id', - columns: columns - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - diyform: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'cms/archives/diyform/diyform_id/' + Config.diyform_id, - add_url: '', - edit_url: 'cms/archives/edit', - del_url: 'cms/archives/del', - multi_url: '', - table: '', - } - }); - - var table = $("#table"); - //在表格内容渲染完成后回调的事件 - table.on('post-body.bs.table', function (e, settings, json, xhr) { - $(".btn-editone", this) - .off("click") - .removeClass("btn-editone") - .addClass("btn-addtabs") - .prop("title", __('Edit')); - }); - //默认字段 - var columns = [ - {checkbox: true}, - {field: 'id', title: __('Id'), operate: false}, - ]; - //动态追加字段 - $.each(Config.fields, function (i, j) { - var data = {field: j.field, title: j.title, operate: 'like'}; - //如果是图片,加上formatter - if (j.type == 'image') { - data.formatter = Table.api.formatter.image; - } else if (j.type == 'images') { - data.formatter = Table.api.formatter.images; - } else if (j.type == 'radio' || j.type == 'check' || j.type == 'select' || j.type == 'selects') { - data.formatter = Controller.api.formatter.content; - data.extend = j.content; - } - columns.push(data); - }); - //追加操作字段 - columns.push({ - field: 'operate', - title: __('Operate'), - table: table, - events: Table.api.events.operate, - formatter: Table.api.formatter.operate - }); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - pk: 'id', - sortName: 'id', - columns: columns - }) - ; - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - recyclebin: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - 'dragsort_url': '' - } - }); - - var table = $("#table"); - - // 初始化表格 - table.bootstrapTable({ - url: 'cms/archives/recyclebin', - pk: 'id', - sortName: 'weigh', - columns: [ - [ - {checkbox: true}, - {field: 'id', title: __('Id')}, - {field: 'title', title: __('Title'), align: 'left'}, - {field: 'image', title: __('Image'), operate: false, formatter: Table.api.formatter.image}, - { - field: 'deletetime', - title: __('Deletetime'), - operate: 'RANGE', - addclass: 'datetimerange', - formatter: Table.api.formatter.datetime - }, - { - field: 'operate', - width: '130px', - title: __('Operate'), - table: table, - events: Table.api.events.operate, - buttons: [ - { - name: 'Restore', - text: __('Restore'), - classname: 'btn btn-xs btn-info btn-restoreit', - icon: 'fa fa-rotate-left', - url: 'cms/archives/restore' - }, - { - name: 'Destroy', - text: __('Destroy'), - classname: 'btn btn-xs btn-danger btn-destroyit', - icon: 'fa fa-times', - url: 'cms/archives/destroy' - } - ], - formatter: Table.api.formatter.operate - } - ] - ] - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - - $(document).on('click', '.btn-destroyall', function () { - var that = this; - Layer.confirm(__('Are you sure you want to truncate?'), function () { - Fast.api.ajax($(that).attr("href"), function () { - Layer.closeAll(); - table.bootstrapTable('refresh'); - }, function () { - Layer.closeAll(); - }); - }); - return false; - }); - $(document).on('click', '.btn-restoreall,.btn-restoreit,.btn-destroyit', function () { - Fast.api.ajax($(this).attr("href"), function () { - table.bootstrapTable('refresh'); - }); - return false; - }); - }, - add: function () { - $(document).on('change', '#c-channel_id', function () { - Fast.api.ajax({ - url: 'cms/archives/get_channel_fields', - data: {channel_id: $(this).val()} - }, function (data) { - $("#extend").html(data.html); - Form.api.bindevent($("#extend")); - return false; - }); - localStorage.setItem('last_channel_id', $(this).val()); - }); - var last_channel_id = localStorage.getItem('last_channel_id'); - if (last_channel_id) { - $("#c-channel_id option[value='" + last_channel_id + "']").prop("selected", true); - } - $("#c-channel_id").trigger("change"); - Controller.api.bindevent(); - }, - edit: function () { - Controller.api.bindevent(); - Fast.api.ajax({ - url: 'cms/archives/get_channel_fields', - data: {channel_id: $("#c-channel_id").val(), archives_id: $("#archive-id").val()} - }, function (data) { - $("#extend").html(data.html); - Form.api.bindevent($("#extend")); - return false; - }); - }, - api: { - formatter: { - content: function (value, row, index) { - var extend = this.extend; - if (!value) { - return ''; - } - var valueArr = value.toString().split(/,/); - var result = []; - $.each(valueArr, function (i, j) { - result.push(typeof extend[j] !== 'undefined' ? extend[j] : j); - }); - return result.join(','); - } - }, - bindevent: function () { - $.validator.config({ - rules: { - diyname: function (element) { - if (element.value.toString().match(/^\d+$/)) { - return __('Can not be digital'); - } - return $.ajax({ - url: 'cms/archives/check_element_available', - type: 'POST', - data: {id: $("#archive-id").val(), name: element.name, value: element.value}, - dataType: 'json' - }); - } - } - }); - Form.api.bindevent($("form[role=form]"), function () { - var obj = top.window.$("ul.nav-addtabs li.active"); - top.window.Toastr.success(__('Operation completed')); - top.window.$(".sidebar-menu a[url$='/cms/archives'][addtabs]").click(); - top.window.$(".sidebar-menu a[url$='/cms/archives'][addtabs]").dblclick(); - obj.find(".fa-remove").trigger("click"); - }); - } - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/cms/block.js b/public/assets/js/backend/cms/block.js deleted file mode 100644 index 168f2b83..00000000 --- a/public/assets/js/backend/cms/block.js +++ /dev/null @@ -1,57 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'cms/block/index', - add_url: 'cms/block/add', - edit_url: 'cms/block/edit', - del_url: 'cms/block/del', - multi_url: 'cms/block/multi', - table: 'block', - } - }); - - var table = $("#table"); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - pk: 'id', - sortName: 'id', - columns: [ - [ - {checkbox: true}, - {field: 'id', sortable: true, title: __('Id')}, - {field: 'type', title: __('Type'), formatter:Table.api.formatter.search}, - {field: 'name', title: __('Name')}, - {field: 'title', title: __('Title')}, - {field: 'image', title: __('Image'), formatter: Table.api.formatter.image}, - {field: 'url', title: __('Url'), formatter: Table.api.formatter.url}, - {field: 'createtime', title: __('Createtime'), sortable: true, operate: 'RANGE', addclass: 'datetimerange', formatter: Table.api.formatter.datetime}, - {field: 'updatetime', title: __('Updatetime'), sortable: true, operate: 'RANGE', addclass: 'datetimerange', formatter: Table.api.formatter.datetime}, - {field: 'status', title: __('Status'), formatter: Table.api.formatter.status}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} - ] - ] - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - add: function () { - Controller.api.bindevent(); - }, - edit: function () { - Controller.api.bindevent(); - }, - api: { - bindevent: function () { - Form.api.bindevent($("form[role=form]")); - } - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/cms/channel.js b/public/assets/js/backend/cms/channel.js deleted file mode 100644 index bee32065..00000000 --- a/public/assets/js/backend/cms/channel.js +++ /dev/null @@ -1,179 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'cms/channel/index', - add_url: 'cms/channel/add', - edit_url: 'cms/channel/edit', - del_url: 'cms/channel/del', - multi_url: 'cms/channel/multi', - dragsort_url: '', - table: 'channel', - } - }); - - var table = $("#table"); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - pk: 'id', - sortName: 'weigh', - pagination: false, - escape: false, - columns: [ - [ - {checkbox: true}, - {field: 'id', title: __('Id')}, - { - field: 'type', - title: __('Type'), - custom: {channel: 'info', list: 'success', link: 'primary'}, - formatter: Table.api.formatter.flag - }, - {field: 'model_name', title: __('Model_name'), operate: false}, - {field: 'name', title: __('Name'), align: 'left'}, - { - field: 'url', title: __('Url'), formatter: function (value, row, index) { - return ''; - } - }, - {field: 'items', sortable: true, title: __('Items')}, - { - field: 'weigh', - sortable: true, - title: __('Weigh'), - formatter: function (value, row, index) { - return ''; - } - }, - { - field: 'createtime', - title: __('Createtime'), - visible: false, - operate: 'RANGE', - addclass: 'datetimerange', - formatter: Table.api.formatter.datetime - }, - { - field: 'updatetime', - title: __('Updatetime'), - visible: false, - operate: 'RANGE', - addclass: 'datetimerange', - formatter: Table.api.formatter.datetime - }, - {field: 'iscontribute', title: __('Iscontribute'), searchList: {"1":__('Yes'),"0":__('No')}, formatter: Table.api.formatter.toggle}, - {field: 'status', title: __('Status'), formatter: Table.api.formatter.status}, - { - field: 'operate', - title: __('Operate'), - table: table, - events: Table.api.events.operate, - formatter: Table.api.formatter.operate - } - ] - ], - search: false, - commonSearch: false - }); - - // 绑定TAB事件 - $('.panel-heading a[data-toggle="tab"]').on('shown.bs.tab', function (e) { - var field = $(this).closest("ul").data("field"); - var value = $(this).data("value"); - var options = table.bootstrapTable('getOptions'); - options.pageNumber = 1; - options.queryParams = function (params) { - params.model_id = value; - return params; - }; - table.bootstrapTable('refresh', {}); - return false; - }); - - $(document).on("change", ".text-weigh", function () { - $(this).data("params", {weigh: $(this).val()}); - Table.api.multi('', [$(this).data("id")], table, this); - return false; - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - add: function () { - Controller.api.bindevent(); - $("input[name='row[type]']:first").trigger("click"); - $("select[name='row[model_id]']").trigger("change"); - }, - edit: function () { - Controller.api.bindevent(); - $("input[name='row[type]']:checked").trigger("fa.event.typeupdated", "edit"); - }, - api: { - bindevent: function () { - $.validator.config({ - rules: { - single: function (element) { - return !$("#c-name").val().match(/\n/); - }, - channelname: function (element) { - if (element.value.toString().match(/^\d+$/)) { - return __('Can not be digital'); - } - return $.ajax({ - url: 'cms/channel/check_element_available', - type: 'POST', - data: {id: $("#c-name").val(), name: element.name, value: element.value}, - dataType: 'json' - }); - }, - diyname: function (element) { - if (element.value.toString().match(/^\d+$/)) { - return __('Can not be digital'); - } - return $.ajax({ - url: 'cms/channel/check_element_available', - type: 'POST', - data: {id: $("#channel-id").val(), name: element.name, value: element.value}, - dataType: 'json' - }); - } - } - }); - //不可见的元素不验证 - $("form[role=form]").data("validator-options", {ignore: ':hidden'}); - $(document).on("click fa.event.typeupdated", "input[name='row[type]']", function (e, ref) { - $(".tf").addClass("hidden"); - $(".tf.tf-" + $(this).val()).removeClass("hidden"); - if (typeof ref == 'undefined') { - $("select[name='row[model_id]']").trigger("change"); - } - if ($(this).val() == 'link') { - $("#parent_id option[data-model]").prop("disabled", false); - } - }); - Form.api.bindevent($("form[role=form]")); - $(document).on("change", "select[name='row[model_id]']", function () { - var parentChannel = $("#parent_id"); - $("option[value=0]", parentChannel).prop("selected", true); - $("option[data-model]", parentChannel).prop("disabled", true); - $("option[data-model='" + $(this).val() + "']", parentChannel).prop("disabled", false); - var data = $("option:selected", this).data(); - var type = $("input[name='row[type]']:checked").val(); - if (type == 'channel') { - $("input[name='row[channeltpl]']").val(data.channeltpl); - } else if (type == 'list') { - $("input[name='row[listtpl]']").val(data.listtpl); - $("input[name='row[showtpl]']").val(data.showtpl); - } - }); - - } - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/cms/comment.js b/public/assets/js/backend/cms/comment.js deleted file mode 100644 index 53d92cfd..00000000 --- a/public/assets/js/backend/cms/comment.js +++ /dev/null @@ -1,62 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'cms/comment/index', - add_url: 'cms/comment/add', - edit_url: 'cms/comment/edit', - del_url: 'cms/comment/del', - multi_url: 'cms/comment/multi', - table: 'comment', - } - }); - - var table = $("#table"); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - pk: 'id', - sortName: 'id', - columns: [ - [ - {checkbox: true}, - {field: 'id', sortable: true, title: __('Id')}, - {field: 'type', title: __('Type'), visible: false, searchList: {"archives": __('archives'), "page": __('page')}}, - {field: 'type_text', title: __('Type'), operate: false}, - {field: 'aid', sortable: true, title: __('Aid'), formatter: Table.api.formatter.search}, - {field: 'pid', sortable: true, title: __('Pid'), formatter: Table.api.formatter.search, visible: false}, - {field: 'user_id', sortable: true, title: __('User_id'), formatter: Table.api.formatter.search}, - {field: 'archives.title', title: __('Title'), operate: false}, - {field: 'comments', sortable: true, title: __('Comments')}, - {field: 'ip', title: __('Ip'), formatter: Table.api.formatter.search}, - {field: 'useragent', title: __('Useragent'), visible: false}, - {field: 'subscribe', sortable: true, title: __('Subscribe'), visible: false}, - {field: 'createtime', sortable: true, title: __('Createtime'), operate: 'RANGE', addclass: 'datetimerange', formatter: Table.api.formatter.datetime}, - {field: 'updatetime', sortable: true, title: __('Updatetime'), operate: 'RANGE', addclass: 'datetimerange', formatter: Table.api.formatter.datetime}, - {field: 'status', title: __('Status'), searchList: {"normal": __('normal'), "hidden": __('hidden')}, formatter: Table.api.formatter.status}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} - ] - ] - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - add: function () { - Controller.api.bindevent(); - }, - edit: function () { - Controller.api.bindevent(); - }, - api: { - bindevent: function () { - Form.api.bindevent($("form[role=form]")); - } - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/cms/diydata.js b/public/assets/js/backend/cms/diydata.js deleted file mode 100644 index 726951b2..00000000 --- a/public/assets/js/backend/cms/diydata.js +++ /dev/null @@ -1,109 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function ($, undefined, Backend, Table, Form, Template) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'cms/diydata/index/diyform_id/' + Config.diyform_id, - add_url: 'cms/diydata/add/diyform_id/' + Config.diyform_id, - edit_url: 'cms/diydata/edit/diyform_id/' + Config.diyform_id, - del_url: 'cms/diydata/del/diyform_id/' + Config.diyform_id, - multi_url: '', - table: '', - } - }); - - var table = $("#table"); - //默认字段 - var columns = [ - {checkbox: true}, - {field: 'id', title: __('Id'), operate: false}, - { - field: 'user_id', - title: __('User_id'), - addclass: 'selectpage', - extend: 'data-source="user/user/index" data-field="nickname"', - operate: '=', - formatter: Table.api.formatter.search - } - ]; - //动态追加字段 - $.each(Config.fields, function (i, j) { - var data = {field: j.field, title: j.title, operate: 'like'}; - //如果是图片,加上formatter - if (j.type == 'image') { - data.formatter = Table.api.formatter.image; - } else if (j.type == 'images') { - data.formatter = Table.api.formatter.images; - } else if (j.type == 'radio' || j.type == 'check' || j.type == 'select' || j.type == 'selects') { - data.formatter = Controller.api.formatter.content; - data.extend = j.content; - } - columns.push(data); - }); - columns.push({field: 'createtime', sortable: true, title: __('Createtime'), operate: 'RANGE', addclass: 'datetimerange', formatter: Table.api.formatter.datetime}); - columns.push({field: 'updatetime', sortable: true, title: __('Updatetime'), operate: 'RANGE', addclass: 'datetimerange', formatter: Table.api.formatter.datetime}); - //追加操作字段 - columns.push({ - field: 'operate', - title: __('Operate'), - table: table, - events: Table.api.events.operate, - formatter: Table.api.formatter.operate - }); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - pk: 'id', - sortName: 'id', - columns: columns - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - add: function () { - Controller.api.bindevent(); - }, - edit: function () { - Controller.api.bindevent(); - }, - api: { - formatter: { - content: function (value, row, index) { - var extend = this.extend; - if (!value) { - return ''; - } - var valueArr = value.toString().split(/,/); - var result = []; - $.each(valueArr, function (i, j) { - result.push(typeof extend[j] !== 'undefined' ? extend[j] : j); - }); - return result.join(','); - } - }, - bindevent: function () { - $.validator.config({ - rules: { - diyname: function (element) { - if (element.value.toString().match(/^\d+$/)) { - return __('Can not be digital'); - } - return $.ajax({ - url: 'cms/archives/check_element_available', - type: 'POST', - data: {id: $("#archive-id").val(), name: element.name, value: element.value}, - dataType: 'json' - }); - } - } - }); - Form.api.bindevent($("form[role=form]")); - } - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/cms/diyform.js b/public/assets/js/backend/cms/diyform.js deleted file mode 100644 index 8d018b17..00000000 --- a/public/assets/js/backend/cms/diyform.js +++ /dev/null @@ -1,102 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'cms/diyform/index', - add_url: 'cms/diyform/add', - edit_url: 'cms/diyform/edit', - del_url: 'cms/diyform/del', - multi_url: 'cms/diyform/multi', - table: 'model', - } - }); - - var table = $("#table"); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - pk: 'id', - sortName: 'id', - columns: [ - [ - {checkbox: true}, - {field: 'id', title: __('Id')}, - {field: 'name', title: __('Name')}, - {field: 'title', title: __('Title')}, - {field: 'table', title: __('Table')}, - { - field: 'createtime', - sortable: true, - visible: false, - title: __('Createtime'), - operate: 'RANGE', - addclass: 'datetimerange', - formatter: Table.api.formatter.datetime - }, - { - field: 'updatetime', - sortable: true, - visible: false, - title: __('Updatetime'), - operate: 'RANGE', - addclass: 'datetimerange', - formatter: Table.api.formatter.datetime - }, - { - field: 'url', title: __('Url'), operate: false, formatter: function (value, row, index) { - return ''; - } - }, - { - field: 'datalist', title: __('Operate'), table: table, - buttons: [ - { - name: 'content', - text: __('数据列表'), - classname: 'btn btn-xs btn-success btn-addtabs', - icon: 'fa fa-file', - url: 'cms/diydata/index/diyform_id/{ids}' - }, - { - name: 'fields', - text: __('字段列表'), - classname: 'btn btn-xs btn-info btn-fields btn-addtabs', - icon: 'fa fa-list', - url: 'cms/fields/index/diyform_id/{ids}' - }, - ], - formatter: Table.api.formatter.buttons - }, - {field: 'status', title: __('Status'), formatter: Table.api.formatter.status}, - { - field: 'operate', - title: __('Operate'), - table: table, - events: Table.api.events.operate, - formatter: Table.api.formatter.operate - } - ] - ] - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - add: function () { - Controller.api.bindevent(); - }, - edit: function () { - Controller.api.bindevent(); - }, - api: { - bindevent: function () { - Form.api.bindevent($("form[role=form]")); - } - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/cms/fields.js b/public/assets/js/backend/cms/fields.js deleted file mode 100644 index 1c7bfd1e..00000000 --- a/public/assets/js/backend/cms/fields.js +++ /dev/null @@ -1,67 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { - - var Controller = { - index: function () { - var params = Config.model_id ? '/model_id/' + Config.model_id : '/diyform_id/' + Config.diyform_id; - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'cms/fields/index' + params, - add_url: 'cms/fields/add' + params, - edit_url: 'cms/fields/edit' + params, - del_url: 'cms/fields/del' + params, - multi_url: 'cms/fields/multi' + params, - table: 'cms_fields', - } - }); - - var table = $("#table"); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - pk: 'id', - sortName: 'weigh', - columns: [ - [ - {checkbox: true}, - {field: 'id', sortable: true, title: __('Id')}, - {field: 'model_id', visible: false, operate: false, title: __('Model_id')}, - {field: 'diyform_id', visible: false, operate: false, title: __('Diyform_id')}, - {field: 'name', title: __('Name')}, - {field: 'type', title: __('Type')}, - {field: 'title', title: __('Title')}, - {field: 'iscontribute', title: __('Iscontribute'), searchList: {"1": __('Yes'), "0": __('No')}, formatter: Table.api.formatter.toggle}, - {field: 'weigh', title: __('Weigh'), visible: false}, - {field: 'createtime', title: __('Createtime'), visible: false, operate: 'RANGE', addclass: 'datetimerange', formatter: Table.api.formatter.datetime}, - {field: 'updatetime', title: __('Updatetime'), visible: false, operate: 'RANGE', addclass: 'datetimerange', formatter: Table.api.formatter.datetime}, - {field: 'status', title: __('Status'), formatter: Table.api.formatter.status}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} - ] - ], - }); - // 为表格绑定事件 - Table.api.bindevent(table); - }, - add: function () { - Controller.api.bindevent(); - }, - edit: function () { - Controller.api.bindevent(); - }, - api: { - bindevent: function () { - //不可见的元素不验证 - $("form#add-form").data("validator-options", {ignore: ':hidden'}); - $(document).on("change", "#c-type", function () { - $(".tf").addClass("hidden"); - $(".tf.tf-" + $(this).val()).removeClass("hidden"); - - }); - Form.api.bindevent($("form[role=form]")); - $("#c-type").trigger("change"); - } - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/cms/modelx.js b/public/assets/js/backend/cms/modelx.js deleted file mode 100644 index 4489140e..00000000 --- a/public/assets/js/backend/cms/modelx.js +++ /dev/null @@ -1,105 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'cms/modelx/index', - add_url: 'cms/modelx/add', - edit_url: 'cms/modelx/edit', - del_url: 'cms/modelx/del', - multi_url: 'cms/modelx/multi', - table: 'model', - } - }); - - var table = $("#table"); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - pk: 'id', - sortName: 'id', - columns: [ - [ - {checkbox: true}, - {field: 'id', title: __('Id')}, - {field: 'name', title: __('Name')}, - {field: 'table', title: __('Table')}, - {field: 'channeltpl', title: __('Channeltpl')}, - {field: 'listtpl', title: __('Listtpl')}, - {field: 'showtpl', title: __('Showtpl')}, - { - field: 'createtime', - sortable: true, - visible: false, - title: __('Createtime'), - operate: 'RANGE', - addclass: 'datetimerange', - formatter: Table.api.formatter.datetime - }, - { - field: 'updatetime', - sortable: true, - visible: false, - title: __('Updatetime'), - operate: 'RANGE', - addclass: 'datetimerange', - formatter: Table.api.formatter.datetime - }, - { - field: 'datalist', title: __('Operate'), table: table, - buttons: [ - { - name: 'index', - text: __('Main list'), - classname: 'btn btn-xs btn-success btn-addtabs', - icon: 'fa fa-file', - url: 'cms/archives/index?model_id={ids}' - }, - { - name: 'content', - text: __('Addon list'), - classname: 'btn btn-xs btn-success btn-addtabs', - icon: 'fa fa-file', - url: 'cms/archives/content/model_id/{ids}' - }, - { - name: 'fields', - text: __('Fields'), - classname: 'btn btn-xs btn-info btn-fields btn-addtabs', - icon: 'fa fa-list', - url: 'cms/fields/index/model_id/{ids}' - }, - ], - formatter: Table.api.formatter.buttons - }, - { - field: 'operate', - title: __('Operate'), - table: table, - events: Table.api.events.operate, - formatter: Table.api.formatter.operate - } - ] - ] - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - add: function () { - Controller.api.bindevent(); - }, - edit: function () { - Controller.api.bindevent(); - }, - api: { - bindevent: function () { - Form.api.bindevent($("form[role=form]")); - } - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/cms/page.js b/public/assets/js/backend/cms/page.js deleted file mode 100644 index 455fe87e..00000000 --- a/public/assets/js/backend/cms/page.js +++ /dev/null @@ -1,61 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'cms/page/index', - add_url: 'cms/page/add', - edit_url: 'cms/page/edit', - del_url: 'cms/page/del', - multi_url: 'cms/page/multi', - table: 'page', - } - }); - - var table = $("#table"); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - pk: 'id', - sortName: 'weigh', - columns: [ - [ - {checkbox: true}, - {field: 'id', sortable: true, title: __('Id')}, - {field: 'title', title: __('Title')}, - {field: 'flag', title: __('Flag'), formatter: Table.api.formatter.flag}, - {field: 'image', title: __('Image'), formatter: Table.api.formatter.image}, - {field: 'views', sortable: true, title: __('Views'), operate: 'BETWEEN'}, - {field: 'comments', sortable: true, title: __('Comments'), operate: 'BETWEEN'}, - {field: 'url', title: __('Url'), formatter: function(value, row, index){ - return ''; - }}, - {field: 'createtime', sortable: true, title: __('Createtime'), operate: 'RANGE', addclass: 'datetimerange', formatter: Table.api.formatter.datetime}, - {field: 'updatetime', sortable: true, title: __('Updatetime'), operate: 'RANGE', addclass: 'datetimerange', formatter: Table.api.formatter.datetime}, - {field: 'weigh', sortable: true, title: __('Weigh')}, - {field: 'status', title: __('Status'), formatter: Table.api.formatter.status}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} - ] - ] - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - add: function () { - Controller.api.bindevent(); - }, - edit: function () { - Controller.api.bindevent(); - }, - api: { - bindevent: function () { - Form.api.bindevent($("form[role=form]")); - } - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/cms/tags.js b/public/assets/js/backend/cms/tags.js deleted file mode 100644 index db949cae..00000000 --- a/public/assets/js/backend/cms/tags.js +++ /dev/null @@ -1,54 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'cms/tags/index', - add_url: 'cms/tags/add', - edit_url: '', - del_url: 'cms/tags/del', - multi_url: 'cms/tags/multi', - table: 'tags', - } - }); - - var table = $("#table"); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - pk: 'id', - sortName: 'id', - columns: [ - [ - {checkbox: true}, - {field: 'id', sortable: true, title: __('Id')}, - {field: 'name', sortable: true, title: __('Name')}, - {field: 'nums', sortable: true, title: __('Nums')}, - {field: 'url', title: __('Url'), formatter: function(value, row, index){ - return ''; - }}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} - ] - ] - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - add: function () { - Controller.api.bindevent(); - }, - edit: function () { - Controller.api.bindevent(); - }, - api: { - bindevent: function () { - Form.api.bindevent($("form[role=form]")); - } - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/docs.js b/public/assets/js/backend/docs.js deleted file mode 100644 index 7e80f4fd..00000000 --- a/public/assets/js/backend/docs.js +++ /dev/null @@ -1,70 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'docs/index', - add_url: 'docs/add?rel=1', - edit_url: 'docs/edit?rel=1', - del_url: 'docs/del?rel=1', - multi_url: '', - table: 'docs', - } - }); - - var table = $("#table"); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - pk: 'relative', - sortName: 'order', - sortOrder: 'asc', - commonSearch: false, - columns: [ - [ - {checkbox: true}, - {field: 'name', title: __('Name')}, - {field: 'title', title: __('Title')}, - {field: 'type', title: __('Type')}, - {field: 'relative', title: __('Relative'), align: 'left', formatter: Controller.api.formatter.url}, - {field: 'order', title: __('Order')}, - {field: 'isnew', title: __('Isnew')}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate - } - ] - ] - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - add: function () { - Controller.api.bindevent(); - }, - edit: function () { - Controller.api.bindevent(); - }, - api: { - bindevent: function () { - $("textarea[name='row[source]']").on("change", function () { - require(['../addons/docs/js/parser'], function (Parser) { - var parser = new HyperDown; - html = parser.makeHtml($("textarea[name='row[source]']").val()); - $("#preview").html(html); - }); - }); - $("textarea[name='row[source]']").trigger("change"); - Form.api.bindevent($("form[role=form]")); - }, - formatter: { - url: function (value, row, index) { - return '
                                    '; - }, - } - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/example/baidumap.js b/public/assets/js/backend/example/baidumap.js deleted file mode 100644 index 150344f8..00000000 --- a/public/assets/js/backend/example/baidumap.js +++ /dev/null @@ -1,102 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { - var Controller = { - index: function () { - // - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'example/baidumap/index', - add_url: 'example/baidumap/add', - edit_url: 'example/baidumap/edit', - del_url: 'example/baidumap/del', - multi_url: 'example/baidumap/multi', - table: '', - } - }); - - var table = $("#table"); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - pk: 'id', - sortName: 'id', - columns: [ - [ - {checkbox: true}, - {field: 'id', title: 'ID', operate: false}, - {field: 'admin_id', title: __('Admin_id'), visible: false, operate: false}, - {field: 'username', title: __('Username'), formatter: Table.api.formatter.search}, - {field: 'title', title: __('Title')}, - {field: 'url', title: __('Url'), align: 'left'}, - {field: 'ip', title: __('IP')}, - {field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} - ] - ] - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - add: function () { - Controller.api.bindevent(); - }, - edit: function () { - Controller.api.bindevent(); - }, - map: function () { - Form.api.bindevent($("form[role=form]")); - require(['async!BMap'], function () { - // 更多文档可参考 http://lbsyun.baidu.com/jsdemo.htm - // 百度地图API功能 - var map = new BMap.Map("allmap"); - var point = new BMap.Point(116.404, 39.915); - - map.centerAndZoom(point, 13); //设置中心坐标点和级别 - var marker = new BMap.Marker(point); // 创建标注 - map.addOverlay(marker); // 将标注添加到地图中 - marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画 - - map.enableDragging(); //开启拖拽 - //map.enableInertialDragging(); //开启惯性拖拽 - map.enableScrollWheelZoom(true); //是否允许缩放 - //map.centerAndZoom("上海",15); //根据城市名设定地图中心点 - - var geolocation = new BMap.Geolocation(); - geolocation.getCurrentPosition(function (r) { - if (this.getStatus() == BMAP_STATUS_SUCCESS) { - var mk = new BMap.Marker(r.point); - map.addOverlay(mk); - map.panTo(r.point); - //Layer.alert('您的位置:' + r.point.lng + ',' + r.point.lat); - } else { - Layer.alert('failed' + this.getStatus()); - } - }, {enableHighAccuracy: true}); - - // 点搜索按钮时解析地址坐标 - $(document).on('click', '.btn-search', function () { - // 创建地址解析器实例 - var myGeo = new BMap.Geocoder(); - // 将地址解析结果显示在地图上,并调整地图视野 - myGeo.getPoint($("#searchaddress").val(), function (point) { - if (point) { - map.centerAndZoom(point, 16); - map.addOverlay(new BMap.Marker(point)); - } else { - Layer.alert("您选择地址没有解析到结果!"); - } - }); - }); - - }); - }, - api: { - bindevent: function () { - Form.api.bindevent($("form[role=form]")); - } - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/example/bootstraptable.js b/public/assets/js/backend/example/bootstraptable.js deleted file mode 100644 index 02e1cc30..00000000 --- a/public/assets/js/backend/example/bootstraptable.js +++ /dev/null @@ -1,278 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function ($, undefined, Backend, Table, Form, Template) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'example/bootstraptable/index', - add_url: '', - edit_url: '', - del_url: 'example/bootstraptable/del', - multi_url: '', - } - }); - - var table = $("#table"); - - //在普通搜索提交搜索前 - table.on('common-search.bs.table', function (event, table, query) { - //这里可以获取到普通搜索表单中字段的查询条件 - console.log(query); - }); - - //在普通搜索渲染后 - table.on('post-common-search.bs.table', function (event, table) { - var form = $("form", table.$commonsearch); - $("input[name='title']", form).addClass("selectpage").data("source", "auth/adminlog/selectpage").data("primaryKey", "title").data("field", "title").data("orderBy", "id desc"); - $("input[name='username']", form).addClass("selectpage").data("source", "auth/admin/index").data("primaryKey", "username").data("field", "username").data("orderBy", "id desc"); - Form.events.cxselect(form); - Form.events.selectpage(form); - }); - - //在表格内容渲染完成后回调的事件 - table.on('post-body.bs.table', function (e, settings, json, xhr) { - console.log(e, settings, json, xhr); - }); - - //当表格数据加载完成时 - table.on('load-success.bs.table', function (e, data) { - //这里可以获取从服务端获取的JSON数据 - console.log(data); - //这里我们手动设置底部的值 - $("#money").text(data.extend.money); - $("#price").text(data.extend.price); - }); - - // 初始化表格 - // 这里使用的是Bootstrap-table插件渲染表格 - // 相关文档:http://bootstrap-table.wenzhixin.net.cn/zh-cn/documentation/ - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - columns: [ - [ - //更多配置参数可参考http://bootstrap-table.wenzhixin.net.cn/zh-cn/documentation/#c - //该列为复选框字段,如果后台的返回state值将会默认选中 - {field: 'state', checkbox: true,}, - //sortable为是否排序,operate为搜索时的操作符,visible表示是否可见 - {field: 'id', title: 'ID', sortable: true, operate: false}, - //默认隐藏该列 - {field: 'admin_id', title: __('管理员'), operate: false}, - //直接响应搜索 - {field: 'username', title: __('管理员'), formatter: Table.api.formatter.search}, - //模糊搜索 - {field: 'title', title: __('Title'), operate: 'LIKE %...%', placeholder: '模糊搜索,*表示任意字符'}, - //通过Ajax渲染searchList,也可以使用JSON数据 - { - field: 'url', - title: __('Url'), - align: 'left', - searchList: $.getJSON('example/bootstraptable/searchlist?search=a&field=row[user_id]'), - formatter: Controller.api.formatter.url - }, - //点击IP时同时执行搜索此IP - { - field: 'ip', - title: __('IP'), - events: Controller.api.events.ip, - formatter: Controller.api.formatter.ip - }, - //自定义栏位,custom是不存在的字段 - {field: 'custom', title: __('切换'), operate: false, formatter: Controller.api.formatter.custom}, - //browser是一个不存在的字段 - //通过formatter来渲染数据,同时为它添加上事件 - { - field: 'browser', - title: __('Browser'), - operate: false, - events: Controller.api.events.browser, - formatter: Controller.api.formatter.browser - }, - { - field: 'admin_id', title: __('联动搜索'), searchList: function (column) { - return Template('categorytpl', {}); - } - }, - //启用时间段搜索 - { - field: 'createtime', - title: __('Update time'), - sortable: true, - formatter: Table.api.formatter.datetime, - operate: 'RANGE', - addclass: 'datetimerange' - }, - //操作栏,默认有编辑、删除或排序按钮,可自定义配置buttons来扩展按钮 - { - field: 'operate', - width: "120px", - title: __('Operate'), - table: table, - events: Table.api.events.operate, - buttons: [ - { - name: 'detail', - title: __('弹出窗口打开'), - classname: 'btn btn-xs btn-primary btn-dialog', - icon: 'fa fa-list', - url: 'example/bootstraptable/detail', - callback: function (data) { - Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"}); - } - }, - { - name: 'ajax', - title: __('发送Ajax'), - classname: 'btn btn-xs btn-success btn-magic btn-ajax', - icon: 'fa fa-magic', - url: 'example/bootstraptable/detail', - success: function (data, ret) { - Layer.alert(ret.msg + ",返回数据:" + JSON.stringify(data)); - //如果需要阻止成功提示,则必须使用return false; - //return false; - }, - error: function (data, ret) { - console.log(data, ret); - Layer.alert(ret.msg); - return false; - } - }, - { - name: 'addtabs', - title: __('新选项卡中打开'), - classname: 'btn btn-xs btn-warning btn-addtabs', - icon: 'fa fa-folder-o', - url: 'example/bootstraptable/detail' - } - ], - formatter: Table.api.formatter.operate - }, - ], - ], - //更多配置参数可参考http://bootstrap-table.wenzhixin.net.cn/zh-cn/documentation/#t - //亦可以参考require-table.js中defaults的配置 - //禁用默认搜索 - search: false, - //启用普通表单搜索 - commonSearch: true, - //可以控制是否默认显示搜索单表,false则隐藏,默认为false - searchFormVisible: true, - queryParams: function (params) { - //这里可以追加搜索条件 - var filter = JSON.parse(params.filter); - var op = JSON.parse(params.op); - //这里可以动态赋值,比如从URL中获取admin_id的值,filter.admin_id=Fast.api.query('admin_id'); - filter.admin_id = 1; - op.admin_id = "="; - params.filter = JSON.stringify(filter); - params.op = JSON.stringify(op); - return params; - }, - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - - // 监听下拉列表改变的事件 - $(document).on('change', 'select[name=admin]', function () { - $("input[name='admin_id']").val($(this).val()); - }); - - // 指定搜索条件 - $(document).on("click", ".btn-singlesearch", function () { - var options = table.bootstrapTable('getOptions'); - var queryParams = options.queryParams; - options.pageNumber = 1; - options.queryParams = function (params) { - //这一行必须要存在,否则在点击下一页时会丢失搜索栏数据 - params = queryParams(params); - - //如果希望追加搜索条件,可使用 - var filter = params.filter ? JSON.parse(params.filter) : {}; - var op = params.op ? JSON.parse(params.op) : {}; - filter.url = 'login'; - op.url = 'like'; - params.filter = JSON.stringify(filter); - params.op = JSON.stringify(op); - - //如果希望忽略搜索栏搜索条件,可使用 - //params.filter = JSON.stringify({url: 'login'}); - //params.op = JSON.stringify({url: 'like'}); - return params; - }; - table.bootstrapTable('refresh', {}); - Toastr.info("当前执行的是自定义搜索,搜索URL中包含login的数据"); - return false; - }); - - // 获取选中项 - $(document).on("click", ".btn-selected", function () { - Layer.alert(JSON.stringify(table.bootstrapTable('getSelections'))); - }); - - // 启动和暂停按钮 - $(document).on("click", ".btn-start,.btn-pause", function () { - //在table外不可以使用添加.btn-change的方法 - //只能自己调用Table.api.multi实现 - //如果操作全部则ids可以置为空 - var ids = Table.api.selectedids(table); - Table.api.multi("changestatus", ids.join(","), table, this); - }); - - }, - add: function () { - Controller.api.bindevent(); - }, - edit: function () { - Controller.api.bindevent(); - }, - detail: function () { - $(document).on('click', '.btn-callback', function () { - Fast.api.close($("input[name=callback]").val()); - }); - }, - api: { - bindevent: function () { - Form.api.bindevent($("form[role=form]")); - }, - formatter: {//渲染的方法 - url: function (value, row, index) { - return '
                                    '; - }, - ip: function (value, row, index) { - return ' ' + value + ''; - }, - browser: function (value, row, index) { - //这里我们直接使用row的数据 - return '' + row.useragent.split(" ")[0] + ''; - }, - custom: function (value, row, index) { - //添加上btn-change可以自定义请求的URL进行数据处理 - return ''; - }, - }, - events: {//绑定事件的方法 - ip: { - //格式为:方法名+空格+DOM元素 - 'click .btn-ip': function (e, value, row, index) { - e.stopPropagation(); - console.log(); - var container = $("#table").data("bootstrap.table").$container; - var options = $("#table").bootstrapTable('getOptions'); - //这里我们手动将数据填充到表单然后提交 - $("form.form-commonsearch [name='ip']", container).val(value); - $("form.form-commonsearch", container).trigger('submit'); - Toastr.info("执行了自定义搜索操作"); - } - }, - browser: { - 'click .btn-browser': function (e, value, row, index) { - e.stopPropagation(); - Layer.alert("该行数据为: " + JSON.stringify(row) + ""); - } - }, - } - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/example/colorbadge.js b/public/assets/js/backend/example/colorbadge.js deleted file mode 100644 index e4dbeede..00000000 --- a/public/assets/js/backend/example/colorbadge.js +++ /dev/null @@ -1,52 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'example/colorbadge/index', - add_url: '', - edit_url: '', - del_url: 'example/colorbadge/del', - multi_url: '', - } - }); - - var table = $("#table"); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - columns: [ - [ - {field: 'state', checkbox: true, }, - {field: 'id', title: 'ID'}, - {field: 'title', title: __('Title')}, - {field: 'ip', title: __('IP')}, - {field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} - ] - ], - onLoadSuccess: function (data) { - // 在表格第次加载成功后,刷新左侧菜单栏彩色小角标,支持一次渲染多个 - // 如果需要在进入后台即显示左侧的彩色小角标,请使用服务端渲染方式,详情修改application/admin/controller/Index.php - Backend.api.sidebar({ - 'example/colorbadge': data.total - }); - Toastr.info("左侧角标已经刷新成功"); - } - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - add: function () { - Form.api.bindevent($("form[role=form]")); - }, - edit: function () { - Form.api.bindevent($("form[role=form]")); - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/example/controllerjump.js b/public/assets/js/backend/example/controllerjump.js deleted file mode 100644 index 60f625b6..00000000 --- a/public/assets/js/backend/example/controllerjump.js +++ /dev/null @@ -1,59 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'example/controllerjump/index', - add_url: '', - edit_url: '', - del_url: 'example/controllerjump/del', - multi_url: '', - } - }); - - var table = $("#table"); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - columns: [ - [ - {field: 'state', checkbox: true, }, - {field: 'id', title: 'ID'}, - {field: 'admin_id', title: __('Admin_id')}, - {field: 'title', title: __('Title')}, - {field: 'ip', title: __('IP'), formatter: Controller.api.formatter.ip}, - {field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} - ] - ] - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - add: function () { - Form.api.bindevent($("form[role=form]")); - }, - edit: function () { - Form.api.bindevent($("form[role=form]")); - }, - api: { - formatter: { - ip: function (value, row, index) { - //这里手动构造URL - url = "example/bootstraptable?" + this.field + "=" + value; - - //方式一,直接返回class带有addtabsit的链接,这可以方便自定义显示内容 - return '' + __('Search %s', value) + ''; - - //方式二,直接调用Table.api.formatter.addtabs - return Table.api.formatter.addtabs(value, row, index, url); - } - } - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/example/customsearch.js b/public/assets/js/backend/example/customsearch.js deleted file mode 100644 index eebc3057..00000000 --- a/public/assets/js/backend/example/customsearch.js +++ /dev/null @@ -1,63 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { - var Controller = { - index: function () { - // - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'example/customsearch/index', - add_url: 'example/customsearch/add', - edit_url: 'example/customsearch/edit', - del_url: 'example/customsearch/del', - multi_url: 'example/customsearch/multi', - table: '', - } - }); - - var table = $("#table"); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - pk: 'id', - sortName: 'id', - searchFormVisible: true, - searchFormTemplate: 'customformtpl', - columns: [ - [ - {checkbox: true}, - {field: 'id', title: 'ID', operate: false}, - {field: 'admin_id', title: __('Admin_id'), visible: false, operate: false}, - {field: 'username', title: __('Username'), formatter: Table.api.formatter.search}, - {field: 'title', title: __('Title')}, - {field: 'url', title: __('Url'), align: 'left'}, - {field: 'ip', title: __('IP')}, - {field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true}, - { - field: 'operate', - title: __('Operate'), - table: table, - events: Table.api.events.operate, - formatter: Table.api.formatter.operate - } - ] - ] - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - add: function () { - Controller.api.bindevent(); - }, - edit: function () { - Controller.api.bindevent(); - }, - api: { - bindevent: function () { - Form.api.bindevent($("form[role=form]")); - } - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/example/cxselect.js b/public/assets/js/backend/example/cxselect.js deleted file mode 100644 index 355b77a0..00000000 --- a/public/assets/js/backend/example/cxselect.js +++ /dev/null @@ -1,14 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { - - var Controller = { - index: function () { - $("#cxselect-example .col-xs-12").each(function () { - $("textarea", this).val($(this).prev().prev().html().replace(/[ ]{2}/g, '')); - }); - - //这里需要手动为Form绑定上元素事件 - Form.api.bindevent($("form#cxselectform")); - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/example/multitable.js b/public/assets/js/backend/example/multitable.js deleted file mode 100644 index 5777380b..00000000 --- a/public/assets/js/backend/example/multitable.js +++ /dev/null @@ -1,93 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init(); - - //绑定事件 - $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { - var panel = $($(this).attr("href")); - if (panel.size() > 0) { - Controller.table[panel.attr("id")].call(this); - $(this).on('click', function (e) { - $($(this).attr("href")).find(".btn-refresh").trigger("click"); - }); - } - //移除绑定的事件 - $(this).unbind('shown.bs.tab'); - }); - - //必须默认触发shown.bs.tab事件 - $('ul.nav-tabs li.active a[data-toggle="tab"]').trigger("shown.bs.tab"); - }, - table: { - first: function () { - // 表格1 - var table1 = $("#table1"); - table1.bootstrapTable({ - url: 'example/multitable/table1', - toolbar: '#toolbar1', - sortName: 'id', - search: false, - columns: [ - [ - {field: 'state', checkbox: true, }, - {field: 'id', title: 'ID'}, - {field: 'url', title: __('Url'), formatter: Table.api.formatter.url}, - {field: 'imagewidth', title: __('Imagewidth')}, - {field: 'imageheight', title: __('Imageheight')}, - {field: 'mimetype', title: __('Mimetype')}, - {field: 'operate', title: __('Operate'), table: table1, events: Table.api.events.operate, formatter: Table.api.formatter.operate} - ] - ] - }); - - // 为表格1绑定事件 - Table.api.bindevent(table1); - }, - second: function () { - // 表格2 - var table2 = $("#table2"); - table2.bootstrapTable({ - url: 'example/multitable/table2', - extend: { - index_url: '', - add_url: '', - edit_url: '', - del_url: '', - multi_url: '', - table: '', - }, - toolbar: '#toolbar2', - sortName: 'id', - search: false, - columns: [ - [ - {field: 'id', title: 'ID'}, - {field: 'title', title: __('Title')}, - {field: 'url', title: __('Url'), align: 'left', formatter: Table.api.formatter.url}, - {field: 'ip', title: __('ip')}, - {field: 'createtime', title: __('Createtime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true}, - ] - ] - }); - - // 为表格2绑定事件 - Table.api.bindevent(table2); - } - }, - add: function () { - Controller.api.bindevent(); - }, - edit: function () { - Controller.api.bindevent(); - }, - api: { - bindevent: function () { - Form.api.bindevent($("form[role=form]")); - }, - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/example/relationmodel.js b/public/assets/js/backend/example/relationmodel.js deleted file mode 100644 index 0e61a773..00000000 --- a/public/assets/js/backend/example/relationmodel.js +++ /dev/null @@ -1,47 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'example/relationmodel/index', - add_url: '', - edit_url: '', - del_url: 'example/relationmodel/del', - multi_url: '', - } - }); - - var table = $("#table"); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - columns: [ - [ - {field: 'state', checkbox: true, }, - {field: 'id', title: 'ID', operate: '='}, - {field: 'title', title: __('Title'), operate: 'LIKE %...%', placeholder: '关键字,模糊搜索'}, - {field: 'admin.avatar', title: __('Avatar'), operate: false, formatter: Table.api.formatter.image}, - {field: 'admin.username', title: __('Username'), operate: '='}, - {field: 'admin.nickname', title: __('Nickname'), operate: 'LIKE %...%', placeholder: '关键字,模糊搜索'}, - {field: 'ip', title: __('IP'), operate: '='}, - {field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} - ] - ], - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - add: function () { - Form.api.bindevent($("form[role=form]")); - }, - edit: function () { - Form.api.bindevent($("form[role=form]")); - }, - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/example/tabletemplate.js b/public/assets/js/backend/example/tabletemplate.js deleted file mode 100644 index b1811813..00000000 --- a/public/assets/js/backend/example/tabletemplate.js +++ /dev/null @@ -1,115 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function ($, undefined, Backend, Table, Form, Template) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'example/tabletemplate/index', - add_url: '', - edit_url: '', - del_url: 'example/tabletemplate/del', - multi_url: '', - } - }); - - var table = $("#table"); - - Template.helper("Moment", Moment); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - templateView: true, - columns: [ - [ - {field: 'state', checkbox: true, }, - {field: 'id', title: 'ID', operate: false}, - //直接响应搜索 - {field: 'username', title: __('Username'), formatter: Table.api.formatter.search}, - //模糊搜索 - {field: 'title', title: __('Title'), operate: 'LIKE %...%', placeholder: '模糊搜索,*表示任意字符', style: 'width:200px'}, - //通过Ajax渲染searchList - {field: 'url', title: __('Url'), align: 'left', formatter: Controller.api.formatter.url}, - //点击IP时同时执行搜索此IP,同时普通搜索使用下拉列表的形式 - {field: 'ip', title: __('IP'), searchList: ['127.0.0.1', '127.0.0.2'], events: Controller.api.events.ip, formatter: Controller.api.formatter.ip}, - //browser是一个不存在的字段 - //通过formatter来渲染数据,同时为它添加上事件 - {field: 'browser', title: __('Browser'), operate: false, events: Controller.api.events.browser, formatter: Controller.api.formatter.browser}, - //启用时间段搜索 - {field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} - ], - ], - //禁用默认搜索 - search: false, - //启用普通表单搜索 - commonSearch: false, - //可以控制是否默认显示搜索单表,false则隐藏,默认为false - searchFormVisible: false, - //分页大小 - pageSize: 12 - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - - //指定搜索条件 - $(document).on("click", ".btn-toggle-view", function () { - var options = table.bootstrapTable('getOptions'); - table.bootstrapTable('refreshOptions', {templateView: !options.templateView}); - }); - - //点击详情 - $(document).on("click", ".btn-detail[data-id]", function () { - Backend.api.open('example/bootstraptable/detail/ids/' + $(this).data('id'), __('Detail')); - }); - - //获取选中项 - $(document).on("click", ".btn-selected", function () { - //在templateView的模式下不能调用table.bootstrapTable('getSelections')来获取选中的ID,只能通过下面的Table.api.selectedids来获取 - Layer.alert(JSON.stringify(Table.api.selectedids(table))); - }); - }, - add: function () { - Controller.api.bindevent(); - }, - edit: function () { - Controller.api.bindevent(); - }, - api: { - bindevent: function () { - Form.api.bindevent($("form[role=form]")); - }, - formatter: { - url: function (value, row, index) { - return '
                                    '; - }, - ip: function (value, row, index) { - return ' ' + value + ''; - }, - browser: function (value, row, index) { - //这里我们直接使用row的数据 - return '' + row.useragent.split(" ")[0] + ''; - } - }, - events: { - ip: { - 'click .btn-ip': function (e, value, row, index) { - var options = $("#table").bootstrapTable('getOptions'); - //这里我们手动将数据填充到表单然后提交 - $("#commonSearchContent_" + options.idTable + " form [name='ip']").val(value); - $("#commonSearchContent_" + options.idTable + " form").trigger('submit'); - Toastr.info("执行了自定义搜索操作"); - } - }, - browser: { - 'click .btn-browser': function (e, value, row, index) { - Layer.alert("该行数据为: " + JSON.stringify(row) + ""); - } - } - } - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/general/database.js b/public/assets/js/backend/general/database.js deleted file mode 100644 index 0b71cd81..00000000 --- a/public/assets/js/backend/general/database.js +++ /dev/null @@ -1,115 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'template'], function ($, undefined, Backend, Template) { - - var Controller = { - index: function () { - - //如果有备份权限 - if ($("#backuplist").size() > 0) { - Fast.api.ajax({ - url: "general/database/backuplist", - type: 'get' - }, function (data) { - $("#backuplist").html(Template("backuptpl", {backuplist: data.backuplist})); - return false; - }); - return false; - } - - //禁止在操作select元素时关闭dropdown的关闭事件 - $("#database").on('click', '.dropdown-menu input, .dropdown-menu label, .dropdown-menu select', function (e) { - e.stopPropagation(); - }); - - //提交时检查是否有删除或清空操作 - $("#database").on("submit", "#sqlexecute", function () { - var v = $("#sqlquery").val().toLowerCase(); - if ((v.indexOf("delete ") >= 0 || v.indexOf("truncate ") >= 0) && !confirm(__('Are you sure you want to delete or turncate?'))) { - return false; - } - }); - - //事件按钮操作 - $("#database").on("click", "ul#subaction li input", function () { - $("#topaction").val($(this).attr("rel")); - return true; - }); - - //窗口变更的时候重设结果栏高度 - $(window).on("resize", function () { - $("#database .well").height($(window).height() - $("#database #sqlexecute").height() - $("#ribbon").outerHeight() - $(".panel-heading").outerHeight() - 130); - }); - - //修复iOS下iframe无法滚动的BUG - if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) { - $("#resultparent").css({"-webkit-overflow-scrolling": "touch", "overflow": "auto"}); - } - - $(document).on("click", ".btn-compress", function () { - Fast.api.ajax({ - url: "general/database/backuplist", - type: 'get' - }, function (data) { - Layer.open({ - area: ["680px", "500px"], - btn: [], - title: "备份与还原", - content: Template("backuptpl", {backuplist: data.backuplist}) - }); - return false; - }); - return false; - }); - - $(document).on("click", ".btn-backup", function () { - Fast.api.ajax({ - url: "general/database/backup", - data: {action: 'backup'} - }, function (data) { - Layer.closeAll(); - $(".btn-compress").trigger("click"); - }); - }); - - $(document).on("click", ".btn-restore", function () { - var that = this; - Layer.confirm("确定恢复备份?
                                    建议先备份当前数据后再进行恢复操作!!!
                                    当前数据库将被清空覆盖,请谨慎操作!!!", { - type: 5, - skin: 'layui-layer-dialog layui-layer-fast' - }, function (index) { - Fast.api.ajax({ - url: "general/database/restore", - data: {action: 'restore', file: $(that).data('file')} - }, function (data) { - Layer.closeAll(); - Fast.api.ajax({ - url: 'ajax/wipecache', - data: {type: 'all'}, - }, function () { - Layer.alert("备份恢复成功,点击确定将刷新页面", function () { - top.location.reload(); - }); - return false; - }); - - }); - }); - }); - - $(document).on("click", ".btn-delete", function () { - var that = this; - Layer.confirm("确定删除备份?", {type: 5, skin: 'layui-layer-dialog layui-layer-fast'}, function (index) { - Fast.api.ajax({ - url: "general/database/restore", - data: {action: 'delete', file: $(that).data('file')} - }, function (data) { - Layer.closeAll(); - $(".btn-compress").trigger("click"); - }); - }); - }); - - $(window).resize(); - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/test.js b/public/assets/js/backend/test.js deleted file mode 100644 index 5051895e..00000000 --- a/public/assets/js/backend/test.js +++ /dev/null @@ -1,98 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'test/index', - add_url: 'test/add', - edit_url: 'test/edit', - del_url: 'test/del', - //import_url: 'test/import', - multi_url: 'test/multi', - table: 'test', - } - }); - - var table = $("#table"); - var date = new Date(); - - //在表格内容渲染完成后回调的事件 - table.on('post-body.bs.table', function (e, settings, json, xhr) { - $(".btn-add").data("area", ["1000px", "95%"]).data("title", '添加测试'); - $(".btn-editone").data("area", ["1000px", "95%"]).data("title", '编辑测试'); - $(".btn-edit").data("area", ["1000px", "95%"]).data("title", '编辑测试'); - }); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - pk: 'id', - sortName: 'weigh', - exportTypes: ['csv', 'excel'], - exportOptions: { - fileName: 'test_' + [date.getFullYear(), date.getMonth() + 1, date.getDate()].join('-'), - ignoreColumn: [0, 'operate'], //默认不导出第一列(checkbox)与操作(operate)列 - }, - columns: [ - [ - {checkbox: true}, - {field: 'id', title: __('Id')}, - {field: 'admin_id', title: __('Admin_id')}, - {field: 'category_id', title: __('Category_id')}, - {field: 'category_ids', title: __('Category_ids')}, - {field: 'week', title: __('Week'), searchList: {"monday":__('Week monday'),"tuesday":__('Week tuesday'),"wednesday":__('Week wednesday')}, formatter: Table.api.formatter.normal}, - {field: 'flag', title: __('Flag'), searchList: {"hot":__('Flag hot'),"index":__('Flag index'),"recommend":__('Flag recommend')}, operate:'FIND_IN_SET', formatter: Table.api.formatter.label}, - {field: 'genderdata', title: __('Genderdata'), searchList: {"male":__('Genderdata male'),"female":__('Genderdata female')}, formatter: Table.api.formatter.normal}, - {field: 'hobbydata', title: __('Hobbydata'), searchList: {"music":__('Hobbydata music'),"reading":__('Hobbydata reading'),"swimming":__('Hobbydata swimming')}, operate:'FIND_IN_SET', formatter: Table.api.formatter.label}, - {field: 'title', title: __('Title')}, - {field: 'image', title: __('Image'), formatter: Table.api.formatter.image}, - {field: 'images', title: __('Images'), formatter: Table.api.formatter.images}, - {field: 'attachfile', title: __('Attachfile')}, - {field: 'keywords', title: __('Keywords')}, - {field: 'description', title: __('Description')}, - {field: 'city', title: __('City')}, - {field: 'price', title: __('Price'), operate:'BETWEEN'}, - {field: 'views', title: __('Views')}, - {field: 'startdate', title: __('Startdate'), operate:'RANGE', addclass:'datetimerange'}, - {field: 'activitytime', title: __('Activitytime'), operate:'RANGE', addclass:'datetimerange'}, - {field: 'year', title: __('Year')}, - {field: 'times', title: __('Times')}, - {field: 'refreshtime', title: __('Refreshtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, - {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, - {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, - {field: 'weigh', title: __('Weigh')}, - {field: 'switch', title: __('Switch'), searchList: {"1":__('Yes'),"0":__('No')}, formatter: Table.api.formatter.toggle}, - {field: 'status', title: __('Status'), searchList: {"normal":__('Normal'),"hidden":__('Hidden')}, formatter: Table.api.formatter.status}, - {field: 'state', title: __('State'), searchList: {"0":__('State 0'),"1":__('State 1'),"2":__('State 2')}, formatter: Table.api.formatter.normal}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} - ] - ], - //禁用默认搜索 - search: false, - //启用普通表单搜索 - commonSearch: true, - //可以控制是否默认显示搜索单表,false则隐藏,默认为false - searchFormVisible: false, - showColumns: false, - showToggle: false, - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - add: function () { - Controller.api.bindevent(); - }, - edit: function () { - Controller.api.bindevent(); - }, - api: { - bindevent: function () { - Form.api.bindevent($("form[role=form]")); - } - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/wechat/autoreply.js b/public/assets/js/backend/wechat/autoreply.js deleted file mode 100644 index e84b03c9..00000000 --- a/public/assets/js/backend/wechat/autoreply.js +++ /dev/null @@ -1,77 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefined, Backend, Form, Table) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'wechat/autoreply/index', - add_url: 'wechat/autoreply/add', - edit_url: 'wechat/autoreply/edit', - del_url: 'wechat/autoreply/del', - multi_url: 'wechat/autoreply/multi', - } - }); - - var table = $("#table"); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - sortName: 'id', - columns: [ - [ - {field: 'state', checkbox: true, }, - {field: 'id', title: __('Id')}, - {field: 'title', title: __('Title')}, - {field: 'text', title: __('Text')}, - {field: 'eventkey', title: __('Event key')}, - {field: 'remark', title: __('Remark')}, - {field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true}, - {field: 'updatetime', title: __('Update time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true}, - {field: 'status', title: __('Status'), formatter: Table.api.formatter.status}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} - ] - ] - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - - }, - add: function () { - Controller.api.bindevent(); - }, - edit: function () { - Controller.api.bindevent(); - }, - api: { - bindevent: function () { - Form.api.bindevent($("form[role=form]")); - - var refreshkey = function (data) { - $("input[name='row[eventkey]']").val(data.eventkey).trigger("change"); - Layer.closeAll(); - var keytitle = data.title; - var cont = $(".clickbox .create-click:first"); - $(".keytitle", cont).remove(); - if (keytitle) { - cont.append('
                                    ' + __('Event key') + ':' + keytitle + '
                                    '); - } - }; - $(document).on('click', "#select-resources", function () { - var key = $("input[name='row[eventkey]']").val(); - parent.Backend.api.open($(this).attr("href") + "?key=" + key, __('Select'), {callback: refreshkey}); - return false; - }); - - $(document).on('click', "#add-resources", function () { - parent.Backend.api.open($(this).attr("href") + "?key=", __('Add'), {callback: refreshkey}); - return false; - }); - } - } - - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/wechat/config.js b/public/assets/js/backend/wechat/config.js deleted file mode 100644 index 7b8c2f2a..00000000 --- a/public/assets/js/backend/wechat/config.js +++ /dev/null @@ -1,97 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'wechat/config/index', - add_url: 'wechat/config/add', - edit_url: 'wechat/config/edit', - del_url: 'wechat/config/del', - multi_url: 'wechat/config/multi', - table: 'wechat_config', - } - }); - - var table = $("#table"); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - pk: 'id', - sortName: 'id', - columns: [ - [ - {field: 'state', checkbox: true}, - {field: 'id', title: __('Id')}, - {field: 'name', title: __('Name')}, - {field: 'title', title: __('Title')}, - {field: 'createtime', title: __('Createtime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true}, - {field: 'updatetime', title: __('Updatetime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} - ] - ] - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - add: function () { - Controller.api.bindevent(); - }, - edit: function () { - Controller.api.bindevent(); - }, - api: { - bindevent: function () { - Form.api.bindevent($("form[role=form]")); - $(document).on('click', ".btn-jsoneditor", function () { - $("#c-value").toggle(); - $(".fieldlist").toggleClass("hide"); - $(".btn-insertlink").toggle(); - $("input[name='row[mode]']").val($("#c-value").is(":visible") ? "textarea" : "json"); - }); - $(document).on('click', ".btn-insertlink", function () { - var textarea = $("textarea[name='row[value]']"); - var cursorPos = textarea.prop('selectionStart'); - var v = textarea.val(); - var textBefore = v.substring(0, cursorPos); - var textAfter = v.substring(cursorPos, v.length); - - Layer.prompt({title: '请输入显示的文字', formType: 3}, function (text, index) { - Layer.close(index); - Layer.prompt({title: '请输入跳转的链接URL(包含http)', formType: 3}, function (link, index) { - text = text == '' ? link : text; - textarea.val(textBefore + '' + text + '' + textAfter); - Layer.close(index); - }); - }); - }); - $("input[name='row[type]']:checked").trigger("click"); - - $(document).on("click", ".fieldlist .append", function () { - var rel = parseInt($(this).closest("dl").attr("rel")) + 1; - $(this).closest("dl").attr("rel", rel); - $('
                                    ').insertBefore($(this).parent()); - }); - $(document).on("click", ".fieldlist dd .btn-remove", function () { - $(this).parent().remove(); - }); - //拖拽排序 - require(['dragsort'], function () { - //绑定拖动排序 - $("dl.fieldlist").dragsort({ - itemSelector: 'dd', - dragSelector: ".btn-dragsort", - dragEnd: function () { - - }, - placeHolderTemplate: "
                                    " - }); - }); - } - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/wechat/menu.js b/public/assets/js/backend/wechat/menu.js deleted file mode 100644 index 2ae18de0..00000000 --- a/public/assets/js/backend/wechat/menu.js +++ /dev/null @@ -1,293 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'sortable'], function ($, undefined, Backend, Table, Form, Sortable) { - var Controller = { - index: function () { - String.prototype.subByte = function (start, bytes) { - for (var i = start; bytes > 0; i++) { - var code = this.charCodeAt(i); - bytes -= code < 256 ? 1 : 2; - } - return this.slice(start, i + bytes) - }; - var init_menu = function (menu) { - var str = ""; - var items = menu; - var type = action = ""; - for (i in items) { - if (items[i]['sub_button'] != undefined) { - type = action = ""; - } else { - type = items[i]['type']; - if (items[i]['url'] != undefined) - action = "url|" + items[i]['url']; - if (items[i]['key'] != undefined) - action = "key|" + items[i]['key']; - } - str += ''; - } - } - str += ''; - str += ''; - } - $("#add-item").before(str); - }; - var refresh_type = function () { - if ($('input[name=type]:checked').val() == 'view') { - $(".is-view").show(); - $(".is-click").hide(); - } else { - $(".is-view").hide(); - $(".is-click").show(); - } - }; - //初始化菜单 - init_menu(menu); - //拖动排序 - new Sortable($("#menu-list")[0], {draggable: 'li.menu-item'}); - $(".sub-menu-list").each(function () { - new Sortable(this, {draggable: 'li.sub-menu-item'}); - }); - //添加主菜单 - $(document).on('click', '#add-item', function () { - var menu_item_total = $(".menu-item").size(); - if (menu_item_total < 3) { - var item = ''; - var itemDom = $(item); - itemDom.insertBefore(this); - itemDom.trigger("click"); - $(".sub-menu-box", itemDom).show(); - new Sortable($(".sub-menu-list", itemDom)[0], {draggable: 'li.sub-menu-item'}); - } - }); - $(document).on('change', 'input[name=type]', function () { - refresh_type(); - }); - $(document).on('click', '#item_delete', function () { - var current = $("#menu-list li.current"); - var prev = current.prev("li[data-type]"); - var next = current.next("li[data-type]"); - - if (prev.size() == 0 && next.size() == 0 && $(".sub-menu-box", current).size() == 0) { - last = current.closest(".menu-item"); - } else if (prev.size() > 0 || next.size() > 0) { - last = prev.size() > 0 ? prev : next; - } else { - last = null; - $(".weixin-content").hide(); - $(".no-weixin-content").show(); - } - $("#menu-list li.current").remove(); - if (last) { - last.trigger('click'); - } else { - $("input[name='item-title']").val(''); - } - updateChangeMenu(); - }); - - //更新修改与变动 - var updateChangeMenu = function () { - var title = $("input[name='item-title']").val(); - var type = $("input[name='type']:checked").val(); - var key = value = ''; - if (type == 'view') { - key = 'url'; - } else { - key = 'key'; - } - value = $("input[name='" + key + "']").val(); - - if (key == 'key') { - var keytitle = typeof responselist[value] != 'undefined' ? responselist[value] : ''; - var cont = $(".is-click .create-click:first"); - $(".keytitle", cont).remove(); - cont.append('
                                    资源名:' + keytitle + '
                                    '); - } - var currentItem = $("#menu-list li.current"); - if (currentItem.size() > 0) { - currentItem.attr('data-type', type); - currentItem.attr('data-action', key + "|" + value); - if (currentItem.siblings().size() == 4) { - $(".add-sub-item").show(); - } else if (false) { - - } - currentItem.children("a").find("span").text(title.subByte(0, 16)); - $("input[name='item-title']").val(title); - currentItem.attr('data-name', title); - $('#current-item-name').text(title); - } - menuUpdate(); - } - //更新菜单数据 - var menuUpdate = function () { - $.post("wechat/menu/edit", {menu: JSON.stringify(getMenuList())}, function (data) { - if (data['code'] == 1) { - } else { - Toastr.error(__('Operation failed')); - } - }, 'json'); - }; - //获取菜单数据 - var getMenuList = function () { - var menus = new Array(); - var sub_button = new Array(); - var menu_i = 0; - var sub_menu_i = 0; - var item; - $("#menu-list li").each(function (i) { - item = $(this); - var name = item.attr('data-name'); - var type = item.attr('data-type'); - var action = item.attr('data-action'); - if (name != null) { - actions = action.split('|'); - if (item.hasClass('menu-item')) { - sub_menu_i = 0; - if (item.find('.sub-menu-item').size() > 0) { - menus[menu_i] = {"name": name, "sub_button": "sub_button"} - } else { - if (actions[0] == 'url') - menus[menu_i] = {"name": name, "type": type, "url": actions[1]}; - else - menus[menu_i] = {"name": name, "type": type, "key": actions[1]}; - } - if (menu_i > 0) { - if (menus[menu_i - 1]['sub_button'] == "sub_button") - menus[menu_i - 1]['sub_button'] = sub_button; - else - menus[menu_i - 1]['sub_button']; - } - sub_button = new Array(); - menu_i++; - } else { - if (actions[0] == 'url') - sub_button[sub_menu_i++] = {"name": name, "type": type, "url": actions[1]}; - else - sub_button[sub_menu_i++] = {"name": name, "type": type, "key": actions[1]}; - } - } - }); - if (sub_button.length > 0) { - var len = menus.length; - menus[len - 1]['sub_button'] = sub_button; - } - return menus; - } - //添加子菜单 - $(document).on('click', ".add-sub-item", function () { - var sub_menu_item_total = $(this).parent().find(".sub-menu-item").size(); - if (sub_menu_item_total < 5) { - var item = ''; - var itemDom = $(item); - itemDom.insertBefore(this); - itemDom.trigger("click"); - if (sub_menu_item_total == 4) { - $(this).hide(); - } - } - return false; - }); - //主菜单子菜单点击事件 - $(document).on('click', ".menu-item, .sub-menu-item", function () { - if ($(this).hasClass("sub-menu-item")) { - $("#menu-list li").removeClass('current'); - $(".is-item").show(); - $(".is-sub-item").show(); - } else { - $("#menu-list li").removeClass('current'); - $("#menu-list > li").not(this).find(".sub-menu-box").hide(); - $(".sub-menu-box", this).toggle(); - //如果当前还没有子菜单 - if ($(".sub-menu-item", this).size() == 0) { - $(".is-item").show(); - $(".is-sub-item").show(); - } else { - $(".is-item").hide(); - $(".is-sub-item").hide(); - } - } - $(this).addClass('current'); - var type = $(this).attr('data-type'); - var action = $(this).attr('data-action'); - var title = $(this).attr('data-name'); - - actions = action.split('|'); - $("input[name=type][value='" + type + "']").prop("checked", true); - $("input[name='item-title']").val(title); - $('#current-item-name').text(title); - if (actions[0] == 'url') { - $('input[name=key]').val(''); - } else { - $('input[name=url]').val(''); - } - $("input[name='" + actions[0] + "']").val(actions[1]); - if (actions[0] == 'key') { - var keytitle = typeof responselist[actions[1]] != 'undefined' ? responselist[actions[1]] : ''; - var cont = $(".is-click .create-click:first"); - $(".keytitle", cont).remove(); - if (keytitle) { - cont.append('
                                    资源名:' + keytitle + '
                                    '); - } - } else { - - } - - $(".weixin-content").show(); - $(".no-weixin-content").hide(); - - refresh_type(); - - return false; - }); - $("form").on('change', "input,textarea", function () { - updateChangeMenu(); - }); - $(document).on('click', "#menuSyn", function () { - $.post("wechat/menu/sync", {}, function (ret) { - var msg = ret.hasOwnProperty("msg") && ret.msg != "" ? ret.msg : ""; - if (ret.code == 1) { - Backend.api.toastr.success('菜单同步更新成功,生效时间看微信官网说明,或者你重新关注微信号!'); - } else { - Backend.api.toastr.error(msg ? msg : __('Operation failed')); - } - }, 'json'); - }); - var refreshkey = function (data) { - responselist[data.eventkey] = data.title; - $("input[name=key]").val(data.eventkey).trigger("change"); - Layer.closeAll(); - }; - $(document).on('click', "#select-resources", function () { - var key = $("#key").val(); - Backend.api.open($(this).attr("href") + "?key=" + key, __('Select'), { - callback: refreshkey - }); - return false; - }); - - $(document).on('click', "#add-resources", function () { - Backend.api.open($(this).attr("href") + "?key=" + key, __('Add'), { - callback: refreshkey - }); - return false; - }); - }, - add: function () { - Form.api.bindevent($("form[role=form]")); - }, - edit: function () { - Form.api.bindevent($("form[role=form]")); - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/backend/wechat/response.js b/public/assets/js/backend/wechat/response.js deleted file mode 100644 index fac83fac..00000000 --- a/public/assets/js/backend/wechat/response.js +++ /dev/null @@ -1,178 +0,0 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'adminlte'], function ($, undefined, Backend, Table, Form, Adminlte) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'wechat/response/index', - add_url: 'wechat/response/add', - edit_url: 'wechat/response/edit', - del_url: 'wechat/response/del', - multi_url: 'wechat/response/multi', - } - }); - - var table = $("#table"); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - sortName: 'id', - columns: [ - [ - {field: 'state', checkbox: true, }, - {field: 'id', title: 'ID'}, - {field: 'type', title: __('Type')}, - {field: 'title', title: __('Resource title')}, - {field: 'eventkey', title: __('Event key')}, - {field: 'status', title: __('Status'), formatter: Table.api.formatter.status, operate:false}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} - ] - ] - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - select: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'wechat/response/index', - } - }); - - var table = $("#table"); - - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - sortName: 'id', - columns: [ - [ - {field: 'state', checkbox: true, }, - {field: 'id', title: 'ID'}, - {field: 'type', title: __('Type')}, - {field: 'title', title: __('Title')}, - {field: 'event', title: __('Event')}, - {field: 'status', title: __('Status'), formatter: Table.api.formatter.status, operate:false}, - {field: 'operate', title: __('Operate'), events: { - 'click .btn-chooseone': function (e, value, row, index) { - Fast.api.close(row); - }, - }, formatter: function () { - return ' ' + __('Choose') + ''; - }} - ] - ] - }); - - // 为表格绑定事件 - Table.api.bindevent(table); - }, - add: function () { - Form.api.bindevent($("form[role=form]"), function (data) { - Fast.api.close(data); - }); - Controller.api.bindevent(); - }, - edit: function () { - Form.api.bindevent($("form[role=form]")); - Controller.api.bindevent(); - }, - api: { - bindevent: function () { - var getAppFileds = function (app) { - var app = apps[app]; - var appConfig = app['config']; - var str = ''; - for (i in appConfig) { - if (appConfig[i]['type'] == 'text' || appConfig[i]['type'] == 'textarea') { - var pattern_str = 'pattern ="required" '; - var alt = ''; - if (undefined != appConfig[i]['alt']) - alt = appConfig[i]['alt']; - if (undefined != appConfig[i]['pattern']) - pattern_str = 'pattern ="' + appConfig[i]['pattern'] + '" '; - if (appConfig[i]['type'] == 'textarea') { - str += '
                                    '; - } else { - str += '
                                    '; - } - } else { - var options = appConfig[i]['options']; - options = options.split(','); - var option_str = ''; - if (appConfig[i]['type'] == 'select') { - for (o in options) { - var option = options[o]; - var item = option.split(':'); - option_str += ''; - } - option_str = ''; - } else if (appConfig[i]['type'] == 'checkbox') { - for (o in options) { - var option = options[o]; - var item = option.split(':'); - option_str += ' '; - } - - } else if (appConfig[i]['type'] == 'radio') { - for (o in options) { - var option = options[o]; - var item = option.split(':'); - option_str += ' '; - } - } - str += '
                                    ' + option_str + '
                                    '; - } - - } - return str; - }; - $(document).on('change', "#app", function () { - var app = $(this).val(); - $("#appfields").html(getAppFileds(app)); - if (datas.app == app) { - delete(datas.app); - var form = $("form.form-ajax"); - $.each(datas, function (i, j) { - form.field("row[content][" + i + "]" + ($("input[name='row[content][" + i + "][]']", form).size() > 0 ? '[]' : ''), j); - }); - } - }); - $(document).on('click', "input[name='row[type]']", function () { - var type = $(this).val(); - if (type == 'text') { - $("#expand").html('
                                    '); - console.log($($("form.form-ajax row[content][content]"))); - $("form[role='form']").field("row[content][content]", datas.content); - } else if (type == 'app') { - $("#expand").html('
                                    '); - $("form[role='form']").field("row[content][app]", datas.app); - $("#app").trigger('change'); - } - }); - $(document).on('click', ".btn-insertlink", function () { - var textarea = $("textarea[name='row[content][content]']"); - var cursorPos = textarea.prop('selectionStart'); - var v = textarea.val(); - var textBefore = v.substring(0, cursorPos); - var textAfter = v.substring(cursorPos, v.length); - - Layer.prompt({title: '请输入显示的文字', formType: 3}, function (text, index) { - Layer.close(index); - Layer.prompt({title: '请输入跳转的链接URL(包含http)', formType: 3}, function (link, index) { - text = text == '' ? link : text; - textarea.val(textBefore + '' + text + '' + textAfter); - Layer.close(index); - }); - }); - }); - $("input[name='row[type]']:checked").trigger("click"); - } - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/frontend/cms/archives.js b/public/assets/js/frontend/cms/archives.js deleted file mode 100644 index e8691d51..00000000 --- a/public/assets/js/frontend/cms/archives.js +++ /dev/null @@ -1,27 +0,0 @@ -define(['jquery', 'bootstrap', 'frontend', 'template', 'form'], function ($, undefined, Frontend, Template, Form) { - var Controller = { - my: function () { - - }, - post: function () { - $(document).on('change', '#c-channel_id', function () { - Fast.api.ajax({ - url: 'cms.archives/get_channel_fields', - data: {channel_id: $(this).val(), archives_id: Config.archives_id} - }, function (data) { - $("#extend").html(data.html); - Form.api.bindevent($("#extend")); - return false; - }); - localStorage.setItem('last_channel_id', $(this).val()); - }); - Form.api.bindevent($("form[role=form]"), function (data, ret) { - setTimeout(function () { - location.href = Fast.api.fixurl('cms.archives/my'); - }, 1500); - }); - $("#c-channel_id").trigger("change"); - } - }; - return Controller; -}); \ No newline at end of file diff --git a/public/assets/js/frontend/cms/diyform.js b/public/assets/js/frontend/cms/diyform.js deleted file mode 100644 index 3c24d9a1..00000000 --- a/public/assets/js/frontend/cms/diyform.js +++ /dev/null @@ -1,13 +0,0 @@ -define(['jquery', 'bootstrap', 'frontend', 'template', 'form'], function ($, undefined, Frontend, Template, Form) { - var Controller = { - index: function () { - Form.api.bindevent($("form[role=form]"), function (data, ret) { - Layer.alert(ret.msg, function () { - location.href = ret.url; - }); - return false; - }); - } - }; - return Controller; -}); \ No newline at end of file