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

201 lines
9.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/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. 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. var autofield = (theform.autofield[0].checked ? theform.autofield[0].value : theform.autofield[1].value);
  27. var islist = (theform.islist.checked ? 1 : 0);
  28. var notsend = (theform.notsend.checked ? 1 : 0);
  29. if (itemname == "") {
  30. ShowMsg("表单提示名称不能为空");
  31. theform.itemname.focus();
  32. return false;
  33. }
  34. if ((dtype == "radio" || dtype == "select" || dtype == "checkbox") && vdefault == "") {
  35. ShowMsg("您选择的select或radio、checkbox类型,必须默认值设置选择的项目(用英文逗号分开)");
  36. return false;
  37. }
  38. if (spage == "no") spage = "";
  39. relstr = "";
  40. if (dtype==="relation") {
  41. relstr = " automake=\""+automake+"\" channel=\""+$("#channeltype").val()+"\"";
  42. }
  43. revalue = "<field:" + fieldname + " itemname=\"" + itemname + "\" autofield=\"" + autofield + "\" notsend=\"" + notsend + "\" type=\"" + dtype + "\"";
  44. revalue += relstr + " isnull=\"" + sisnull + "\" islist=\"" + islist + "\" default=\"" + vdefault + "\" ";
  45. revalue += " maxlength=\"" + maxlength + "\" page=\"" + spage + "\">" + vinnertext + "</field:" + fieldname + ">";
  46. document.form1.fieldstring.value = revalue;
  47. return true;
  48. }
  49. $(document).ready(function () {
  50. $("#type").change(function (ele) {
  51. if ($(ele.currentTarget).val() === "relation") {
  52. $("#_relation").show();
  53. } else {
  54. $("#_relation").hide();
  55. }
  56. })
  57. });
  58. </script>
  59. </head>
  60. <body>
  61. <table wcellpadding="1" cellspacing="1" align="center" class="table maintable my-3">
  62. <form name="form1" action="mychannel_field_edit.php" method="post" onSubmit="return GetFields();">
  63. <input type="hidden" name="action" value="save">
  64. <input type="hidden" name="id" value="<?php echo $id?>">
  65. <input type="hidden" name="fname" value="<?php echo $fname?>">
  66. <input type="hidden" name="issystem" value="<?php echo $issystem?>">
  67. <input type="hidden" name="fieldstring" value="">
  68. <tr>
  69. <td bgcolor="#f5f5f5" colspan="2">
  70. <table cellspacing="0" cellpadding="0" class="table table-borderless w-100">
  71. <tr>
  72. <td width="30%"><a href="mychannel_main.php">文档模型管理</a> &gt; 查看修改字段</td>
  73. <td width="70%" align="right">
  74. <button type="button" name="ss1" class="btn btn-success btn-sm" onClick="location='mychannel_edit.php?id=<?php echo $id?>&dopost=edit';">当前模型信息</button>
  75. <button type="button" name="ss12" onClick="location='mychannel_main.php';" class="btn btn-success btn-sm">文档模型管理</button>
  76. </td>
  77. </tr>
  78. </table>
  79. </td>
  80. </tr>
  81. <?php if ($row['issystem']==1) {?>
  82. <tr>
  83. <td colspan="2">
  84. <div class="alert alert-danger mb-0">您当前操作的字段属于系统模型字段:修改系统模型有风险,请不要随便改动系统模型的字段相关的属性</div>
  85. </td>
  86. </tr>
  87. <?php }?>
  88. <tr>
  89. <td>表单提示文字:发布文档时显示的提示文字</td>
  90. <td><input type="text" name="itemname" id="itemname" value="<?php echo $ctag->GetAtt('itemname')?>">(发布文档时显示的项名字)</td>
  91. </tr>
  92. <tr>
  93. <td width="30%">字段名称:只能用英文字母或数字,数据表的真实字段名</td>
  94. <td width="70%" style="table-layout:fixed;word-break:break-all"><?php echo $fname?></td>
  95. </tr>
  96. <tr>
  97. <td>字段类型:</td>
  98. <td>
  99. <label><input type="radio" name="autofield" value="1" checked="checked" <?php echo ($ctag->GetAtt('autofield')==1 ? " checked":"");?>> 系统自动生成表单字段</label>
  100. <label><input type="radio" name="autofield" value="0" <?php echo ( ($ctag->GetAtt('autofield')==''||$ctag->GetAtt('autofield')=='0') ? " checked":"");?>> 已经固化在发布表单中字段</label>
  101. </td>
  102. </tr>
  103. <tr>
  104. <td>前台参数:</td>
  105. <td>
  106. <label><input type="checkbox" name="islist" id="islist" value="1" <?php echo ($ctag->GetAtt('islist')==1 ? " checked":"");?>> 使字段可以在列表的底层模板中获得(自定义字段默认仅能在文档模板显示,启用此选项使列表查询变慢,如无必要请不要选择)</label><br>
  107. <label><input type="checkbox" name="notsend" id="notsend" value="1" <?php echo ($ctag->GetAtt('notsend')==1 ? " checked":"");?>> 前台投稿及采集规则禁用本字段</label>
  108. </td>
  109. </tr>
  110. <tr>
  111. <td>数据类型:</td>
  112. <td>
  113. <select name="dtype" id="type" class="admin-input-md">
  114. <?php
  115. $dtype = $ctag->GetAtt('type');
  116. if ($dtype!='' && isset($fieldtypes[$dtype]))
  117. {
  118. echo "<option value='{$dtype}'>{$fieldtypes[$dtype]}</option>";
  119. $canchange = true;
  120. } else {
  121. echo "<option value='{$dtype}'>系统专用类型</option>";
  122. $canchange = false;
  123. }
  124. if ($canchange)
  125. {
  126. ?>
  127. <option value="text">单行文本(varchar)</option>
  128. <option value="textchar">单行文本(char)</option>
  129. <option value="multitext">多行文本</option>
  130. <option value="htmltext">网页文本</option>
  131. <option value="textdata">文本保存网页数据</option>
  132. <option value="int">整数类型</option>
  133. <option value="float">小数类型</option>
  134. <option value="datetime">时间类型</option>
  135. <option value="img">图片</option>
  136. <option value="imgfile">图片(仅网址)</option>
  137. <option value="media">多媒体文件</option>
  138. <option value="addon">附件类型</option>
  139. <option value="select">option下拉框</option>
  140. <option value="radio">radio选项卡</option>
  141. <option value="checkbox">checkbox多选框</option>
  142. <option value="stepselect">联动类型</option>
  143. <option value="relation">关联文档</option>
  144. <?php }?>
  145. </select>
  146. </td>
  147. </tr>
  148. <tr id="_relation" <?php echo $dtype=="relation"? '' : 'style="display:none"';?>>
  149. <td>文档模型:选择关联文档对应的文档模型</td>
  150. <td>
  151. <select name="channeltype" id="channeltype" class="admin-input-md">
  152. <?php
  153. $channelid = $ctag->GetAtt('channel') == "" ? 1 : $ctag->GetAtt('channel');
  154. foreach($channelArray as $k=>$arr)
  155. {
  156. if ($k==$channelid) {
  157. $nid = $arr['nid'];
  158. echo "<option value='{$k}' selected>{$arr['typename']}|{$arr['nid']}</option>";
  159. } else {
  160. echo "<option value='{$k}'>{$arr['typename']}|{$arr['nid']}</option>";
  161. }
  162. }
  163. ?>
  164. </select>
  165. <label><input type="checkbox" name="relation_automake" id="relation_automake" value="1" <?php echo $ctag->GetAtt('automake')==1? "checked" : "";?>> 发布时候自动更新关联网页文档</label>
  166. </td>
  167. </tr>
  168. <tr>
  169. <td>文档是否需要分页符:如果文档需要分页符,不论何种文档,都可以用#P#副标题#e#作为分页符号实现文档分页,但一个模型里仅允许一个这样的字段</td>
  170. <td>
  171. <input name="isnull" type="hidden" value="1">
  172. <label><input type="radio" name="spage" value="split" <?php if ($ctag->GetAtt('page')=='split') echo "checked='1'";?>> 是</label>
  173. <label><input type="radio" name="spage" value="no" <?php if ($ctag->GetAtt('page')=='no'||$ctag->GetAtt('page')=='') echo "checked='1'";?>> 否</label>
  174. </td>
  175. </tr>
  176. <tr>
  177. <td>默认值:如果定义数据类型为select、radio、checkbox时,此处填写被选择的项目(英文逗号分开,如“DedeBIZ,得德”)如果为联动选框,这里填写联动选框项目名称</td>
  178. <td><textarea name="vdefault" id="vdefault" class="admin-textarea-xl"><?php echo $ctag->GetAtt('default');?></textarea></td>
  179. </tr>
  180. <tr>
  181. <td>最大长度:文本数据必须填写,大于255为text类型</td>
  182. <td><input type="text" name="maxlength" id="maxlength" value="<?php echo $ctag->GetAtt('maxlength')?>" class="admin-input-xs"></td>
  183. </tr>
  184. <tr>
  185. <td>自定义网页表单:</td>
  186. <td>自定义网页表单用~name~表示提示文字,~form~表示表单元素</td>
  187. </tr>
  188. <tr>
  189. <td></td>
  190. <td><textarea name="vinnertext" id="vinnertext" class="admin-textarea-xl"><?php echo $ctag->GetInnerText();?></textarea></td>
  191. </tr>
  192. <tr>
  193. <td bgcolor="#f5f5f5" colspan="2" align="center">
  194. <button type="submit" name="button1" id="button1" class="btn btn-success btn-sm">保存</button>
  195. <button type="reset" name="button3" id="button3" class="btn btn-outline-success btn-sm">重置</button>
  196. </td>
  197. </tr>
  198. </form>
  199. </table>
  200. </body>
  201. </html>