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

152 lines
6.6KB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="<?php echo $cfg_soft_lang;?>">
  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.bundle.min.js"></script>
  12. <script src="js/main.js"></script>
  13. <style>.nw{float:left;width:160px}.cls{clear:both}</style>
  14. <script>
  15. function GetFields()
  16. {
  17. var theform = document.form1;
  18. var itemname = theform.itemname.value;
  19. var fieldname = theform.fname.value;
  20. var dtype = theform.dtype.value;
  21. var isnull = theform.isnull.value;
  22. var vdefault = theform.vdefault.value;
  23. var maxlength = theform.maxlength.value;
  24. var vinnertext = theform.vinnertext.value;
  25. var spage = (theform.spage[0].checked ? theform.spage[0].value : theform.spage[1].value);
  26. var sisnull = (isnull==0 ? "false" : "true");
  27. if (itemname=="")
  28. {
  29. ShowMsg("表单提示名称不能为空");
  30. theform.itemname.focus();
  31. return false;
  32. }
  33. if ((dtype=="radio"||dtype=="select"||dtype=="checkbox") && vdefault=="")
  34. {
  35. ShowMsg("您选择的select或radio、checkbox类型,必须默认值设置选择的项目(用英文逗号)");
  36. return false;
  37. }
  38. if (spage=="no") spage = "";
  39. revalue = "<field:"+fieldname+" itemname=\""+itemname+"\" autofield=\"1\" type=\""+dtype+"\"";
  40. revalue += " isnull=\""+sisnull+"\" default=\""+vdefault+"\" ";
  41. revalue += " maxlength=\""+maxlength+"\" page=\""+spage+"\">"+vinnertext+"</field:"+fieldname+">";
  42. document.form1.fieldstring.value = revalue;
  43. return true;
  44. }
  45. </script>
  46. </head>
  47. <body>
  48. <table width="98%" cellpadding="1" cellspacing="1" align="center" class="table maintable my-3">
  49. <form name="form1" action="diy_field_edit.php" method="post" onSubmit="return GetFields();">
  50. <input type="hidden" name="action" value="save">
  51. <input type="hidden" name="diyid" value="<?php echo $diyid?>">
  52. <input type="hidden" name="fname" value="<?php echo $fname?>">
  53. <input type="hidden" name="issystem" value="<?php echo $issystem?>">
  54. <input type="hidden" name="fieldstring" value="">
  55. <tr>
  56. <td bgcolor="#f5f5f5" colspan="2">
  57. <table width="98%" cellspacing="0" cellpadding="0" class="table table-borderless">
  58. <tr>
  59. <td width="30%"><a href="diy_main.php">自定义表单管理</a> &gt; 修改字段</td>
  60. <td width="70%" align="right"><button type="button" name="ss1" onClick="location='diy_edit.php?diyid=<?php echo $diyid;?>&dopost=edit';" class="btn btn-success btn-sm">当前表单信息</button></td>
  61. </tr>
  62. </table>
  63. </td>
  64. </tr>
  65. <tr>
  66. <td>表单提示文字:<br>
  67. <span>发布内容时显示的提示文字</span></td>
  68. <td><input type="text" name="itemname" id="itemname" value="<?php echo $ctag->GetAtt('itemname')?>"> *(发布内容时显示的项名字)</td>
  69. </tr>
  70. <tr>
  71. <td width="28%">字段名称:<br>
  72. <span>只能用英文字母或数字,数据表的真实字段名</span></td>
  73. <td width="72%" style="table-layout:fixed;word-break:break-all"><?php echo $fname?></td>
  74. </tr>
  75. <tr>
  76. <td>数据类型:</td>
  77. <td>
  78. <select name="dtype" id="type" class="biz-input-md">
  79. <?php
  80. $dtype = $ctag->GetAtt('type');
  81. if ($dtype!='' && isset($fieldtypes[$dtype]))
  82. {
  83. echo "<option value='{$dtype}'>{$fieldtypes[$dtype]}</option>";
  84. $canchange = true;
  85. } else {
  86. echo "<option value='{$dtype}'>系统专用类型</option>";
  87. $canchange = false;
  88. }
  89. if ($canchange)
  90. {
  91. ?>
  92. <option value="text">单行文本(varchar)</option>
  93. <option value="textchar">单行文本(char)</option>
  94. <option value="multitext">多行文本</option>
  95. <option value="htmltext">HTML文本</option>
  96. <option value="int">整数类型</option>
  97. <option value="float">小数类型</option>
  98. <option value="datetime">时间类型</option>
  99. <option value="img">图片</option>
  100. <option value="addon">附件类型</option>
  101. <option value="select">使用option下拉框</option>
  102. <option value="radio">使用radio选项卡</option>
  103. <option value="checkbox">checkbox多选框</option>
  104. <?php
  105. }
  106. ?>
  107. </select>
  108. </td>
  109. </tr>
  110. <tr>
  111. <td>内容是否需要分页符:<br>
  112. <span>如果内容需要分页符,不论何种内容,都可以用#P#副标题#e#作为分页符号实现内容分页,但一个模型里仅允许一个这样的字段!</span></td>
  113. <td>
  114. <input type="hidden" name="isnull" value="1">
  115. <label><input type="radio" name="spage" value="split" <?php if ($ctag->GetAtt('page')=='split') echo "checked='1'";?>> 是</label>
  116. <label><input type="radio" name="spage" value="no" <?php if ($ctag->GetAtt('page')=='no'||$ctag->GetAtt('page')=='') echo "checked='1'";?>> 否</label>
  117. </td>
  118. </tr>
  119. <tr>
  120. <td>默认值:<br>
  121. <span> 如果定义数据类型为select、radio、checkbox时,此处填写被选择的项目(英文逗号分开,如“天涯,叙述”)如果为联动选框,这里填写联动选框项目名称</span></td>
  122. <td><textarea name="vdefault" id="vdefault" class="biz-textarea"><?php echo $ctag->GetAtt('default');?></textarea></td>
  123. </tr>
  124. <tr>
  125. <td>最大长度:<br>
  126. <span> 文本数据必须填写,大于255为text类型 </span></td>
  127. <td><input type="text" name="maxlength" id="maxlength" value="<?php echo $ctag->GetAtt('maxlength')?>"></td>
  128. </tr>
  129. <tr>
  130. <td>自定义表单HTML:</td>
  131. <td>自定义表单HTML用~name~表示提示文字,~form~表示表单元素</td>
  132. </tr>
  133. <tr>
  134. <td align="center"></td>
  135. <td><textarea name="vinnertext" id="vinnertext" class="biz-textarea"><?php echo $ctag->GetInnerText();?></textarea></td>
  136. </tr>
  137. <tr>
  138. <td colspan="2" bgcolor="#f5f5f5">
  139. <table width="100%" cellspacing="0" cellpadding="0" class="table table-borderless mb-3">
  140. <tr>
  141. <td align="center" class="py-2">
  142. <button type="submit" class="btn btn-success btn-sm">保存</button>
  143. <button type="reset" class="btn btn-success btn-sm">重置</button>
  144. </td>
  145. </tr>
  146. </table>
  147. </td>
  148. </tr>
  149. </form>
  150. </table>
  151. </body>
  152. </html>