|
@@ -0,0 +1,330 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+$curPage = Dever::input('search_option_page_id');
|
|
|
+
|
|
|
+
|
|
|
+$page = function()
|
|
|
+{
|
|
|
+ $parent = Dever::db('module/page')->getParent();
|
|
|
+ $child = Dever::db('module/page')->getChild();
|
|
|
+ foreach ($parent as $k => $v) {
|
|
|
+ $parent[$k]['child'] = $child[$v['id']];
|
|
|
+ }
|
|
|
+
|
|
|
+ $array = array(-1 => array('id' => -1, 'name' => '无'));
|
|
|
+
|
|
|
+ if ($parent) {
|
|
|
+ $array += $parent;
|
|
|
+ }
|
|
|
+
|
|
|
+ return $array;
|
|
|
+};
|
|
|
+
|
|
|
+$type = array
|
|
|
+(
|
|
|
+ 1 => '手动输入',
|
|
|
+ 2 => '调取其他模块',
|
|
|
+ 3 => '预定义方法',
|
|
|
+ 4 => '自定义方法',
|
|
|
+ 5 => '自定义SQL',
|
|
|
+ 6 => '自定义接口',
|
|
|
+);
|
|
|
+
|
|
|
+$define = Dever::config('base')->module;
|
|
|
+
|
|
|
+$col = array
|
|
|
+(
|
|
|
+ 1 => '标题',
|
|
|
+ 2 => '链接',
|
|
|
+ 3 => '图片',
|
|
|
+ 4 => '内容',
|
|
|
+);
|
|
|
+
|
|
|
+$sqlMethod = array
|
|
|
+(
|
|
|
+ 1 => '取多列数据',
|
|
|
+ 2 => '取单列数据',
|
|
|
+ 3 => '取影响行数',
|
|
|
+ 4 => '取生成的ID',
|
|
|
+ 5 => '仅执行',
|
|
|
+);
|
|
|
+
|
|
|
+return array
|
|
|
+(
|
|
|
+
|
|
|
+ 'name' => 'info',
|
|
|
+
|
|
|
+ 'lang' => '模块管理',
|
|
|
+ 'order' => 10,
|
|
|
+ 'check' => 'page_id,key',
|
|
|
+
|
|
|
+ 'struct' => array
|
|
|
+ (
|
|
|
+ 'id' => array
|
|
|
+ (
|
|
|
+ 'type' => 'int-11',
|
|
|
+ 'name' => '模块ID',
|
|
|
+ 'default' => '',
|
|
|
+ 'desc' => '',
|
|
|
+ 'match' => 'is_numeric',
|
|
|
+
|
|
|
+ 'order' => 'desc',
|
|
|
+
|
|
|
+ ),
|
|
|
+
|
|
|
+ 'name' => array
|
|
|
+ (
|
|
|
+ 'type' => 'varchar-60',
|
|
|
+ 'name' => '模块标题',
|
|
|
+ 'default' => '',
|
|
|
+ 'desc' => '请输入模块标题',
|
|
|
+ 'match' => 'is_string',
|
|
|
+ 'update' => 'text',
|
|
|
+ 'search' => 'fulltext',
|
|
|
+ 'list' => true,
|
|
|
+ 'edit' => true,
|
|
|
+ ),
|
|
|
+
|
|
|
+ 'key' => array
|
|
|
+ (
|
|
|
+ 'type' => 'varchar-60',
|
|
|
+ 'name' => '模块标识',
|
|
|
+ 'default' => '',
|
|
|
+ 'desc' => '模块标识',
|
|
|
+ 'match' => 'is_string',
|
|
|
+ 'update' => 'text',
|
|
|
+ 'search' => 'fulltext',
|
|
|
+ 'list' => true,
|
|
|
+ ),
|
|
|
+
|
|
|
+ 'page_id' => array
|
|
|
+ (
|
|
|
+ 'type' => 'tinyint-1',
|
|
|
+ 'name' => '所属的页面',
|
|
|
+ 'default' => Dever::input('search_option_page_id', '1'),
|
|
|
+ 'desc' => '请选择所属的页面',
|
|
|
+ 'match' => 'is_numeric',
|
|
|
+ 'option' => $page,
|
|
|
+ 'update' => 'group',
|
|
|
+ 'search' => 'group',
|
|
|
+ 'list' => 'Dever::load("module/page-one#name", {page_id})',
|
|
|
+
|
|
|
+ ),
|
|
|
+
|
|
|
+ 'num' => array
|
|
|
+ (
|
|
|
+ 'type' => 'int-11',
|
|
|
+ 'name' => '数据总条数-为空或小于0则不限制,只对前台有效',
|
|
|
+ 'default' => '5',
|
|
|
+ 'desc' => '请输入数据总条数',
|
|
|
+ 'match' => 'is_numeric',
|
|
|
+ 'update' => 'text',
|
|
|
+ 'list' => true,
|
|
|
+ 'edit' => true,
|
|
|
+ ),
|
|
|
+
|
|
|
+ 'type' => array
|
|
|
+ (
|
|
|
+ 'type' => 'tinyint-1',
|
|
|
+ 'name' => '模块类型',
|
|
|
+ 'default' => '1',
|
|
|
+ 'desc' => '请选择模块类型',
|
|
|
+ 'match' => 'is_numeric',
|
|
|
+ 'option' => $type,
|
|
|
+ 'update' => 'radio',
|
|
|
+ 'search' => 'select',
|
|
|
+
|
|
|
+ 'control' => 'type',
|
|
|
+ ),
|
|
|
+
|
|
|
+ 'data_type' => array
|
|
|
+ (
|
|
|
+ 'type' => 'varchar-50',
|
|
|
+ 'name' => '数据类型定义-多个用换行隔开,必须有一个值,主要用于该模块有多种不同类型的值',
|
|
|
+ 'default' => '默认类型',
|
|
|
+ 'desc' => '请选择模块类型',
|
|
|
+ 'match' => 'is_string',
|
|
|
+
|
|
|
+
|
|
|
+ ),
|
|
|
+
|
|
|
+ 'code' => array
|
|
|
+ (
|
|
|
+ 'type' => 'varchar-500',
|
|
|
+ 'name' => '自定义内容',
|
|
|
+ 'default' => '',
|
|
|
+ 'desc' => '请输入自定义内容',
|
|
|
+ 'match' => 'is_string',
|
|
|
+ 'update' => 'textarea',
|
|
|
+ 'show' => array('type_4', 'type_5', 'type_6'),
|
|
|
+ ),
|
|
|
+
|
|
|
+ 'sql_method' => array
|
|
|
+ (
|
|
|
+ 'type' => 'tinyint-1',
|
|
|
+ 'name' => '选择sql执行之后的方法',
|
|
|
+ 'default' => '1',
|
|
|
+ 'desc' => '选择sql执行之后的方法',
|
|
|
+ 'match' => 'is_numeric',
|
|
|
+ 'update' => 'radio',
|
|
|
+ 'option' => $sqlMethod,
|
|
|
+ 'show' => array('type_5'),
|
|
|
+ ),
|
|
|
+
|
|
|
+ 'define' => array
|
|
|
+ (
|
|
|
+ 'type' => 'varchar-100',
|
|
|
+ 'name' => '选择预定义方法',
|
|
|
+ 'default' => '',
|
|
|
+ 'desc' => '请选择预定义方法',
|
|
|
+ 'match' => 'is_string',
|
|
|
+ 'update' => 'select',
|
|
|
+ 'option' => $define,
|
|
|
+ 'show' => array('type_3'),
|
|
|
+ ),
|
|
|
+
|
|
|
+ 'col' => array
|
|
|
+ (
|
|
|
+ 'type' => 'varchar-30',
|
|
|
+ 'name' => '启用的字段',
|
|
|
+ 'default' => '1',
|
|
|
+ 'desc' => '请选择启用的字段',
|
|
|
+ 'match' => 'is_string',
|
|
|
+ 'option' => $col,
|
|
|
+ 'update' => 'checkbox',
|
|
|
+ 'show' => array('type_1'),
|
|
|
+ 'control' => 'col',
|
|
|
+ ),
|
|
|
+
|
|
|
+ 'col_pic' => array
|
|
|
+ (
|
|
|
+ 'type' => 'varchar-20',
|
|
|
+ 'name' => '图片尺寸提醒-请直接输入提醒的文字即可,如100X100',
|
|
|
+ 'default' => '100X100',
|
|
|
+ 'desc' => '图片尺寸提醒',
|
|
|
+ 'match' => 'is_string',
|
|
|
+ 'update' => 'text',
|
|
|
+ 'show' => array('col_3'),
|
|
|
+ ),
|
|
|
+
|
|
|
+ 'col_content' => array
|
|
|
+ (
|
|
|
+ 'type' => 'int-11',
|
|
|
+ 'name' => '内容长度限制-必须是数字',
|
|
|
+ 'default' => '30',
|
|
|
+ 'desc' => '内容长度限制',
|
|
|
+ 'match' => 'is_numeric',
|
|
|
+ 'update' => 'text',
|
|
|
+ 'show' => array('col_4'),
|
|
|
+ ),
|
|
|
+
|
|
|
+ 'relate_id' => array
|
|
|
+ (
|
|
|
+ 'type' => 'int-11',
|
|
|
+ 'name' => '请输入模块id',
|
|
|
+ 'default' => '',
|
|
|
+ 'desc' => '请输入模块id',
|
|
|
+ 'match' => 'is_numeric',
|
|
|
+ 'update' => 'text',
|
|
|
+ 'show' => array('type_2'),
|
|
|
+ ),
|
|
|
+
|
|
|
+ 'preview' => array
|
|
|
+ (
|
|
|
+ 'type' => 'varchar-200',
|
|
|
+ 'name' => '模块预览地址',
|
|
|
+ 'default' => '',
|
|
|
+ 'desc' => '模块预览地址',
|
|
|
+ 'match' => 'option',
|
|
|
+ 'update' => 'text',
|
|
|
+ ),
|
|
|
+
|
|
|
+ 'preview_height' => array
|
|
|
+ (
|
|
|
+ 'type' => 'int-11',
|
|
|
+ 'name' => '模块预览的高度',
|
|
|
+ 'default' => '500',
|
|
|
+ 'desc' => '模块预览的高度',
|
|
|
+ 'match' => 'option',
|
|
|
+ 'update' => 'text',
|
|
|
+ ),
|
|
|
+
|
|
|
+ 'reorder' => array
|
|
|
+ (
|
|
|
+ 'type' => 'int-11',
|
|
|
+ 'name' => '排序(数值越大越靠前)',
|
|
|
+ 'default' => '1',
|
|
|
+ 'desc' => '请输入排序',
|
|
|
+ 'match' => 'option',
|
|
|
+ 'update' => 'text',
|
|
|
+ 'search' => 'order',
|
|
|
+ 'list_name' => '排序',
|
|
|
+ 'list' => true,
|
|
|
+ 'order' => 'desc',
|
|
|
+
|
|
|
+ ),
|
|
|
+
|
|
|
+ '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' => true,
|
|
|
+ 'list' => 'date("Y-m-d H:i:s", {cdate})',
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ 'auth' => array
|
|
|
+ (
|
|
|
+
|
|
|
+ 'data' => 'all',
|
|
|
+
|
|
|
+ 'project' => 'module',
|
|
|
+
|
|
|
+ 'project_name' => '模块管理',
|
|
|
+ ),
|
|
|
+ */
|
|
|
+
|
|
|
+ 'manage' => array
|
|
|
+ (
|
|
|
+ 'insert' => $curPage ? true : false,
|
|
|
+ 'list_button' => array
|
|
|
+ (
|
|
|
+ 'add' => array('新增数据', '"data&search_option_info_id={id}&oper_parent=info"', '{type} == 1'),
|
|
|
+
|
|
|
+ 'list' => array('数据列表', '"data&search_option_info_id={id}&oper_parent=info"', '{type} == 1'),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+
|
|
|
+
|
|
|
+ 'request' => array
|
|
|
+ (
|
|
|
+
|
|
|
+ 'getAll' => array
|
|
|
+ (
|
|
|
+
|
|
|
+ 'option' => array
|
|
|
+ (
|
|
|
+ 'type' => 'yes',
|
|
|
+ 'page_id' => 'yes',
|
|
|
+ 'state' => 1,
|
|
|
+ ),
|
|
|
+ 'type' => 'all',
|
|
|
+ 'order' => array('reorder' => 'desc'),
|
|
|
+ 'col' => '*',
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+);
|