国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

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