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

229 lines
11KB

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