dever %!s(int64=3) %!d(string=hai) anos
pai
achega
293e5d07e6
Modificáronse 5 ficheiros con 395 adicións e 0 borrados
  1. 110 0
      assets/layadmin/html/doc/help.html
  2. 21 0
      database/config.php
  3. 166 0
      database/help.php
  4. 38 0
      src/Help.php
  5. 60 0
      template/layadmin/doc/help.php

+ 110 - 0
assets/layadmin/html/doc/help.html

@@ -0,0 +1,110 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+<filter><script src="../script/lib/common.js"></script><script src="../script/lib/jquery/jquery.min.js"></script></filter>
+<meta charset="utf-8">
+<title>Doc by Dever</title>
+<meta name="keywords" content="" />
+<meta name="description" content="" /> 
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<link rel="stylesheet" type="text/css" href="../script/lib/bootstrap/css/bootstrap.min.css" />
+<link rel="stylesheet" type="text/css" href="../script/lib/doc/doc.min.css">
+<style>
+body,html
+{
+    background-color:white;
+}
+.bs-docs-container
+{
+    margin-bottom:40px;
+}
+.bs-docs-header
+{
+    margin-top: -20px;
+}
+</style>
+</head>
+
+<body>
+
+
+    <div class="bs-docs-header" id="top" tabindex="-1">
+      <div class="container">
+        <h1>起步</h1>
+        <p>简要介绍 Bootstrap,以及如何下载、使用,还有基本模版和案例,等等。</p>
+      </div>
+    </div>
+
+    <div class="container bs-docs-container">
+        <div class="row">
+            <div class="col-md-9" role="main">
+                <div class="bs-docs-section">
+                      <h1 id="disable-responsive" class="page-header"><a class="anchorjs-link " href="#disable-responsive" aria-label="Anchor link for: disable responsive" data-anchorjs-icon="" style="font-family: anchorjs-icons; font-style: normal; font-variant: normal; font-weight: normal; position: absolute; margin-left: -1em; padding-right: 0.5em;"></a><span>禁止响应式布局</span></h1>
+
+                      <div>
+                          <p class="lead">Bootstrap 会自动帮你针对不同的屏幕尺寸调整你的页面,使其在各个尺寸的屏幕上表现良好。下面我们列出了如何禁用这一特性,就像这个<a href="../examples/non-responsive/">非响应式布局实例</a>页面一样。</p>
+
+                          <h2 id=""><a class="anchorjs-link " href="#" aria-label="Anchor link for: " data-anchorjs-icon="" style="font-family: anchorjs-icons; font-style: normal; font-variant: normal; font-weight: normal; position: absolute; margin-left: -1em; padding-right: 0.5em;"></a>禁止响应式布局有如下几步:</h2>
+                          <ol>
+                            <li>移除 <a href="../css/#overview-mobile">此 CSS 文档</a>中提到的设置浏览器视口(viewport)的标签:<code>&lt;meta&gt;</code>。</li>
+                            <li>通过为 <code>.container</code> 类设置一个 <code>width</code> 值从而覆盖框架的默认 width 设置,例如 <code>width: 970px !important;</code> 。请确保这些设置全部放在默认的 Bootstrap CSS 文件的后面。注意,如果你把它放到媒体查询中,也可以略去 <code>!important</code> 。</li>
+                            <li>如果使用了导航条,需要移除所有导航条的折叠和展开行为。</li>
+                            <li>对于栅格布局,额外增加 <code>.col-xs-*</code> 类或替换掉 <code>.col-md-*</code> 和 <code>.col-lg-*</code>。 不要担心,针对超小屏幕设备的栅格系统能够在所有分辨率的环境下展开。</li>
+                          </ol>
+                          <p>针对 IE8 仍然需要额外引入 Respond.js 文件(由于仍然利用了浏览器对媒体查询(media query)的支持,因此还需要做处理)。这样就禁用了 Bootstrap 对移动设备的响应式支持。</p>
+
+                          <h2 id="bootstrap"><a class="anchorjs-link " href="#bootstrap" aria-label="Anchor link for: bootstrap" data-anchorjs-icon="" style="font-family: anchorjs-icons; font-style: normal; font-variant: normal; font-weight: normal; position: absolute; margin-left: -1em; padding-right: 0.5em;"></a>禁止响应式特性的 Bootstrap 模版</h2>
+                          <p>我们已经按照上面的步骤制作了一份案例。仔细阅读其源码并对照上面的步骤实践一下吧。</p>
+                          <p>
+                            <a href="../examples/non-responsive/" class="btn btn-primary">非响应式布局实例</a>
+                          </p>
+                    </div>
+                </div>
+            </div>
+
+            <div class="col-md-3" role="complementary">
+                <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix-top">
+                    <ul class="nav bs-docs-sidenav" style="overflow: auto;height: 600px;">
+
+                        <li class="">
+                            <a href="#download">下载</a>
+                        </li>
+                        <li class="">
+                            <a href="#whats-included">包含的内容</a>
+                            <ul class="nav">
+                                <li class=""><a href="#whats-included-precompiled">预编译版</a></li>
+                                <li class=""><a href="#whats-included-source">Bootstrap 源码</a></li>
+                            </ul>
+                        </li>
+
+                        <li class="">
+                        <a href="#template">基本模板</a>
+                        </li>
+                    </ul>
+
+                </nav>
+            </div>
+        </div>
+
+    </div> <!-- /container -->
+    
+    <div class="footer" style="display:none;">
+        <div class="container small text-center">
+          <p id="dever_copyright">
+            <span>Made With Love By The EST Group.</span>
+          </p>
+
+          <p id="dever_icp">
+            <span>Made With Love By The EST Group.</span>
+          </p>
+        </div>
+    </div>
+    <div id="dever_code"></div>
+
+    <script type="text/javascript" src="../script/lib/jquery/jquery.min.js"></script>
+    <script type="text/javascript" src="../script/lib/bootstrap/js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="../script/lib/doc/doc.min.js"></script>
+    <script type="text/javascript" src="../script/lib/doc/main.js"></script>
+  </body>
+</html>

+ 21 - 0
database/config.php

@@ -125,6 +125,27 @@ return array
 			'update'	=> 'editor',
 			//'strip'		=> false,//默认是开启strip_tags过滤的,这里可以加上这个来取消过滤
 		),
+
+		'help_title'		=> array
+		(
+			'type' 		=> 'varchar-32',
+			'name' 		=> '帮助标题',
+			'default' 	=> '帮助标题',
+			'desc' 		=> '帮助标题',
+			'match' 	=> 'option',
+			'update'	=> 'text',
+		),
+		
+		'help_info'		=> array
+		(
+			'type' 		=> 'varchar-800',
+			'name' 		=> '帮助介绍',
+			'default' 	=> '默认帮助介绍',
+			'desc' 		=> '帮助介绍',
+			'match' 	=> 'option',
+			'update'	=> 'textarea',
+		),
+
 		'state'		=> array
 		(
 			'type' 		=> 'tinyint-1',

+ 166 - 0
database/help.php

@@ -0,0 +1,166 @@
+<?php
+/*
+|--------------------------------------------------------------------------
+| admin.php 管理员表
+|--------------------------------------------------------------------------
+*/
+# 定义几个常用的选项
+$option = array
+(
+    1 => '启用',
+    2 => '关闭',
+);
+
+$config = function()
+{
+    return Dever::load('manage/config-all');
+};
+
+return array
+(
+    # 表名
+    'name' => 'help',
+    # 显示给用户看的名称
+    'lang' => '帮助管理',
+    'order' => 6,
+    # 数据结构
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'list'      => true,
+            'order'     => 'desc',
+        ),
+        
+        'name'      => array
+        (
+            'type'      => 'varchar-32',
+            'name'      => '帮助标题',
+            'default'   => '',
+            'desc'      => '请输入帮助标题',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            //'autocomplete' => 'auth.role?json=1',
+            'search'    => 'order,fulltext',
+            'list'      => true,
+        ),
+        
+        'config'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '后台配置',
+            'default'   => '1',
+            'desc'      => '请选择后台配置',
+            'match'     => 'is_numeric',
+            'option'    => $config,
+            'update'    => 'select',
+            'list'      => true,
+        ),
+
+        'reorder'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '排序(数值越大越靠前)',
+            'default'   => '1',
+            'desc'      => '请输入排序',
+            'match'     => 'option',
+            'update'    => 'text',
+            'search'    => 'order',
+            'list'      => true,
+            'order'     => 'desc',
+        ),
+
+        'video'     => array
+        (
+            'type'      => 'varchar-800',
+            'name'      => '帮助视频-视频格式mp4,上传大小不能超过4G',
+            'default'   => '',
+            'desc'      => '帮助视频',
+            'match'     => 'option',
+            'update'    => 'video',
+            'key'       => '3',
+            'place'     => '150',
+            'upload'    => 'yun',
+            'large'     => true,
+            //'cover'     => 'pic',//封面图字段名
+        ),
+        
+        'content'       => array
+        (
+            'type'      => 'text-255',
+            'name'      => '内容',
+            'default'   => '',
+            'desc'      => '请输入内容',
+            'match'     => 'option',
+            'update'    => 'editor',
+            //'list'        => true,
+            'key'       => 1,
+        ),
+        
+        'state'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '请选择状态',
+            'match'     => 'is_numeric',
+            
+        ),
+        
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '录入时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+            'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+    
+    'manage' => array
+    (
+        # 增加批量更新功能,根据哪个字段批量更新
+        'update_mul' => 'name',
+    ),
+    
+    # request 请求接口定义
+    'request' => array
+    (
+        # 根据配置id获取notice
+        'getAll' => array
+        (
+            # 匹配的正则或函数 必填项
+            'where' => array
+            (
+                //'username' => '/^([A-Za-z0-9])/',
+                'config' => 'yes',
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'order' => array('id' => 'desc'),
+            'limit' => '0,5',
+            'col' => '*',
+        ),
+        
+        # 根据配置id和notice Id获取
+        'getOne' => array
+        (
+            'type' => 'one',
+            'where' => array
+            (
+                'id' => 'yes',
+                'config' => 'yes',
+                'state' => 1,
+            ),
+            'input' => true,
+        ),
+    ),
+);

+ 38 - 0
src/Help.php

@@ -0,0 +1,38 @@
+<?php
+namespace Manage\Src;
+
+use Dever;
+
+class Help
+{
+    private $data;
+
+    public function config()
+    {
+        $id = Dever::input('id', 1);
+        $config = Dever::db('manage/config')->find($id);
+        return $config;
+    }
+
+    public function doc()
+    {
+        return $this->doc;
+    }
+
+    public function menu()
+    {
+        $where['config'] = Dever::input('id', 1);
+
+        $data = Dever::db('manage/help')->select($where);
+
+        if ($data) {
+            foreach ($data as $k => $v) {
+                if ($v['video']) {
+                    $data[$k]['content'] = '<p><video width="100%" height="100%" src="'.$v['video'].'" controls="controls">您的浏览器不支持 video 标签。</video></p>' . $v['content'];
+                }
+            }
+        }
+
+        return $data;
+    }
+}

+ 60 - 0
template/layadmin/doc/help.php

@@ -0,0 +1,60 @@
+<?php
+/*
+|--------------------------------------------------------------------------
+| home
+|--------------------------------------------------------------------------
+*/
+
+
+$view
+
+->set('config', 'manage/help.config')
+->set('menu', 'manage/help.menu')
+
+->fetch('#top h1', 'config#help_title')
+
+->fetch('#top p', 'config#help_info')
+
+->loop
+( 
+    '.bs-docs-sidenav li', 
+    'menu',
+    array  
+    (
+        'a' => array
+        (
+            'href' => '#show-<{$k}>',
+            'html' => '<{$v.name}>',
+        ),
+    )
+)
+
+->loop
+( 
+    '.bs-docs-section', 
+    'menu',
+    array  
+    (
+        'h1' => array
+        (
+            'id' => 'show-<{$k}>',
+            'span' => array
+            (
+                'html' => '<{$v.name}>',
+            )
+        ),
+
+        '.anchorjs-link|0' => array
+        (
+            'href' => '#show-<{$k}>',
+        ),
+
+        'div|0' => array
+        (
+            'html' => '<{$v.content}>',
+        ),
+    )
+)
+
+# display
+->display();