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

166 lines
7.1KB

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