123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- <?php
- # 定义几个常用的选项
- $option = array
- (
- 1 => '显示',
- 2 => '不显示',
- );
- $parent = function()
- {
- $param['option_page_id'] = -1;
- $info = Dever::db('module/page')->all($param);
- $array = array(-1 => array('name' => '无'));
- if ($info) {
- $array += $info;
- }
- return $array;
- };
- $time = time();
- return array
- (
- # 表名
- 'name' => 'page',
- # 显示给用户看的名称
- 'lang' => '页面管理',
- # 后台菜单排序
- 'order' => 9,
- 'check' => 'key',
- # 数据结构
- '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' => 'order,fulltext',
- 'list' => true,
- //'list' => '"<a href=\"".Dever::load("main/data.page", {id})."\" target=\"_blank\">{name}</a>"',
- ),
- 'key' => array
- (
- 'type' => 'varchar-60',
- 'name' => '页面标识',
- 'default' => '',
- 'desc' => '页面标识',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- ),
- 'page_id' => array
- (
- 'type' => 'int-11',
- 'name' => '父级页面',
- 'default' => Dever::input('page_id', '-1'),
- 'desc' => '请选择父级页面id',
- 'match' => 'is_numeric',
- 'option' => $parent,
- 'update' => 'select',
- 'search' => 'select',
- //'list' => true,
- ),
- 'reorder' => array
- (
- 'type' => 'int-11',
- 'name' => '排序(数值越大越靠前)',
- 'default' => '1',
- 'desc' => '请输入排序',
- 'match' => 'option',
- 'update' => 'text',
- 'search' => 'order',
- 'list_name' => '排序',
- 'list' => true,
- 'order' => 'desc',
- 'edit' => true,
- ),
- '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
- (
- 'list_type' => 'parent',
- 'list_button' => array
- (
- 'addPage' => array('新增子页面', '"page&page_id={id}"', '{page_id} == -1'),
- 'add' => array('新增模块', '"info&project=module&search_option_page_id={id}&oper_parent=page&oper_project=module"', '{page_id} > -1'),
- 'list' => array('模块列表', '"info&project=module&search_option_page_id={id}&oper_parent=page&oper_project=module"', '{page_id} > -1'),
- ),
- ),
- # 默认值
- 'default' => array
- (
- 'col' => 'id,name,state,cdate',
- 'value' => array
- (
- '1,"首页",1,' . $time,
- ),
- ),
- # request 请求接口定义
- 'request' => array
- (
- # 获取列表页
- 'getParent' => array
- (
- # 匹配的正则或函数 选填项
- 'where' => array
- (
- 'page_id' => -1,
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('reorder' => 'desc'),
- 'col' => '*',
- ),
- 'getChild' => array
- (
- # 匹配的正则或函数 选填项
- 'where' => array
- (
- 'page_id' => array(-1, '>'),
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('reorder' => 'desc'),
- 'col' => '*|page_id|id|',
- ),
- ),
- );
|