123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- <?php
- /*
- |--------------------------------------------------------------------------
- | config.php 后台配置信息
- |--------------------------------------------------------------------------
- */
- # 定义几个常用的选项
- $option = array
- (
- 1 => '启用',
- 2 => '失效',
- );
- # 定义图片选择器的内容 key为id,value为显示的样式
- $template = array
- (
- 1 => '<span class="color theme-1"></span>',
- 2 => '<span class="color theme-2"></span>',
- 3 => '<span class="color theme-3"></span>',
- 4 => '<span class="color theme-4"></span>',
- 5 => '<span class="color theme-5"></span>',
- 6 => '<span class="color theme-6"></span>',
- 7 => '<span class="color theme-7"></span>',
- 8 => '<span class="color theme-8"></span>',
- );
- return array
- (
- # 表名
- 'name' => 'config',
- # 显示给用户看的名称
- 'lang' => '平台基础配置',
- 'order' => 10,
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => '配置ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- 'list' => true,
- ),
-
- 'name' => array
- (
- 'type' => 'varchar-32',
- 'name' => '配置名',
- 'default' => '',
- 'desc' => '请输入配置名',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- ),
-
- 'template' => array
- (
- 'type' => 'int-1',
- 'name' => '后台模板',
- 'default' => '1',
- 'desc' => '请选择后台模板',
- 'match' => 'is_numeric',
- 'option' => $template,
- 'update' => 'selector',//图片选择器 注意跟select/radio不同哦
- ),
-
- 'title' => array
- (
- 'type' => 'varchar-32',
- 'name' => '后台title',
- 'default' => '',
- 'desc' => '请输入后台title',
- 'match' => 'option',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- ),
-
- 'info' => array
- (
- 'type' => 'varchar-40',
- 'name' => '控制台欢迎标题',
- 'default' => '',
- 'desc' => '请输入控制台欢迎标题',
- 'match' => 'option',
- 'update' => 'text',
- ),
-
- 'content' => array
- (
- 'type' => 'text-255',
- 'name' => '控制台欢迎内容',
- 'default' => '',
- 'desc' => '请输入控制台欢迎内容',
- 'match' => 'option',
- 'update' => 'editor',
- ),
- 'state' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '状态',
- 'default' => '1',
- 'desc' => '请选择状态',
- 'match' => 'is_numeric',
- 'option' => $option,
- 'update' => 'radio',
- 'list' => true,
- ),
-
- 'cdate' => array
- (
- 'type' => 'int-11',
- 'name' => '录入时间',
- 'match' => array('is_numeric', time()),
- 'desc' => '',
- # 只有insert时才生效
- 'insert' => true,
- 'list' => 'date("Y-m-d H:i:s", {cdate})',
- ),
- ),
-
- # 更新表结构
- 'alter' => array
- (
- 1 => array
- (
- array('add', 'info', 'info', 'varchar-40 控制台欢迎标题'),
- array('add', 'content', 'content', 'text-255 控制台欢迎内容'),
- ),
-
- 2 => array
- (
- array('add', 'template', 'template', 'int-1 1 模板'),
- ),
- 'version' => 2,
- ),
- # 默认值
- 'default' => array
- (
- 'col' => 'name,state,cdate',
- 'value' => array
- (
- '"默认配置",1,' . time(),
- ),
- ),
- # request 请求接口定义
- 'request' => array
- (
- # all 取所有数据
- 'all' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'name' => 'yes',
- ),
- 'type' => 'all',
- 'order' => array('id', 'desc'),
- 'col' => '*|id',
- ),
-
- # 取一条正常的数据
- 'info' => array
- (
- # 匹配的正则或函数 选填项
- 'where' => array
- (
- 'id' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'one',
- ),
- ),
- );
|