国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
5.7KB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  6. <title>修改自定义表单字段</title>
  7. <link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
  8. <link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
  9. <link rel="stylesheet" href="../static/web/css/admin.css">
  10. <script src="../static/web/js/jquery.min.js"></script>
  11. <script src="../static/web/js/bootstrap.min.js"></script>
  12. <script src="js/main.js"></script>
  13. <style>.nw{float:left;width:160px}.cls{clear:both}</style>
  14. </head>
  15. <body>
  16. <form name="form1" action="diy_field_edit.php" method="post" onSubmit="return GetFields();">
  17. <input type="hidden" name="action" value="save">
  18. <input type="hidden" name="diyid" value="<?php echo $diyid?>">
  19. <input type="hidden" name="fname" value="<?php echo $fname?>">
  20. <input type="hidden" name="issystem" value="<?php echo $issystem?>">
  21. <input type="hidden" name="fieldstring" value="">
  22. <table align="center" class="table maintable my-3">
  23. <tr>
  24. <td bgcolor="#f5f5f5" colspan="2">自定义表单管理</a> &gt; 自定义表单修改字段</td>
  25. </tr>
  26. <tr>
  27. <td>提示文字:</td>
  28. <td>
  29. <input type="text" name="itemname" id="itemname" class="admin-input-sm" value="<?php echo $ctag->GetAtt('itemname')?>">
  30. <span>(发布表单时显示的项名字)</span>
  31. </td>
  32. </tr>
  33. <tr>
  34. <td width="260">字段名称:</td>
  35. <td><?php echo $fname?>(只能用英文字母或数字,数据表的真实字段名)</td>
  36. </tr>
  37. <tr>
  38. <td>数据类型:</td>
  39. <td>
  40. <select name="dtype" id="type" class="admin-input-sm">
  41. <?php
  42. $dtype = $ctag->GetAtt('type');
  43. if ($dtype!='' && isset($fieldtypes[$dtype])) {
  44. echo "<option value='{$dtype}'>{$fieldtypes[$dtype]}</option>";
  45. $canchange = true;
  46. } else {
  47. echo "<option value='{$dtype}'>系统专用类型</option>";
  48. $canchange = false;
  49. }
  50. if ($canchange) {
  51. ?>
  52. <option value="text">单行文本(varchar)</option>
  53. <option value="textchar">单行文本(char)</option>
  54. <option value="multitext">多行文本</option>
  55. <option value="htmltext">网页文本</option>
  56. <option value="int">整数类型</option>
  57. <option value="float">小数类型</option>
  58. <option value="datetime">时间类型</option>
  59. <option value="select">option下拉框</option>
  60. <option value="radio">radio选项卡</option>
  61. <option value="checkbox">checkbox多选框</option>
  62. <?php }?>
  63. </select>
  64. </td>
  65. </tr>
  66. <tr>
  67. <td>文档是否需要分页符:</td>
  68. <td>
  69. <input type="hidden" name="isnull" value="1">
  70. <label><input type="radio" name="spage" value="split" <?php if ($ctag->GetAtt('page')=='split') echo "checked='1'";?>> 是</label>
  71. <label><input type="radio" name="spage" value="no" <?php if ($ctag->GetAtt('page')=='no'||$ctag->GetAtt('page')=='') echo "checked='1'";?>> 否</label>
  72. <span>(如果文档需要分页符,不论何种文档,都可以用#p#副标题#e#作为分页符号实现文档分页,但一个模型里仅允许一个这样的字段)</span>
  73. </td>
  74. </tr>
  75. <tr>
  76. <td>默认值:</td>
  77. <td>
  78. <p>(如果定义数据类型为select、radio、checkbox时,此处填写被选择的项目,英文逗号分开,如“DedeBIZ,得德”。如果为联动选框,这里填写联动选框项目名称)</p>
  79. <textarea name="vdefault" id="vdefault" class="admin-textarea-xl"><?php echo $ctag->GetAtt('default');?></textarea>
  80. </td>
  81. </tr>
  82. <tr>
  83. <td>自定义网页表单:</td>
  84. <td>
  85. <p>(自定义网页表单用~name~表示提示文字,~form~表示表单元素)</p>
  86. <textarea name="vinnertext" id="vinnertext" class="admin-textarea-xl"><?php echo $ctag->GetInnerText();?></textarea>
  87. </td>
  88. </tr>
  89. <tr>
  90. <td>最大长度:</td>
  91. <td>
  92. <input type="text" name="maxlength" id="maxlength" class="admin-input-xs" value="<?php echo $ctag->GetAtt('maxlength')?>">
  93. <span>(文本数据必须填写,大于255为text类型)</span>
  94. </td>
  95. </tr>
  96. <tr>
  97. <td bgcolor="#f5f5f5" colspan="2" align="center">
  98. <button type="submit" class="btn btn-success btn-sm">保存</button>
  99. <button type="reset" class="btn btn-outline-success btn-sm">重置</button>
  100. </td>
  101. </tr>
  102. </table>
  103. </form>
  104. <script>
  105. function GetFields()
  106. {
  107. var theform = document.form1;
  108. var itemname = theform.itemname.value;
  109. var fieldname = theform.fname.value;
  110. var dtype = theform.dtype.value;
  111. var isnull = theform.isnull.value;
  112. var vdefault = theform.vdefault.value;
  113. var maxlength = theform.maxlength.value;
  114. var vinnertext = theform.vinnertext.value;
  115. var spage = (theform.spage[0].checked ? theform.spage[0].value : theform.spage[1].value);
  116. var sisnull = (isnull==0 ? "false" : "true");
  117. if (itemname=="") {
  118. ShowMsg("表单提示名称不能为空");
  119. theform.itemname.focus();
  120. return false;
  121. }
  122. if ((dtype=="radio"||dtype=="select"||dtype=="checkbox") && vdefault=="") {
  123. ShowMsg("您选择的select或radio、checkbox类型,必须默认值设置选择的项目(用英文逗号)");
  124. return false;
  125. }
  126. if (spage=="no") spage = "";
  127. revalue = "<field:"+fieldname+" itemname=\""+itemname+"\" autofield=\"1\" type=\""+dtype+"\"";
  128. revalue += " isnull=\""+sisnull+"\" default=\""+vdefault+"\" ";
  129. revalue += " maxlength=\""+maxlength+"\" page=\""+spage+"\">"+vinnertext+"</field:"+fieldname+">";
  130. document.form1.fieldstring.value = revalue;
  131. return true;
  132. }
  133. </script>
  134. </body>
  135. </html>