wesmiler 6 лет назад
Родитель
Сommit
dffc13b2e3

Разница между файлами не показана из-за своего большого размера
+ 0 - 96007
jmls.sql


+ 0 - 50
public/plugins/demo/DemoPlugin.php

@@ -1,50 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
-// +----------------------------------------------------------------------
-// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
-// +----------------------------------------------------------------------
-// | Author: Dean <zxxjjforever@163.com>
-// +----------------------------------------------------------------------
-
-namespace plugins\demo;
-
-//Demo插件英文名,改成你的插件英文就行了
-use cmf\lib\Plugin;
-
-//Demo插件英文名,改成你的插件英文就行了
-class DemoPlugin extends Plugin
-{
-    public $info = [
-        'name'        => 'Demo', //Demo插件英文名,改成你的插件英文就行了
-        'title'       => '插件演示',
-        'description' => '插件演示',
-        'status'      => 1,
-        'author'      => 'ThinkCMF',
-        'version'     => '1.0',
-        'demo_url'    => 'http://demo.thinkcmf.com',
-        'author_url'  => 'http://www.thinkcmf.com',
-    ];
-
-    public $hasAdmin = 1; //插件是否有后台管理界面
-
-    // 插件安装
-    public function install()
-    {
-        return true; //安装成功返回true,失败false
-    }
-
-    // 插件卸载
-    public function uninstall()
-    {
-        return true; //卸载成功返回true,失败false
-    }
-
-    //实现的footer_start钩子方法
-    public function footerStart($param)
-    {
-        $config = $this->getConfig();
-        $this->assign($config);
-        echo $this->fetch('widget');
-    }
-}

+ 0 - 8
public/plugins/demo/README.md

@@ -1,8 +0,0 @@
-ThinkCMF 插件演示
-===============
-
-### 加载第三方库
-支持使用`composer`加载第三方库
-```
-composer require phpoffice/phpspreadsheet
-```

+ 0 - 14
public/plugins/demo/composer.json

@@ -1,14 +0,0 @@
-{
-    "name": "thinkcmf/plugins-demo",
-    "description": "ThinkCMF demo plugin",
-    "type": "cmf-plugin",
-    "license": "apache2.0",
-    "authors": [
-        {
-            "name": "catman",
-            "email": "catman@thinkcmf.com"
-        }
-    ],
-    "require": {
-    }
-}

+ 0 - 118
public/plugins/demo/config.php

@@ -1,118 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
-// +----------------------------------------------------------------------
-// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
-// +----------------------------------------------------------------------
-// | Author: Dean <zxxjjforever@163.com>
-// +----------------------------------------------------------------------
-return [
-    'custom_config' => [// 在后台插件配置表单中的键名 ,会是config[custom_config],这个键值很特殊,是自定义插件配置的开关
-        'title' => '自定义配置处理', // 表单的label标题
-        'type'  => 'text', // 表单的类型:text,password,textarea,checkbox,radio,select等
-        'value' => '0', // 如果值为1,表示由插件自己处理插件配置,配置入口在 AdminIndex/setting
-        'tip'   => '自定义配置处理', //表单的帮助提示
-    ],
-    'text'          => [// 在后台插件配置表单中的键名 ,会是config[text]
-        'title' => '文本', // 表单的label标题
-        'type'  => 'text', // 表单的类型:text,password,textarea,checkbox,radio,select等
-        'value' => 'hello,ThinkCMF!', // 表单的默认值
-        'tip'   => '这是文本组件的演示', //表单的帮助提示
-    ],
-    'password'      => [// 在后台插件配置表单中的键名 ,会是config[password]
-        'title' => '密码',
-        'type'  => 'password',
-        'value' => '',
-        'tip'   => '这是密码组件',
-    ],
-    'number'        => [
-        'title' => '数字',
-        'type'  => 'number',
-        'value' => '1.0',
-        'tip'   => '这是数字组件的演示',
-    ],
-    'select'        => [// 在后台插件配置表单中的键名 ,会是config[select]
-        'title'   => '下拉列表',
-        'type'    => 'select',
-        'options' => [//select 和radio,checkbox的子选项
-            '1' => 'ThinkCMFX', // 值=>显示
-            '2' => 'ThinkCMF',
-            '3' => '跟猫玩糗事',
-            '4' => '门户应用',
-        ],
-        'value'   => '1',
-        'tip'     => '这是下拉列表组件',
-    ],
-    'checkbox'      => [
-        'title'   => '多选框',
-        'type'    => 'checkbox',
-        'options' => [
-            '1' => 'genmaowan.com',
-            '2' => 'www.thinkcmf.com',
-        ],
-        'value'   => 1,
-        'tip'     => '这是多选框组件',
-    ],
-    'radio'         => [
-        'title'   => '单选框',
-        'type'    => 'radio',
-        'options' => [
-            '1' => 'ThinkCMFX',
-            '2' => 'ThinkCMF',
-        ],
-        'value'   => '1',
-        'tip'     => '这是单选框组件',
-    ],
-    'radio2'        => [
-        'title'   => '单选框2',
-        'type'    => 'radio',
-        'options' => [
-            '1' => 'ThinkCMFX',
-            '2' => 'ThinkCMF',
-        ],
-        'value'   => '1',
-        'tip'     => '这是单选框组件2',
-    ],
-    'textarea'      => [
-        'title' => '多行文本',
-        'type'  => 'textarea',
-        'value' => '这里是你要填写的内容',
-        'tip'   => '这是多行文本组件',
-    ],
-    'date'          => [
-        'title' => '日期',
-        'type'  => 'date',
-        'value' => '2017-05-20',
-        'tip'   => '这是日期组件的演示',
-    ],
-    'datetime'      => [
-        'title' => '时间',
-        'type'  => 'datetime',
-        'value' => '2017-05-20',
-        'tip'   => '这是时间组件的演示',
-    ],
-    'color'         => [
-        'title' => '颜色',
-        'type'  => 'color',
-        'value' => '#103633',
-        'tip'   => '这是颜色组件的演示',
-    ],
-    'image'         => [
-        'title' => '图片',
-        'type'  => 'image',
-        'value' => '',
-        'tip'   => '这是图片组件的演示',
-    ],
-    'file'          => [
-        'title' => '文件',
-        'type'  => 'file',
-        'value' => '',
-        'tip'   => '这是文件组件的演示',
-    ],
-    'location'      => [
-        'title' => '地理坐标',
-        'type'  => 'location',
-        'value' => '',
-        'tip'   => '这是地理坐标组件的演示',
-    ],
-];

+ 0 - 96
public/plugins/demo/controller/AdminIndexController.php

@@ -1,96 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
-// +----------------------------------------------------------------------
-// | Copyright (c) 2013-2014 http://www.thinkcmf.com All rights reserved.
-// +----------------------------------------------------------------------
-// | Author: Dean <zxxjjforever@163.com>
-// +----------------------------------------------------------------------
-
-namespace plugins\demo\controller;
-
-//Demo插件英文名,改成你的插件英文就行了
-
-use cmf\controller\PluginAdminBaseController;
-use think\Db;
-
-/**
- * Class AdminIndexController.
- *
- * @adminMenuRoot(
- *     'name'   =>'演示插件',
- *     'action' =>'default',
- *     'parent' =>'',
- *     'display'=> true,
- *     'order'  => 0,
- *     'icon'   =>'dashboard',
- *     'remark' =>'演示插件入口'
- * )
- */
-class AdminIndexController extends PluginAdminBaseController
-{
-    protected function initialize()
-    {
-        parent::initialize();
-        $adminId = cmf_get_current_admin_id(); //获取后台管理员id,可判断是否登录
-        if (!empty($adminId)) {
-            $this->assign('admin_id', $adminId);
-        }
-    }
-
-    /**
-     * 演示插件用户列表
-     * @adminMenu(
-     *     'name'   => '演示插件用户列表',
-     *     'parent' => 'default',
-     *     'display'=> true,
-     *     'hasView'=> true,
-     *     'order'  => 10000,
-     *     'icon'   => '',
-     *     'remark' => '演示插件用户列表',
-     *     'param'  => ''
-     * )
-     */
-    public function index()
-    {
-//        $result = $this->validate([], 'Demo');
-//        if ($result !== true) {
-//            $this->error($result);
-//        }
-        $users = Db::name('user')->limit(0, 5)->select();
-        //$demos = PluginDemoModel::all();
-
-        // print_r($demos);
-
-        $this->assign('users', $users);
-
-        return $this->fetch('/admin_index');
-    }
-
-    /**
-     * 演示插件设置
-     * @adminMenu(
-     *     'name'   => '演示插件设置',
-     *     'parent' => 'index',
-     *     'display'=> false,
-     *     'hasView'=> true,
-     *     'order'  => 10000,
-     *     'icon'   => '',
-     *     'remark' => '演示插件设置',
-     *     'param'  => ''
-     * )
-     */
-    public function setting()
-    {
-        $users = Db::name('user')->limit(0, 5)->select();
-        //$demos = PluginDemoModel::all();
-
-        // print_r($demos);
-
-        $this->assign('users', $users);
-
-        $this->assign('users', $users);
-
-        return $this->fetch('/admin_index');
-    }
-}

+ 0 - 21
public/plugins/demo/controller/ApiIndexController.php

@@ -1,21 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
-// +----------------------------------------------------------------------
-// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
-// +----------------------------------------------------------------------
-// | Author: Dean <zxxjjforever@163.com>
-// +----------------------------------------------------------------------
-
-namespace plugins\demo\controller;
-
-//Demo插件英文名,改成你的插件英文就行了
-use cmf\controller\PluginRestBaseController;
-
-class ApiIndexController extends PluginRestBaseController
-{
-    public function index()
-    {
-        $this->success('success', ['hello' => 'hello ThinkCMF!']);
-    }
-}

+ 0 - 25
public/plugins/demo/controller/IndexController.php

@@ -1,25 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
-// +----------------------------------------------------------------------
-// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
-// +----------------------------------------------------------------------
-// | Author: Dean <zxxjjforever@163.com>
-// +----------------------------------------------------------------------
-
-namespace plugins\demo\controller;
-
-//Demo插件英文名,改成你的插件英文就行了
-use cmf\controller\PluginBaseController;
-use think\Db;
-
-class IndexController extends PluginBaseController
-{
-    public function index()
-    {
-        $users = Db::name('user')->limit(0, 5)->select();
-        $this->assign('users', $users);
-
-        return $this->fetch('/index');
-    }
-}

+ 0 - 3
public/plugins/demo/lang/en-us.php

@@ -1,3 +0,0 @@
-<?php
-
-return ['plugin_demo_hello_world'=>'Hello,Plugin!'];

+ 0 - 3
public/plugins/demo/lang/zh-cn.php

@@ -1,3 +0,0 @@
-<?php
-
-return ['plugin_demo_hello_world'=>'您好,插件!'];

+ 0 - 23
public/plugins/demo/model/PluginDemoModel.php

@@ -1,23 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
-// +----------------------------------------------------------------------
-// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
-// +----------------------------------------------------------------------
-// | Author: Dean <zxxjjforever@163.com>
-// +----------------------------------------------------------------------
-
-namespace plugins\demo\model;
-
-//Demo插件英文名,改成你的插件英文就行了
-use think\Model;
-
-//Demo插件英文名,改成你的插件英文就行了,插件数据表最好加个plugin前缀再加表名,这个类就是对应“表前缀+plugin_demo”表
-class PluginDemoModel extends Model
-{
-    //自定义方法
-    public function test()
-    {
-        echo 'hello';
-    }
-}

+ 0 - 30
public/plugins/demo/validate/DemoValidate.php

@@ -1,30 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
-// +----------------------------------------------------------------------
-// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
-// +----------------------------------------------------------------------
-// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
-// +----------------------------------------------------------------------
-// | Author: 小夏 < 449134904@qq.com>
-// +----------------------------------------------------------------------
-
-namespace plugins\demo\validate;
-
-use think\Validate;
-
-class DemoValidate extends Validate
-{
-    protected $rule = [
-        'title' => 'require',
-    ];
-
-    protected $message = [
-        'title.require' => '标题不能为空',
-    ];
-
-    protected $scene = [
-//        'add'  => ['user_login,user_pass,user_email'],
-//        'edit' => ['user_login,user_email'],
-    ];
-}

+ 0 - 11
public/plugins/demo/vendor/.gitignore

@@ -1,11 +0,0 @@
-.buildpath
-.DS_Store
-.project
-.settings
-.idea
-.git
-/build
-/public/assets/dist
-/node_modules
-Vagrantfile
-.vagrant

+ 0 - 61
public/plugins/demo/view/admin_index.html

@@ -1,61 +0,0 @@
-<!doctype html>
-<html>
-<head>
-    <include file="public/head"/>
-    <title>ThinkCMF插件演示首页</title>
-    <meta name="description" content="ThinkCMF插件演示首页">
-    <meta name="keywords" content="ThinkCMF插件演示首页">
-</head>
-<body>
-<div class="wrap js-check-wrap">
-    <ul class="nav nav-tabs">
-        <li class="active"><a>插件演示后台</a></li>
-    </ul>
-    <div class="common-form">
-        <div class="well">
-
-            <p>
-                <b>当前登录管理员id:</b>{$admin_id|default='管理员未登录'}
-            </p>
-            <p>
-                <b>插件根目录:</b>__PLUGIN_ROOT__
-            </p>
-            <p>
-                <b>插件模板根目录:</b>__PLUGIN_TMPL__
-            </p>
-
-        </div>
-        <form method="post" class="js-ajax-form" action="#">
-            <div class="table_list">
-                <table width="100%" class="table table-hover">
-                    <thead>
-                    <tr>
-                        <th width="50">ID</th>
-                        <th>用户名</th>
-                        <th>邮箱</th>
-                        <th>注册时间</th>
-                        <th width="120">操作</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    <foreach name="users" item="vo">
-                        <tr>
-                            <td>{$vo.id}</td>
-                            <td>{$vo.user_login}</td>
-                            <td>{$vo.user_email}</td>
-                            <td>{$vo.create_time}</td>
-                            <td>
-                                <a href="javascript:;">修改</a>|
-                                <a href="javascript:;" class="js-ajax-delete">删除</a>
-                            </td>
-                        </tr>
-                    </foreach>
-                    </tbody>
-                </table>
-            </div>
-        </form>
-    </div>
-</div>
-<include file="public/scripts"/>
-</body>
-</html>

+ 0 - 54
public/plugins/demo/view/index.html

@@ -1,54 +0,0 @@
-<!doctype html>
-<html>
-<head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="description" content="ThinkCMF插件演示首页">
-    <meta name="keywords" content="ThinkCMF插件演示首页">
-    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
-    <title>ThinkCMF插件演示首页</title>
-
-    <!-- Set render engine for 360 browser -->
-    <meta name="renderer" content="webkit">
-
-    <!-- No Baidu Siteapp-->
-    <meta http-equiv="Cache-Control" content="no-siteapp"/>
-
-    <link rel="shortcut icon" href="__PLUGIN_TMPL__/assets/images/favicon.ico" type="image/x-icon">
-
-    <!-- SEO: If your mobile URL is different from the desktop URL, add a canonical link to the desktop page https://developers.google.com/webmasters/smartphone-sites/feature-phones -->
-    <!--
-    <link rel="canonical" href="http://www.example.com/">
-    -->
-
-</head>
-<body>
-<div class="well well-warning" style="display: inline-block;">
-    <h2>ThinkCMF插件演示</h2>
-    {:lang('plugin_demo_hello_world')}
-    <p>
-        <b>插件根目录:</b>__PLUGIN_ROOT__
-    </p>
-
-    <p>
-        <b>插件模板根目录:</b>__PLUGIN_TMPL__
-    </p>
-
-    <p>
-        <b>生成插件控制器 URL:</b>{:cmf_plugin_url('Demo://Index/index',['id'=>1])}
-    </p>
-
-    <p>
-        <b>foreach:</b>
-    </p>
-    <ol>
-        <foreach name="users" item="vo">
-            <li>{$vo.user_login} {:date('Y-m-d H:i:s',$vo['create_time'])}</li>
-
-        </foreach>
-    </ol>
-
-
-</div>
-</body>
-</html>

BIN
public/plugins/demo/view/public/assets/images/favicon.ico


+ 0 - 23
public/plugins/demo/view/public/head.html

@@ -1,23 +0,0 @@
-<meta charset="utf-8">
-<meta http-equiv="X-UA-Compatible" content="IE=edge">
-
-<!-- Set render engine for 360 browser -->
-<meta name="renderer" content="webkit">
-
-<!-- No Baidu Siteapp-->
-<meta http-equiv="Cache-Control" content="no-siteapp"/>
-
-<link rel="shortcut icon" href="__PLUGIN_TMPL__/public/assets/images/favicon.ico" type="image/x-icon">
-
-<link href="__ADMIN_TMPL__/public/assets/themes/{:cmf_get_admin_style()}/bootstrap.min.css" rel="stylesheet">
-<link href="__ADMIN_TMPL__/public/assets/simpleboot3/css/simplebootadmin.css" rel="stylesheet">
-<link href="__STATIC__/font-awesome/css/font-awesome.min.css?page=index" rel="stylesheet" type="text/css">
-
-<script type="text/javascript">
-    //全局变量
-    var GV = {
-        ROOT: "__ROOT__/",
-        WEB_ROOT: "__WEB_ROOT__/",
-        JS_ROOT: "static/js/"
-    };
-</script>

+ 0 - 4
public/plugins/demo/view/public/scripts.html

@@ -1,4 +0,0 @@
-<script src="__STATIC__/js/jquery.js"></script>
-<script src="__STATIC__/js/wind.js"></script>
-<script src="__STATIC__/js/bootstrap.min.js"></script>
-<script src="__STATIC__/js/admin.js"></script>

+ 0 - 49
public/plugins/demo/view/widget.html

@@ -1,49 +0,0 @@
-<div class="well well-warning" style="display: inline-block;">
-	<h2>ThinkCMF插件演示</h2>
-	<p>
-		<b>主页:</b><a href ="{:cmf_plugin_url('Demo://Index/index')}" target="_blank" >访问</a>
-	</p>
-	<p>
-		<b>后台管理:</b><a href ="{:cmf_plugin_url('Demo://AdminIndex/index')}" target="_blank" >访问</a>
-	</p>
-	<p>
-		<b>插件根目录:</b>__PLUGIN_ROOT__
-	</p>
-
-	<p>
-		<b>插件模板根目录:</b>__PLUGIN_TMPL__
-	</p>
-
-	<p>
-		<b>文本:</b>{$text}
-	</p>
-	<p>
-		<b>密码:</b>{$password}
-	</p>
-
-	<php> $select_options=array( '1'=>'ThinkCMFX', '2'=>'ThinkCMF',
-		'3'=>'跟猫玩糗事', '4'=>'门户应用' ); </php>
-
-	<p>
-		<b>下拉列表:</b>{$select_options[$select]}
-	</p>
-
-	<php> $checkbox_options=array( '1'=>'genmaowan.com',
-		'2'=>'www.thinkcmf.com', ); </php>
-
-	<p>
-		<b>多选框:</b>
-		<foreach name='checkbox' item="vo">{$checkbox_options[$vo]}</foreach>
-	</p>
-
-	<php> $radio_options=array( '1'=>'ThinkCMFX', '2'=>'ThinkCMF' );
-	</php>
-	<p>
-		<b>单选框:</b>{$radio_options[$radio]}
-	</p>
-
-	<p>
-		<b>多行文本:</b>{$textarea}
-	</p>
-
-</div>