node.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | opt.php 记录字段的表
  5. |--------------------------------------------------------------------------
  6. */
  7. # 定义几个常用的选项
  8. $option = array
  9. (
  10. 1 => '显示',
  11. 2 => '不显示',
  12. );
  13. $info = Dever::load('manage/project.get');
  14. $path = $info['manage']['path'];
  15. if(isset($info['manage']['setup']))
  16. {
  17. $path = $info['manage']['setup'];
  18. }
  19. # 获取project
  20. $project = function() use ($info)
  21. {
  22. $data = array();
  23. foreach($info as $k => $v)
  24. {
  25. $k = $v['lib'];
  26. $data[$k]['id'] = $v['name'];
  27. $data[$k]['name'] = $v['lang'];
  28. }
  29. return $data;
  30. };
  31. return array
  32. (
  33. # 表名
  34. 'name' => 'node',
  35. # 显示给用户看的名称
  36. 'lang' => '节点记录表',
  37. 'menu' => false,
  38. 'desc' => Dever::markdown('**本表记录所有模板用到的html节点:**
  39. 1. 请点击更新节点,获取最新的节点列表。
  40. 2. 根据本记录表的内容,可以方便的开发一套新的模板。'),
  41. # 数据结构
  42. 'struct' => array
  43. (
  44. 'id' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => 'ID',
  48. 'default' => '',
  49. 'desc' => '',
  50. 'match' => 'is_numeric',
  51. 'search' => 'order',
  52. //'list' => true,
  53. ),
  54. 'project' => array
  55. (
  56. 'type' => 'varchar-30',
  57. 'name' => '项目',
  58. 'default' => '',
  59. 'desc' => '请选择项目',
  60. 'match' => 'is_string',
  61. 'update' => 'select',
  62. 'search' => 'select',
  63. 'option' => $project,
  64. 'list' => true,
  65. ),
  66. 'service' => array
  67. (
  68. 'type' => 'varchar-32',
  69. 'name' => '模板业务-请输入模板业务',
  70. 'default' => '',
  71. 'desc' => '请选择模板业务',
  72. 'match' => 'is_string',
  73. 'update' => 'text',
  74. 'search' => 'fulltext',
  75. 'list' => true,
  76. ),
  77. 'template' => array
  78. (
  79. 'type' => 'varchar-255',
  80. 'name' => '模板名',
  81. 'default' => '',
  82. 'desc' => '请输入模板名',
  83. 'match' => 'is_string',
  84. 'update' => 'text',
  85. 'search' => 'fulltext',
  86. 'list' => true,
  87. ),
  88. 'key' => array
  89. (
  90. 'type' => 'varchar-500',
  91. 'name' => '节点标识',
  92. 'default' => '',
  93. 'desc' => '请输入节点标识',
  94. 'match' => 'is_string',
  95. 'update' => 'text',
  96. 'search' => 'fulltext',
  97. 'list' => true,
  98. ),
  99. 'value' => array
  100. (
  101. 'type' => 'text-255',
  102. 'name' => '节点的值',
  103. 'default' => '',
  104. 'desc' => '节点的值',
  105. 'match' => 'is_string',
  106. 'update' => 'text',
  107. 'list' => true,
  108. ),
  109. 'state' => array
  110. (
  111. 'type' => 'tinyint-1',
  112. 'name' => '数据是否存在',
  113. 'default' => '1',
  114. 'desc' => '请选择数据是否存在',
  115. 'match' => 'is_numeric',
  116. 'option' => $option,
  117. 'update' => 'radio',
  118. //'list' => true,
  119. ),
  120. 'cdate' => array
  121. (
  122. 'type' => 'int-11',
  123. 'name' => '录入时间',
  124. 'match' => array('is_numeric', time()),
  125. 'desc' => '',
  126. # 只有insert时才生效
  127. 'insert' => true,
  128. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  129. ),
  130. ),
  131. 'manage' => array
  132. (
  133. 'edit' => false,
  134. 'insert' => false,
  135. 'button' => array
  136. (
  137. '更新节点' => 'manage/node.update',
  138. )
  139. ),
  140. );