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

378 lines
17KB

  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. <script language="javascript">
  7. function Nav() {
  8. if (window.navigator.userAgent.indexOf("MSIE") >= 1) return 'IE';
  9. else if (window.navigator.userAgent.indexOf("Firefox") >= 1) return 'FF';
  10. else return "OT";
  11. }
  12. function $Obj(objname) {
  13. return document.getElementById(objname);
  14. }
  15. function ShowHide2(objname) {
  16. var obj = $Obj(objname);
  17. if (obj.style.display != 'block') { obj.style.display = 'block' }
  18. else { obj.style.display = 'none'; }
  19. }
  20. //删除
  21. function DelNote(gourl) {
  22. if (!window.confirm("您确认要删除这个字段吗")) { return false; }
  23. location.href = gourl;
  24. }
  25. function ShowObj(objname) {
  26. var obj = document.getElementById(objname);
  27. if (Nav() == 'IE') { obj.style.display = "block"; obj.style.display = "block"; }
  28. else obj.style.display = "table";
  29. }
  30. function HideObj(objname) {
  31. var obj = document.getElementById(objname);
  32. obj.style.display = "none";
  33. }
  34. function ShowItem1() {
  35. ShowObj('head1'); ShowObj('needset');
  36. HideObj('head2'); HideObj('adset');
  37. }
  38. function ShowItem2() {
  39. setTimeout(() => {
  40. var editor = CodeMirror.fromTextArea(document.getElementById('fieldset'), {
  41. lineNumbers: true,
  42. lineWrapping: true,
  43. mode: 'text/html'
  44. });
  45. }, 100);
  46. ShowObj('head2'); ShowObj('adset');
  47. HideObj('head1'); HideObj('needset');
  48. }
  49. </script>
  50. <link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
  51. <link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
  52. <link rel="stylesheet" href="../static/web/css/admin.css">
  53. <link rel="stylesheet" href="css/codemirror.css">
  54. <script type="text/javascript" src="js/codemirror.js"></script>
  55. <script type="text/javascript" src="js/mode/xml/xml.js"></script>
  56. <script type="text/javascript" src="js/mode/javascript/javascript.js"></script>
  57. <script type="text/javascript" src="js/mode/css/css.js"></script>
  58. <script type="text/javascript" src="js/mode/htmlmixed/htmlmixed.js"></script>
  59. </head>
  60. <body>
  61. <form name="form1" action="mychannel_edit.php" method="post">
  62. <input type='hidden' name='id' value='<?php echo $id?>'>
  63. <input type='hidden' name='dopost' value='save'>
  64. <input type='hidden' name='issystem' value='<?php echo $row['issystem']; ?>'>
  65. <table width="98%" cellpadding="3" cellspacing="1" align="center"style="margin-bottom:10px" class="table maintable mt-3 mb-3">
  66. <tr>
  67. <td height="26" colspan="2" background="../static/web/img/tbg.gif" style="padding-left:10px"><a href="mychannel_main.php">内容模型管理</a> &gt; 修改内容模型</td>
  68. </tr>
  69. </table>
  70. <table width="98%" cellspacing="0" id="head1" cellpadding="0" align="center" style="display:block">
  71. <tr>
  72. <td colspan="2">
  73. <table cellpadding="0" cellspacing="0">
  74. <tr>
  75. <td width="86" height="26" align="center" background="../static/web/img/itemnote1.gif">基本设置</td>
  76. <td width="86" align="center" background="../static/web/img/itemnote2.gif"><a href="javascript:;" onClick="ShowItem2()">字段管理</a></td>
  77. </tr>
  78. </table>
  79. </td>
  80. </tr>
  81. </table>
  82. <table width="98%" cellspacing="0" id="head2" cellpadding="0" align="center" style="display:none" >
  83. <tr>
  84. <td colspan="2">
  85. <table cellpadding="0" cellspacing="0">
  86. <tr>
  87. <td width="86" height="26" align="center" background="../static/web/img/itemnote2.gif"><a href="javascript:;" onClick="ShowItem1()">基本设置</a></td>
  88. <td width="86" align="center" background="../static/web/img/itemnote1.gif">字段管理</td>
  89. </tr>
  90. </table>
  91. </td>
  92. </tr>
  93. </table>
  94. <table width="98%" id='needset' cellpadding="3" cellspacing="1" align="center" class="table maintable" style="display:block">
  95. <?php
  96. if($row['issystem'] == 1)
  97. {
  98. ?>
  99. <tr>
  100. <td colspan="2" style="color:#dc3545;border-top:0">您目前所展开的是系统模型,系统模型一般对发布程序和管理程序已经固化,如果您胡乱修改系统模型将会导致使用这种内容类型的频道可能崩溃</td>
  101. </tr>
  102. <?php
  103. }
  104. ?>
  105. <tr>
  106. <td style="border-top:0">模型性质<br>
  107. <span class="style2" id="help5">如果为系统模型将禁止删除,此选项不可修改,对于独立模型,系统强制创建字段aid、栏目ID、发布时间、文档标题</span>
  108. </td>
  109. <td style="border-top:0">
  110. <?php
  111. if($row['issystem']==0) echo "自动模型";
  112. else if($row['issystem']==1) echo "系统模型";
  113. else if($row['issystem']==-1) echo "独立模型";
  114. ?>
  115. </td>
  116. </tr>
  117. <tr>
  118. <td width="30%">频道ID<br>
  119. <span class="style2" id='help1'>数字,创建后不可修改,并具有唯一性</span>
  120. </td>
  121. <td width="70%"><?php echo $row['id']; ?></td>
  122. </tr>
  123. <tr>
  124. <td>名字标识<br>
  125. <span class="style2" id="help2">与文档的模板相关连,建议由英文、数字或下划线组成,因为部份Unix系统无法识别中文文件,频道默认文档模板是“default/article_名字标识.htm”,列表模板、封面模板类推 </span>
  126. </td>
  127. <td><?php echo $row['nid']; ?></td>
  128. </tr>
  129. <tr>
  130. <td>频道名称<br><span class="style2" id="help3">频道的中文名称,在后台管理,前台发布等均使用此名字</span></td>
  131. <td><input name="typename" type="text" id="typename" value="<?php echo $row['typename']; ?>" class="pubinputs"></td>
  132. </tr>
  133. <tr>
  134. <td>附加表<br>
  135. <span class="style2" id="help4">频道除主表以外其它自定义类型数据存放数据的表,如果您不使用主表关连的各种特性(推荐、会员权限等),也可以使用完全以附加表作为存储数据</span>
  136. </td>
  137. <td><input name="addtable" type="text" id="addtable" value="<?php echo $row['addtable']; ?>" class="pubinputs">(#@__ 是表示数据表前缀)</td>
  138. </tr>
  139. <tr>
  140. <td>是否支持会员投稿</td>
  141. <td>
  142. <label><input name="issend" type="radio" class="np" value="0" <?php if($row['issend']==0) echo " checked='1' "; ?> />
  143. 不支持 </label>
  144. <label><input type="radio" name="issend" class="np" value="1" <?php if($row['issend']==1) echo " checked='1' "; ?> />
  145. 支持 </label>
  146. </td>
  147. </tr>
  148. <tr>
  149. <td>会员许可投稿级别</td>
  150. <td>
  151. <select name="sendrank" id="sendrank" style="width:160px">
  152. <option value='0'>游客</option>
  153. <?php
  154. $urank = $cuserLogin->getUserRank();
  155. $dsql->SetQuery("Select * from `#@__arcrank` where adminrank<='$urank' And `rank`>=10");
  156. $dsql->Execute();
  157. while($row2 = $dsql->GetObject())
  158. {
  159. if($row2->rank==$row['sendrank']) echo "<option value='".$row2->rank."' selected>".$row2->membername."</option>";
  160. else echo "<option value='".$row2->rank."'>".$row2->membername."</option>";
  161. }
  162. ?>
  163. </select>
  164. </td>
  165. </tr>
  166. <tr>
  167. <td>许可投稿会员组</td>
  168. <td>
  169. <?php
  170. $dsql->SetQuery("Select * from `#@__member_model`");
  171. $dsql->Execute();
  172. while($row3 = $dsql->GetObject())
  173. {
  174. echo "<label><input name='usertype' class='np' type='radio' value=".$row3->name."> ".$row3->name."</label> ";
  175. }
  176. ?>
  177. <label><input name="usertype" class="np" type="radio" value="" <?php if($row['usertype']=='') echo " checked='1' "; ?>>
  178. 不限</label>
  179. </td>
  180. </tr>
  181. <tr>
  182. <td>会员稿件默认状态</td>
  183. <td>
  184. <label><input name="arcsta" class="np" type="radio" value="-1" <?php if($row['arcsta']==-1) echo " checked='1' "; ?>>
  185. 未审核</label>
  186. <label><input name="arcsta" class="np" type="radio" value="0" <?php if($row['arcsta']==0) echo " checked='1' "; ?>>
  187. 已审核(自动生成HTML)</label>
  188. <label><input name="arcsta" class="np" type="radio" value="1" <?php if($row['arcsta']==1) echo " checked='1' "; ?>>
  189. 已审核(仅使用动态文档)</label>
  190. </td>
  191. </tr>
  192. <tr>
  193. <td>档案发布程序</td>
  194. <td><input name="addcon" type="text" id="addcon" value="<?php echo $row['addcon']; ?>" class="pubinputs"></td>
  195. </tr>
  196. <tr>
  197. <td>档案修改程序</td>
  198. <td><input name="editcon" type="text" id="editcon" value="<?php echo $row['editcon']; ?>" class="pubinputs"></td>
  199. </tr>
  200. <tr>
  201. <td>档案管理程序</td>
  202. <td><input name="mancon" type="text" id="mancon" value="<?php echo $row['mancon']; ?>" class="pubinputs"></td>
  203. </tr>
  204. <tr>
  205. <td>前台会员发布程序</td>
  206. <td><input name="useraddcon" type="text" id="useraddcon" value="<?php echo $row['useraddcon']; ?>" class="pubinputs"></td>
  207. </tr>
  208. <tr>
  209. <td>前台会员修改程序</td>
  210. <td><input name="usereditcon" type="text" id="usereditcon" value="<?php echo $row['usereditcon']; ?>" class="pubinputs"></td>
  211. </tr>
  212. <tr>
  213. <td>前台会员管理程序</td>
  214. <td><input name="usermancon" type="text" id="usermancon" value="<?php echo $row['usermancon']; ?>" class="pubinputs"></td>
  215. </tr>
  216. <tr>
  217. <td>列表附加字段<br>
  218. <span class="style2" id="help6">用&quot;,&quot;分开,可以在列表模板{dede:list}{/dede:list}中用[field:name/]调用</span></td>
  219. <td><input name="listfields" type="text" id="listfields" size="50" value="<?php echo $row['listfields']; ?>" class="pubinputs" style="width:80%"></td>
  220. </tr>
  221. <tr>
  222. <td>投稿标题使用名称</td>
  223. <td><input name="titlename" type="text" id="titlename" value="<?php echo $row['titlename']; ?>" class="pubinputs"></td>
  224. </tr>
  225. <tr>
  226. <td>投稿是否使用摘要<br>
  227. <span class="style2">如果不使用主表(独立模型)缩略图设置同</span>
  228. </td>
  229. <td>
  230. <label><input name="needdes" type="radio" class="np" value="1" <?php if($row['needdes']==1) echo " checked='1'"; ?>>
  231. 使用</label>
  232. <label><input name="needdes" type="radio" class="np" value="0" <?php if($row['needdes']==0) echo " checked='1'"; ?>>
  233. 不使用 </label>
  234. </td>
  235. </tr>
  236. <tr>
  237. <td>投稿是否使用缩图</td>
  238. <td>
  239. <label><input name="needpic" type="radio" class="np" value="1" <?php if($row['needpic']==1) echo " checked='1'"; ?> />
  240. 使用 </label>
  241. <label><input name="needpic" type="radio" class="np" value="0" <?php if($row['needpic']==0) echo " checked='1'"; ?> />
  242. 不使用 </label>
  243. </td>
  244. </tr>
  245. <tr>
  246. <td>默认栏目ID<br><span class="style2" id="help8">与投稿是唯一性结合可以用模型设计自定义表单</span></td>
  247. <td><input name="dfcid" type="text" id="dfcid" value="<?php echo $row['dfcid']; ?>" class="pubinputs" style="width:160px"></td>
  248. </tr>
  249. <tr>
  250. <td>投稿具有唯一性<br>
  251. <span class="style2" id="help9">如果投稿是唯一会员只能在这个模型对应的栏目中发布单篇文档,其作用相当于自定义表单</span>
  252. </td>
  253. <td>
  254. <label><input name="onlyone" type="radio" class="np" value="1"
  255. <?php if($row['onlyone']==1) echo " checked='1'"; ?> />
  256. 是 </label>
  257. <label><input name="onlyone" type="radio" class="np" value="0"
  258. <?php if($row['onlyone']==0) echo " checked='1'"; ?> />
  259. 不是 </label>
  260. </td>
  261. </tr>
  262. </table>
  263. <table width="98%" id='adset' cellpadding="3" cellspacing="1" align="center" class="table maintable" style='display:none'>
  264. <tr>
  265. <td height="26">模型字段配置(可视化模式)</td>
  266. <td><button name="fset" type="button" id="fset" onClick="location.href='mychannel_field_add.php?id=<?php echo $id; ?>'" class="btn btn-success btn-sm">添加新字段</button></td>
  267. </tr>
  268. <tr>
  269. <td colspan='2'>
  270. <table width="100%" cellpadding="1" cellspacing="1" align="center">
  271. <tr align="center" bgcolor="#F8FCF1" height="26">
  272. <td width="28%">表单提示文字</td>
  273. <td width="18%">数据字段名</td>
  274. <td width="20%">数据类型</td>
  275. <td width="18%">表单类型</td>
  276. <td>操作</td>
  277. </tr>
  278. <?php
  279. if($row['issystem']==-1)
  280. {
  281. ?>
  282. <tr>
  283. <td colspan='5'>aid 和 typeid 是强制使用字段,这里不列出</td>
  284. </tr>
  285. <?php
  286. } else {
  287. ?>
  288. <tr>
  289. <td colspan='5'>下面列出的字段是附加表的字段,除此外,它还包含主表dede_archives的所有字段</td>
  290. </tr>
  291. <?php
  292. }
  293. $ds = file(DEDEADMIN."/inc/fieldtype.txt");
  294. foreach($ds as $d){
  295. $dds = explode(',',trim($d));
  296. $fieldtypes[$dds[0]] = $dds[1];
  297. }
  298. $fieldset = stripslashes($row['fieldset']);
  299. $dtp = new DedeTagParse();
  300. $dtp->SetNameSpace("field","<",">");
  301. $dtp->LoadSource($fieldset);
  302. if(is_array($dtp->CTags)){
  303. foreach($dtp->CTags as $ctag)
  304. {
  305. ?>
  306. <tr height="26" align="center" onmousemove="javascript:this.bgColor='#F8FCF1';" onmouseout="javascript:this.bgColor='#ffffff';" height="26">
  307. <td>
  308. <?php
  309. $itname = $ctag->GetAtt('itemname');
  310. if($itname=='') echo "没指定";
  311. else echo $itname;
  312. ?>
  313. </td>
  314. <td><?php echo $ctag->GetTagName(); ?></td>
  315. <td>
  316. <?php
  317. $ft = $ctag->GetAtt('type');
  318. if(isset($fieldtypes[$ft])) echo $fieldtypes[$ft];
  319. else echo "系统专用类型";
  320. ?>
  321. </td>
  322. <td>
  323. <?php
  324. $ft = $ctag->GetAtt('autofield');
  325. if($ft=='' || $ft==0) {
  326. echo "固化字段";
  327. } else {
  328. echo "自动表单";
  329. }
  330. ?>
  331. </td>
  332. <td>
  333. <?php
  334. if($ft==1)
  335. {
  336. ?>
  337. <a href="mychannel_field_edit.php?id=<?php echo $id; ?>&fname=<?php echo $ctag->GetTagName(); ?>&issystem=<?php echo $row['issystem']; ?>"><i class="btn btn-sm fa fa-pencil-square-o" title="修改"></i></a>
  338. <?php if($row['issystem']!=1){ ?>
  339. <a href="javascript:;" onClick="javascript:DelNote('mychannel_field_edit.php?id=<?php echo $id; ?>&fname=<?php echo $ctag->GetTagName(); ?>&action=delete');"><i class="btn btn-sm fa fa-trash" title="删除"></i></a>
  340. <?php } ?>
  341. <?php
  342. } else {
  343. echo "禁止修改";
  344. }
  345. ?>
  346. </td>
  347. </tr>
  348. <?php
  349. }
  350. }
  351. ?>
  352. </table>
  353. </td>
  354. </tr>
  355. <tr>
  356. <td height="26" width="30%">模型字段配置(文本模式)<br>
  357. 修改配置文本可调整字段顺序,但不会修改字段属性
  358. </td>
  359. <td width="70%"><textarea name="fieldset" style="width:98%;height:300px" rows="10" id="fieldset"><?php echo stripslashes($row['fieldset']); ?></textarea></td>
  360. </tr>
  361. </table>
  362. <table width="98%" cellpadding="3" cellspacing="1" align="center" class="table maintable mt-3 mb-3">
  363. <tr>
  364. <td colspan="2" align="center" class="py-3">
  365. <button type="submit" class="btn btn-success btn-sm">保存</button>
  366. <button type="button" onClick="location='mychannel_main.php';" class="btn btn-success btn-sm">返回</button>
  367. </td>
  368. </tr>
  369. </table>
  370. </form>
  371. <?php
  372. if(!empty($openfield))
  373. {
  374. echo "<script language='javascript'>ShowItem2();</script>";
  375. }
  376. ?>
  377. </body>
  378. </html>