123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- <?php
- # 定义几个常用的选项
- $option = array
- (
- 1 => '显示',
- 2 => '不显示',
- );
- # 显示类型
- $type = array
- (
- # 固定的类型和数据
- 1 => '发布新主题',
- 2 => '主题列表-简约',
- 3 => '主题列表-详细',
- 4 => '栏目列表',
- 5 => '友情链接',
- 6 => '统计信息',
- //7 => '会员列表',
- //8 => '会员详情',
- # 自定义数据
- 31 => '固定描述',
- 32 => '随机描述',
- 33 => '提醒信息',
- # 自定义类型和数据
- //51 => '自定义列表',
- );
- # 是否显示模块标题
- $title = array
- (
- 1 => '显示标题',
- 2 => '不显示标题',
- );
- # 标题的位置
- $align = array
- (
- 1 => '左侧',
- 2 => '居中',
- 3 => '右侧',
- );
- # 显示的位置
- $position = array
- (
- 1 => '页面右侧',
- 2 => '页面底部',
- 3 => '页面顶部',
- );
- # 显示的页面
- $page = function()
- {
- $page = Dever::load('main/page-all');
- return $page;
- };
- # 栏目
- $cate = function()
- {
- $array = array
- (
- -1 => array('id' => '-1', 'name' => '所有栏目'),
- );
- $cate = Dever::load('forum/cate.all');
- if($cate)
- {
- $array += $cate;
- }
- return $array;
- };
- # 主题读取规则
- $rule = function()
- {
- $array = array
- (
- -1 => array('id' => '-1', 'name' => '根据参数变化'),
- );
- $data = Dever::load('forum/type-all');
- if($data)
- {
- $array += $data;
- }
- return $array;
- };
- return array
- (
- # 表名
- 'name' => 'model',
- # 显示给用户看的名称
- 'lang' => '模块管理',
- 'order' => 6,
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => '模块ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- //'search' => 'order',
- 'order' => 'desc',
- //'list' => true,
- ),
-
- 'name' => array
- (
- 'type' => 'varchar-60',
- 'name' => '模块标题',
- 'default' => '',
- 'desc' => '请输入模块标题',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- 'edit' => true,
- ),
-
- 'page' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '显示的页面',
- 'default' => Dever::input('search_option_page', '1'),
- 'desc' => '请选择显示的页面',
- 'match' => 'is_numeric',
- 'option' => $page,
- 'update' => 'radio',
- 'search' => 'select',
- 'list' => true,
- 'edit' => true,
- ),
-
- 'title' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '是否显示模块标题',
- 'default' => '1',
- 'desc' => '请选择是否显示模块标题',
- 'match' => 'is_numeric',
- 'option' => $title,
- 'update' => 'radio',
- //'list' => true,
- ),
-
- 'align' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '模块标题显示位置',
- 'default' => '1',
- 'desc' => '请选择模块标题显示位置',
- 'match' => 'is_numeric',
- 'option' => $align,
- 'update' => 'radio',
- //'list' => true,
- //'edit' => true,
- ),
- 'position' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '显示位置',
- 'default' => '1',
- 'desc' => '请选择显示位置',
- 'match' => 'is_numeric',
- 'option' => $position,
- 'update' => 'radio',
- 'search' => 'select',
- 'list' => true,
- 'edit' => true,
- ),
- 'cate_id' => array
- (
- 'type' => 'int-11',
- 'name' => '栏目-如果选择了某个栏目,如果显示在列表页,则本模块只在该栏目中出现,如果是首页,则显示该栏目下的数据',
- 'default' => '-1',
- 'desc' => '请选择栏目',
- 'match' => 'is_numeric',
- 'search' => 'group',
- 'update' => 'group',
- 'option' => $cate,
- 'list' => true,
- 'edit' => true,
- ),
- 'type' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '显示类型',
- 'default' => '1',
- 'desc' => '请选择显示类型',
- 'match' => 'is_numeric',
- 'option' => $type,
- 'update' => 'radio',
- 'show' => 'type',
- 'search' => 'select',
- 'list' => true,
- ),
-
- 'rule' => array
- (
- 'type' => 'int-11',
- 'name' => '读取规则',
- 'default' => '1',
- 'desc' => '请选择读取规则',
- 'match' => 'is_numeric',
- //'search' => 'select',
- 'update' => 'select',
- 'option' => $rule,
- //'list' => true,
- 'show' => array('type_2', 'type_3'),
- ),
-
- 'info' => array
- (
- 'type' => 'text-255',
- 'name' => '固定描述-可以是一段文字,或者是一张图片,超链接请自行添加,如果是随机描述,请用"||"隔开',
- 'default' => '',
- 'desc' => '请输入固定描述',
- 'match' => 'option',
- 'update' => 'editor',
- 'show' => array('type_31','type_32', 'type_33'),
- ),
-
- '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',
- '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})',
- ),
- ),
- );
|