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

258 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/web/css/bootstrap.min.css">
  7. <link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
  8. <link rel="stylesheet" href="../static/web/css/admin.css">
  9. <script language="javascript" src="../static/web/js/jquery.min.js"></script>
  10. <script src="../static/web/js/bootstrap.bundle.min.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>
  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. <form name="form1" action="mychannel_field_edit.php" method="post" onSubmit="return GetFields();">
  80. <input type='hidden' name='action' value='save' />
  81. <input type='hidden' name='id' value='<?php echo $id?>' />
  82. <input type='hidden' name='fname' value='<?php echo $fname?>' />
  83. <input type='hidden' name='issystem' value='<?php echo $issystem?>' />
  84. <input type='hidden' name='fieldstring' value='' />
  85. <tr>
  86. <td height="26" colspan="2" bgcolor="#EDF9D5" background="../static/web/img/tbg.gif">
  87. <table width="98%" border="0" cellspacing="0" cellpadding="0" class="table table-borderless">
  88. <tr>
  89. <td width="30%" style="padding-left:10px">
  90. <a href="mychannel_main.php">频道管理</a> &gt; 查看/修改字段:
  91. </td>
  92. <td align="right" style="padding-top:6px;">
  93. <button type="button" name="ss1" class="btn btn-success btn-sm" onClick="location='mychannel_edit.php?id=<?php echo $id?>&dopost=edit';">当前模型信息</button>
  94. <button type="button" name="ss12" onClick="location='mychannel_main.php';" class="btn btn-success btn-sm">内容模型管理</button>
  95. </td>
  96. </tr>
  97. </table>
  98. </td>
  99. </tr>
  100. <?php if($row['issystem']==1){ ?>
  101. <tr>
  102. <td colspan="2" bgcolor="#FFFFFF">
  103. <span class="STYLE1">您当前操作的字段属于系统模型字段:修改系统模型有风险,请不要随便改动系统模型的字段相关的属性</span></td>
  104. </tr>
  105. <?php } ?>
  106. <tr>
  107. <td bgcolor="#FFFFFF">表单提示文字:<br>
  108. <span class="STYLE2">发布内容时显示的提示文字</span></td>
  109. <td bgcolor="#FFFFFF">
  110. <input name="itemname" type="text" id="itemname" value="<?php echo $ctag->GetAtt('itemname')?>" class="pubinputs">
  111. *(发布内容时显示的项名字)</td>
  112. </tr>
  113. <tr>
  114. <td width="28%" bgcolor="#FFFFFF">字段名称:<br>
  115. <span class="STYLE2">只能用英文字母或数字,数据表的真实字段名</span></td>
  116. <td width="72%" bgcolor="#FFFFFF" style="table-layout:fixed;word-break:break-all">
  117. <?php echo $fname?> </td>
  118. </tr>
  119. <tr>
  120. <td bgcolor="#FFFFFF">字段类型:</td>
  121. <td bgcolor="#FFFFFF">
  122. <label><input name="autofield" type="radio" class="np" value="1" checked="checked"
  123. <?php echo ($ctag->GetAtt('autofield')==1 ? " checked":""); ?> />
  124. 系统自动生成表单字段</label>
  125. <label><input name="autofield" type="radio" class="np" value="0"
  126. <?php echo ( ($ctag->GetAtt('autofield')==''||$ctag->GetAtt('autofield')=='0') ? " checked":""); ?> />
  127. 已经固化在发布表单中字段</label></td>
  128. </tr>
  129. <tr>
  130. <td bgcolor="#FFFFFF">前台参数:</td>
  131. <td bgcolor="#FFFFFF">
  132. <label><input name="islist" type="checkbox" class="np" id="islist" value="1"
  133. <?php echo ($ctag->GetAtt('islist')==1 ? " checked":""); ?> />
  134. 使字段可以在列表的底层模板中获得(自定义字段默认仅能在文档模板显示,启用此选项将使列表查询变慢,如无必要请不要选择)</label>
  135. <br>
  136. <label><input name="notsend" type="checkbox" class="np" id="notsend" value="1"
  137. <?php echo ($ctag->GetAtt('notsend')==1 ? " checked":""); ?> />
  138. 前台投稿及采集规则禁用本字段</label></td>
  139. </tr>
  140. <tr>
  141. <td bgcolor="#FFFFFF">数据类型:</td>
  142. <td bgcolor="#FFFFFF">
  143. <select name="dtype" id="type" style="width:200px">
  144. <?php
  145. $dtype = $ctag->GetAtt('type');
  146. if($dtype!='' && isset($fieldtypes[$dtype]))
  147. {
  148. echo "<option value='{$dtype}'>{$fieldtypes[$dtype]}</option>\r\n";
  149. $canchange = true;
  150. } else {
  151. echo "<option value='{$dtype}'>系统专用类型</option>\r\n";
  152. $canchange = false;
  153. }
  154. if($canchange)
  155. {
  156. ?>
  157. <option value="text">单行文本(varchar)</option>
  158. <option value="textchar">单行文本(char)</option>
  159. <option value="multitext">多行文本</option>
  160. <option value="htmltext">HTML文本</option>
  161. <option value="textdata">文本保存HTML数据</option>
  162. <option value="int">整数类型</option>
  163. <option value="float">小数类型</option>
  164. <option value="datetime">时间类型</option>
  165. <option value="img">图片</option>
  166. <option value="imgfile">图片(仅网址)</option>
  167. <option value="media">多媒体文件</option>
  168. <option value="addon">附件类型</option>
  169. <option value="select">使用option下拉框</option>
  170. <option value="radio">使用radio选项卡</option>
  171. <option value="checkbox">Checkbox多选框</option>
  172. <option value="stepselect">联动类型</option>
  173. <option value="relation">关联内容</option>
  174. <?php
  175. }
  176. ?>
  177. </select> </td>
  178. </tr>
  179. <tr id="_relation" <?php echo $dtype=="relation"? '' : 'style="display: none;"'; ?>>
  180. <td bgcolor="#FFFFFF">内容模型:<br>
  181. <span class="STYLE2">
  182. 选择关联内容对应的内容模型
  183. </span>
  184. </td>
  185. <td bgcolor="#FFFFFF">
  186. <select name="channeltype" id="channeltype" style="width:200px">
  187. <?php
  188. $channelid = $ctag->GetAtt('channel') == "" ? 1 : $ctag->GetAtt('channel');
  189. foreach($channelArray as $k=>$arr)
  190. {
  191. if($k==$channelid) {
  192. $nid = $arr['nid'];
  193. echo " <option value='{$k}' selected>{$arr['typename']}|{$arr['nid']}</option>\r\n";
  194. } else {
  195. echo " <option value='{$k}'>{$arr['typename']}|{$arr['nid']}</option>\r\n";
  196. }
  197. }
  198. ?>
  199. </select>
  200. <label><input name="relation_automake" type="checkbox" class="np" id="relation_automake" value="1" <?php echo $ctag->GetAtt('automake')==1? "checked" : ""; ?>>
  201. 发布时候自动更新关联内容HTML</label>
  202. </td>
  203. </tr>
  204. <tr>
  205. <td bgcolor="#FFFFFF">内容是否需要分页符:<br>
  206. <span class="STYLE2">如果内容需要分页符,不论何种内容,都可以用#P#副标题#e#作为分页符号实现内容分页,但一个模型里仅允许一个这样的字段!</span></td>
  207. <td bgcolor="#FFFFFF">
  208. <input name="isnull" type="hidden" value="1">
  209. <label><input name="spage" type="radio" value="split"
  210. <?php if($ctag->GetAtt('page')=='split') echo " checked='1' "; ?> class='np' />
  211. 是</label> &nbsp;
  212. <label><input name="spage" type="radio" value="no"
  213. <?php if($ctag->GetAtt('page')=='no'||$ctag->GetAtt('page')=='') echo " checked='1' "; ?> class='np' />
  214. 否</label></td>
  215. </tr>
  216. <tr>
  217. <td bgcolor="#FFFFFF">默认值:<br>
  218. <span class="STYLE2">
  219. 如果定义数据类型为select、radio、checkbox时,此处填写被选择的项目(用“,”分开,如“男,女,人妖”),如果为联动选框,这里填写联动选框项目名称</span></td>
  220. <td bgcolor="#FFFFFF"><textarea name="vdefault" type="text" id="vdefault" style="width:70%;height:60px"><?php echo $ctag->GetAtt('default'); ?></textarea></td>
  221. </tr>
  222. <tr>
  223. <td bgcolor="#FFFFFF">最大长度:<br>
  224. <span class="STYLE2"> 文本数据必须填写,大于255为text类型 </span></td>
  225. <td bgcolor="#FFFFFF">
  226. <input name="maxlength" type="text" id="maxlength" value="<?php echo $ctag->GetAtt('maxlength')?>" style="width:80px;height:24px;padding-top:3px;"></td>
  227. </tr>
  228. <tr>
  229. <td bgcolor="#FFFFFF">自定义表单HTML:</td>
  230. <td bgcolor="#FFFFFF">
  231. 自定义表单HTML用~name~表示提示文字,~form~表示表单元素<br> </td>
  232. </tr>
  233. <tr>
  234. <td align="center" bgcolor="#FFFFFF"><br> </td>
  235. <td bgcolor="#FFFFFF"><textarea name="vinnertext" cols="45" rows="5" id="vinnertext" style="width:70%; height:120px;"><?php echo $ctag->GetInnerText(); ?></textarea></td>
  236. </tr>
  237. <tr>
  238. <td height="26" colspan="2" bgcolor="#f8f8f8">
  239. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table table-borderless">
  240. <tr>
  241. <td width="26%" height="36"></td>
  242. <td width="10%"><button type="submit" name="button1" id="button1" class="btn btn-success">确定</button>
  243. </td>
  244. <td><button type="reset" name="button3" id="button3" class="btn btn-success">重置</button>
  245. </td>
  246. </tr>
  247. </table>
  248. </td>
  249. </tr>
  250. </form>
  251. </table>
  252. </body>
  253. </html>