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

преди 3 години
преди 1 година
преди 4 месеца
преди 1 година
преди 1 година
преди 1 година
преди 1 година
преди 4 месеца
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 6 години
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
  6. <title>修改文档模型</title>
  7. <link rel="stylesheet" href="/static/web/css/font-awesome.min.css">
  8. <link rel="stylesheet" href="/static/web/css/bootstrap.min.css">
  9. <link rel="stylesheet" href="/static/web/css/admin.css">
  10. <link rel="stylesheet" href="/static/web/css/codemirror.css">
  11. <script src="/static/web/js/codemirror.js"></script>
  12. <script src="/static/web/js/mode/xml/xml.js"></script>
  13. <script src="/static/web/js/mode/javascript/javascript.js"></script>
  14. <script src="/static/web/js/mode/css/css.js"></script>
  15. <script src="/static/web/js/mode/htmlmixed/htmlmixed.js"></script>
  16. </head>
  17. <body>
  18. <div class="container-fluid">
  19. <ol class="breadcrumb">
  20. <li class="breadcrumb-item"><a href="index_body.php">后台面板</a></li>
  21. <li class="breadcrumb-item"><a href="mychannel_main.php">文档模型管理</a></li>
  22. <li class="breadcrumb-item active">新增文档模型</li>
  23. </ol>
  24. <div class="card shadow-sm">
  25. <div class="card-header">修改文档模型</div>
  26. <div class="card-body">
  27. <?php if ($row['issystem'] == 1) {?><div class="alert alert-warning">默认文档模型字段,请谨慎修改</div><?php }?>
  28. <form name="form1" action="mychannel_edit.php" method="post">
  29. <input type="hidden" name="id" value="<?php echo $id?>">
  30. <input type="hidden" name="dopost" value="save">
  31. <input type="hidden" name="issystem" value="<?php echo $row['issystem'];?>">
  32. <div class="table-responsive">
  33. <table class="table table-borderless">
  34. <tbody>
  35. <tr>
  36. <td width="260">模型性质</td>
  37. <td><?php if ($row['issystem']==0) echo "自动模型";else if ($row['issystem']==1) echo "系统模型";else if ($row['issystem']==-1) echo "独立模型";?>(系统模型禁止删除,独立模型具有单独主表,自动创建字段aid、栏目id、文档标题等,文档必须点击栏目进入列表管理)</td>
  38. </tr>
  39. <tr>
  40. <td>模型id</td>
  41. <td><?php echo $row['id'];?>(创建后不可修改,具有唯一性)</td>
  42. </tr>
  43. <tr>
  44. <td>模型标识</td>
  45. <td><?php echo $row['nid'];?>(建议由英文、数字或下划线组成,示例article_名字标识.htm,列表和封面模板类推)</td>
  46. </tr>
  47. <tr>
  48. <td>模型名称</td>
  49. <td><input type="text" name="typename" id="typename" class="admin-input-sm" value="<?php echo $row['typename'];?>">(前后台显示模型的名称)</td>
  50. </tr>
  51. <tr>
  52. <td>附加表</td>
  53. <td><input type="text" name="addtable" id="addtable" class="admin-input-sm" value="<?php echo $row['addtable'];?>">(#@__表示数据表前缀,文档模型主表外其它数据存放附加表)</td>
  54. </tr>
  55. <tr>
  56. <td>是否支持会员投稿</td>
  57. <td>
  58. <label><input type="radio" name="issend" value="0" <?php if ($row['issend']==0) echo 'checked';?>> 不支持</label>
  59. <label><input type="radio" name="issend" value="1" <?php if ($row['issend']==1) echo 'checked';?>> 支持</label>
  60. </td>
  61. </tr>
  62. <tr>
  63. <td>会员投稿级别</td>
  64. <td>
  65. <select name="sendrank" id="sendrank" class="admin-input-sm">
  66. <option value="0">游客</option>
  67. <?php
  68. $urank = $cuserLogin->getUserRank();
  69. $dsql->SetQuery("SELECT * FROM `#@__arcrank` where adminrank<='$urank' And `rank` >= 10");
  70. $dsql->Execute();
  71. while($row2 = $dsql->GetObject())
  72. {
  73. if ($row2->rank==$row['sendrank']) echo "<option value='".$row2->rank."' selected>".$row2->membername."</option>";
  74. else echo "<option value='".$row2->rank."'>".$row2->membername."</option>";
  75. }
  76. ?>
  77. </select>
  78. </td>
  79. </tr>
  80. <tr>
  81. <td>会员投稿组</td>
  82. <td>
  83. <label><input type='radio' name='usertype' value='个人'<?php echo $row['usertype']=='个人'? " checked" : "";?>> 个人</label>
  84. <label><input type='radio' name='usertype' value='企业' <?php echo $row['usertype']=='企业' ? " checked" : "" ;?>> 企业</label>
  85. <label><input type="radio" name="usertype" value="0" <?php if ($row['usertype']=='' ) echo 'checked' ;?>> 不限</label>
  86. </td>
  87. </tr>
  88. <tr>
  89. <td>会员投稿默认状态</td>
  90. <td>
  91. <label><input type="radio" name="arcsta" value="-1" <?php if ($row['arcsta']==-1) echo 'checked';?>> 待审核</label>
  92. <label><input type="radio" name="arcsta" value="0" <?php if ($row['arcsta']==0) echo 'checked';?>> 已审核(更新静态页)</label>
  93. <label><input type="radio" name="arcsta" value="1" <?php if ($row['arcsta']==1) echo 'checked';?>> 已审核(使用动态页)</label>
  94. </td>
  95. </tr>
  96. <tr>
  97. <td>列表附加字段</td>
  98. <td><input type="text" name="listfields" id="listfields" class="admin-input-lg" value="<?php echo $row['listfields'];?>" class="w-50">(用英文逗号隔开,标签{dede:list channelid='模型id' addfields='字段1,字段2'}[field:name/]{/dede:list}调用)</td>
  99. </tr>
  100. <tr>
  101. <td>投稿标题使用名称</td>
  102. <td><input type="text" name="titlename" id="titlename" class="admin-input-sm" value="<?php echo $row['titlename'];?>"></td>
  103. </tr>
  104. <tr>
  105. <td>投稿是否使用摘要</td>
  106. <td>
  107. <label><input type="radio" name="needdes" value="1" <?php if ($row['needdes']==1) echo 'checked';?>> 使用</label>
  108. <label><input type="radio" name="needdes" value="0" <?php if ($row['needdes']==0) echo 'checked';?>> 不使用</label>
  109. </td>
  110. </tr>
  111. <tr>
  112. <td>投稿是否使用缩图</td>
  113. <td>
  114. <label><input type="radio" name="needpic" value="1" <?php if ($row['needpic']==1) echo 'checked';?>> 使用</label>
  115. <label><input type="radio" name="needpic" value="0" <?php if ($row['needpic']==0) echo 'checked';?>> 不使用</label>
  116. </td>
  117. </tr>
  118. <tr>
  119. <td>默认栏目id</td>
  120. <td><input type="text" name="dfcid" id="dfcid" class="admin-input-sm" value="<?php echo $row['dfcid'];?>">(与投稿唯一性结合可以用自定义模型)</td>
  121. </tr>
  122. <tr>
  123. <td>投稿具有唯一性</td>
  124. <td>
  125. <label><input type="radio" name="onlyone" value="1" <?php if ($row['onlyone']==1) echo 'checked';?>> 是</label>
  126. <label><input type="radio" name="onlyone" value="0" <?php if ($row['onlyone']==0) echo 'checked';?>> 不是</label>
  127. <span>(与投稿唯一会员只能在该模型对应栏目中发布文档,其作用相当于自定义表单)</span>
  128. </td>
  129. </tr>
  130. <tr>
  131. <td>文档发布程序</td>
  132. <td><input type="text" name="addcon" id="addcon" class="admin-input-sm" value="<?php echo $row['addcon'];?>"></td>
  133. </tr>
  134. <tr>
  135. <td>文档修改程序</td>
  136. <td><input type="text" name="editcon" id="editcon" class="admin-input-sm" value="<?php echo $row['editcon'];?>"></td>
  137. </tr>
  138. <tr>
  139. <td>文档管理程序</td>
  140. <td><input type="text" name="mancon" id="mancon" class="admin-input-sm" value="<?php echo $row['mancon'];?>"></td>
  141. </tr>
  142. <tr>
  143. <td>前台会员发布程序</td>
  144. <td><input type="text" name="useraddcon" id="useraddcon" class="admin-input-sm" value="<?php echo $row['useraddcon'];?>"></td>
  145. </tr>
  146. <tr>
  147. <td>前台会员修改程序</td>
  148. <td><input type="text" name="usereditcon" id="usereditcon" class="admin-input-sm" value="<?php echo $row['usereditcon'];?>"></td>
  149. </tr>
  150. <tr>
  151. <td>前台会员管理程序</td>
  152. <td><input type="text" name="usermancon" id="usermancon" class="admin-input-sm" value="<?php echo $row['usermancon'];?>"></td>
  153. </tr>
  154. <tr>
  155. <td colspan="2">
  156. <table class="table">
  157. <thead>
  158. <tr>
  159. <td scope="col">字段名称</td>
  160. <td scope="col">字段标识</td>
  161. <td scope="col">数据类型</td>
  162. <td scope="col">字段类型</td>
  163. <td scope="col">操作</td>
  164. </tr>
  165. </thead>
  166. <tbody>
  167. <?php if ($row['issystem']==-1) {?>
  168. <tr>
  169. <td colspan='5'>不列出aid和typeid强制使用字段</td>
  170. </tr>
  171. <?php } else {?>
  172. <?php
  173. }
  174. $ds = file(DEDEADMIN."/inc/fieldtype.txt");
  175. foreach($ds as $d){
  176. $dds = explode(',',trim($d));
  177. $fieldtypes[$dds[0]] = $dds[1];
  178. }
  179. $fieldset = stripslashes($row['fieldset']);
  180. $dtp = new DedeTagParse();
  181. $dtp->SetNameSpace("field","<",">");
  182. $dtp->LoadSource($fieldset);
  183. if (is_array($dtp->CTags)){
  184. foreach($dtp->CTags as $ctag)
  185. {
  186. ?>
  187. <tr>
  188. <td>
  189. <?php
  190. $itname = $ctag->GetAtt('itemname');
  191. if ($itname=='') echo "未指定";
  192. else echo $itname;
  193. ?>
  194. </td>
  195. <td><?php echo $ctag->GetTagName();?></td>
  196. <td>
  197. <?php
  198. $ft = $ctag->GetAtt('type');
  199. if (isset($fieldtypes[$ft])) echo $fieldtypes[$ft];
  200. else echo "系统类型";
  201. ?>
  202. </td>
  203. <td>
  204. <?php
  205. $ft = $ctag->GetAtt('autofield');
  206. if ($ft=='' || $ft==0) {
  207. echo "固化字段";
  208. } else {
  209. echo "自动字段";
  210. }
  211. ?>
  212. </td>
  213. <td>
  214. <?php if ($ft==1) {?>
  215. <a href="mychannel_field_edit.php?id=<?php echo $id;?>&fname=<?php echo $ctag->GetTagName();?>&issystem=<?php echo $row['issystem'];?>" class="btn btn-success btn-sm"><i class="fa fa-pencil-square" title="修改"></i></a>
  216. <?php if ($row['issystem']!=1) {?>
  217. <a href="javascript:DelNote('mychannel_field_edit.php?id=<?php echo $id;?>&fname=<?php echo $ctag->GetTagName();?>&action=delete');" class="btn btn-danger btn-sm"><i class="fa fa-trash" title="删除"></i></a>
  218. <?php }?>
  219. <?php } else {echo "<span class='btn btn-danger btn-sm'><i class='fa fa-times' title='禁止'></i></span>";}?>
  220. </td>
  221. </tr>
  222. <?php }}?>
  223. </tbody>
  224. </table>
  225. </td>
  226. <tr>
  227. <tr>
  228. <td colspan="2">模型字段文本模式(调整字段顺序,但不会修改字段属性)</td>
  229. </tr>
  230. <tr>
  231. <td colspan="2"><textarea name="fieldset" id="fieldset" class="admin-textarea-xl"><?php echo stripslashes($row['fieldset']);?></textarea></td>
  232. </tr>
  233. <td colspan="2"><a href="mychannel_field_add.php?id=<?php echo $id;?>" class="btn btn-success btn-sm">添加新字段</button></td>
  234. </tr>
  235. <tr>
  236. <td align="center" colspan="2">
  237. <button type="submit" class="btn btn-success btn-sm">保存</button>
  238. <button type="reset" class="btn btn-outline-success btn-sm">重置</button>
  239. </td>
  240. </tr>
  241. </tbody>
  242. </table>
  243. </div>
  244. </form>
  245. </div>
  246. </div>
  247. </div>
  248. <script>
  249. function Nav() {
  250. if (window.navigator.userAgent.indexOf("Firefox") >= 1) return 'FF';
  251. else return "OT";
  252. }
  253. function $Obj(objname) {
  254. return document.getElementById(objname);
  255. }
  256. function ShowHide2(objname) {
  257. var obj = $Obj(objname);
  258. if (obj.style.display != 'block') { obj.style.display = 'block' }
  259. else { obj.style.display = 'none'; }
  260. }
  261. function DelNote(gourl) {
  262. DedeConfirm("您确认要删除这个字段吗").then((v) => {
  263. location.href = gourl;
  264. }).catch((e) => {
  265. console.log(e)
  266. });
  267. }
  268. function ShowObj(objname) {
  269. var obj = document.getElementById(objname);
  270. obj.style.display = "table";
  271. }
  272. function HideObj(objname) {
  273. var obj = document.getElementById(objname);
  274. obj.style.display = "none";
  275. }
  276. var editor = CodeMirror.fromTextArea(document.getElementById("fieldset"), {
  277. lineNumbers: true,
  278. lineWrapping: true,
  279. mode: 'text/html',
  280. });
  281. </script>
  282. </body>
  283. </html>