123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- <?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>',
- );
- $selector = 'selector';
- /*
- if(Dever::$global['base'] != 'default')
- {
- $selector = 'hidden';
- }
- */
- return array
- (
- # 表名
- 'name' => 'config',
- # 显示给用户看的名称
- 'lang' => '后台配置',
- 'order' => 70,
- 'info' => '后台配置设置之后,每个后台账户会根据该配置展示信息',
- # 数据结构
- '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,
- 'edit' => true,
- ),
- # 测试关联其他表字段 项目-表-字段 这里仅仅是测试
- /*
- 'manage-admin-username' => array
- (
- # 必填,两个表之间的关联字段,第一个为当前表的,第二个为关联表的
- 'sync' => array('id', 'config'),
- 'default' => '',
- 'name' => '管理员',
- 'desc' => '管理员',
- 'match' => 'option',
- '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',
- //'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',
- '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,
- ),
- */
- 'manage' => array
- (
- 'link' => 'parent=config',
- 'button' => array
- (
- '后台公告' => array('list', 'notice'),
- '后台帮助' => array('list', 'help'),
- ),
- ),
- # 默认值
- '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',
- ),
- ),
- );
|