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

278 lines
12KB

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