123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- <?php
- # 定义几个常用的选项
- $option = array
- (
- 1 => '显示',
- 2 => '不显示',
- );
- $target = array
- (
- '_blank' => '是',
- '_self' => '否',
- );
- $time = time();
- return array
- (
- # 表名
- 'name' => 'menu',
- # 显示给用户看的名称
- 'lang' => '菜单管理',
- # 后台菜单排序
- 'order' => 9,
- # 数据结构
- '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',
- 'search' => 'fulltext',
- 'list' => true,
- ),
- 'key' => array
- (
- 'type' => 'varchar-32',
- 'name' => '菜单key-对应前台的选中效果',
- 'default' => '',
- 'desc' => '菜单key',
- 'match' => 'is_string',
- 'update' => 'text',
- 'list' => true,
- ),
- 'icon' => array
- (
- 'type' => 'varchar-150',
- 'name' => '图标-宽度为150的图片',
- 'default' => '',
- 'desc' => '请选择图标',
- 'match' => 'option',
- 'update' => 'image',
- 'key' => '1',
- 'place' => '150',
- ),
- 'link' => array
- (
- 'type' => 'text-200',
- 'name' => '链接',
- 'default' => '',
- 'desc' => '请输入链接',
- 'match' => 'option',
- 'update' => 'textarea',
- ),
-
- 'target' => array
- (
- 'type' => 'varchar-24',
- 'name' => '打开新页面',
- 'default' => '_self',
- 'desc' => '打开新页面',
- 'match' => 'option',
- 'option' => $target,
- 'update' => 'radio',
- //'list' => true,
- ),
-
- 'reorder' => array
- (
- 'type' => 'int-11',
- 'name' => '排序(数值越大越靠前)',
- 'default' => '1',
- 'desc' => '请输入排序',
- 'match' => 'option',
- 'update' => 'text',
- 'search' => 'order',
- 'list' => true,
- 'order' => 'desc',
- 'edit' => true,
- ),
- 'state' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '状态',
- 'default' => '1',
- 'desc' => '请选择状态',
- 'match' => 'is_numeric',
- 'option' => $option,
- 'update' => 'radio',
- ),
-
- 'cdate' => array
- (
- 'type' => 'int-11',
- 'name' => '录入时间',
- 'match' => array('is_numeric', $time),
- 'desc' => '',
- # 只有insert时才生效
- 'insert' => true,
- 'list' => 'date("Y-m-d H:i:s", {cdate})',
- ),
- ),
- # 默认值
- 'default' => array
- (
- 'col' => 'name,`key`,icon,link,reorder,target,state,cdate',
- 'value' => array
- (
- '"领任务", "task", "ico-gettask", "'. Dever::url("task/list", 'main') . '",10, "_self",1,' . $time,
- '"我的任务", "user_task", "ico-task", "'. Dever::url("user/task", 'main') . '",9, "_self",1,' . $time,
- '"我的账户", "user", "ico-account", "'. Dever::url("user/account", 'main') . '",8, "_self",1,' . $time,
- ),
- ),
- );
|