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

mychannel_field_edit.htm 11KB

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