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

281 lines
13KB

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