国内流行的内容管理系统(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.

133 lines
5.5KB

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