|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="<?php echo $cfg_soft_lang;?>">
- <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
- <title>修改内容模型</title>
- <link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
- <link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
- <link rel="stylesheet" href="../static/web/css/admin.css">
- <link rel="stylesheet" href="css/codemirror.css">
- <script src="js/codemirror.js"></script>
- <script src="js/mode/xml/xml.js"></script>
- <script src="js/mode/javascript/javascript.js"></script>
- <script src="js/mode/css/css.js"></script>
- <script src="js/mode/htmlmixed/htmlmixed.js"></script>
- <script>
- function Nav() {
- if (window.navigator.userAgent.indexOf("MSIE") >= 1) return 'IE';
- else if (window.navigator.userAgent.indexOf("Firefox") >= 1) return 'FF';
- else return "OT";
- }
- function $Obj(objname) {
- return document.getElementById(objname);
- }
- function ShowHide2(objname) {
- var obj = $Obj(objname);
- if (obj.style.display != 'block') { obj.style.display = 'block' }
- else { obj.style.display = 'none'; }
- }
- //删除
- function DelNote(gourl) {
- if (!window.confirm("您确认要删除这个字段吗")) { return false; }
- location.href = gourl;
- }
- function ShowObj(objname) {
- var obj = document.getElementById(objname);
- if (Nav() == 'IE') { obj.style.display = "block"; obj.style.display = "block"; }
- else obj.style.display = "table";
- }
- function HideObj(objname) {
- var obj = document.getElementById(objname);
- obj.style.display = "none";
- }
- function ShowItem1() {
- ShowObj('head1'); ShowObj('needset');
- HideObj('head2'); HideObj('adset');
- }
- var editor = null;
- function ShowItem2() {
- setTimeout(() => {
- if (!editor) {
- editor = CodeMirror.fromTextArea(document.getElementById('fieldset'), {
- lineNumbers: true,
- lineWrapping: true,
- mode: 'text/html'
- });
- }
- }, 100);
- ShowObj('head2'); ShowObj('adset');
- HideObj('head1'); HideObj('needset');
- }
- </script>
- </head>
- <body>
- <form name="form1" action="mychannel_edit.php" method="post">
- <input type="hidden" name="id" value="<?php echo $id?>">
- <input type="hidden" name="dopost" value="save">
- <input type="hidden" name="issystem" value="<?php echo $row['issystem'];?>">
- <table width="98%" cellpadding="3" cellspacing="1" align="center" class="mt-3 mb-3">
- <tr>
- <td width="70%"><i class="fa fa-map"></i> <a href="mychannel_main.php">内容模型管理</a> > 修改内容模型</td>
- <td width="30%" align="right"><a href="mychannel_main.php" class="btn btn-success btn-sm">内容模型管理</a></td>
- </tr>
- </table>
- <table width="98%" cellspacing="0" id="head1" cellpadding="0" align="center" style="display:block">
- <tr>
- <td colspan="2">
- <table cellpadding="0" cellspacing="0">
- <tr>
- <td width="80" height="28" align="center" bgcolor="#fbfce2">基本设置</td>
- <td width="80" align="center" bgcolor="#f8f8f8"><a href="javascript:;" onClick="ShowItem2()">字段管理</a></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <table width="98%" cellspacing="0" id="head2" cellpadding="0" align="center" style="display:none">
- <tr>
- <td colspan="2">
- <table cellpadding="0" cellspacing="0">
- <tr>
- <td width="80" align="center" bgcolor="#f8f8f8"><a href="javascript:;" onClick="ShowItem1()">基本设置</a></td>
- <td width="80" height="28" align="center" bgcolor="#fbfce2">字段管理</td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <table width="98%" id='needset' cellpadding="3" cellspacing="1" align="center" class="table maintable" style="display:block">
- <?php
- if ($row['issystem'] == 1)
- {
- ?>
- <tr>
- <td colspan="2" class="border-top-0">您目前所展开的是系统模型,系统模型一般对发布程序和管理程序已经固化,如果您胡乱修改系统模型将会导致使用这种内容类型的频道可能崩溃</td>
- </tr>
- <?php }?>
- <tr>
- <td class="border-top-0">模型性质<br>
- <span class="style2" id="help5">如果为系统模型将禁止删除,此选项不可修改,对于独立模型,系统强制创建字段aid、栏目id、发布时间、文档标题</span>
- </td>
- <td class="border-top-0">
- <?php
- if ($row['issystem']==0) echo "自动模型";
- else if ($row['issystem']==1) echo "系统模型";
- else if ($row['issystem']==-1) echo "独立模型";
- ?>
- </td>
- </tr>
- <tr>
- <td width="30%">频道ID<br>
- <span class="style2" id='help1'>数字,创建后不可修改,并具有唯一性</span></td>
- <td width="70%"><?php echo $row['id'];?></td>
- </tr>
- <tr>
- <td>名字标识<br>
- <span class="style2" id="help2">与文档的模板相关连,建议由英文、数字或下划线组成,因为部份Unix系统无法识别中文文件,频道默认文档模板是“default/article_名字标识.htm”,列表模板、封面模板类推 </span></td>
- <td><?php echo $row['nid'];?></td>
- </tr>
- <tr>
- <td>频道名称<br><span class="style2" id="help3">频道的中文名称,在后台管理,前台发布等均使用此名字</span></td>
- <td><input type="text" name="typename" id="typename" value="<?php echo $row['typename'];?>" class="pubinputs"></td>
- </tr>
- <tr>
- <td>附加表<br>
- <span class="style2" id="help4">频道除主表以外其它自定义类型数据存放数据的表,如果您不使用主表关连的各种特性(推荐、会员权限等),也可以使用完全以附加表作为存储数据</span></td>
- <td><input type="text" name="addtable" id="addtable" value="<?php echo $row['addtable'];?>" class="pubinputs">(#@__ 是表示数据表前缀)</td>
- </tr>
- <tr>
- <td>是否支持会员投稿</td>
- <td>
- <label><input type="radio" name="issend" value="0" <?php if ($row['issend']==0) echo "checked='1'";?>> 不支持</label>
- <label><input type="radio" name="issend" value="1" <?php if ($row['issend']==1) echo "checked='1'";?>> 支持</label>
- </td>
- </tr>
- <tr>
- <td>会员许可投稿级别</td>
- <td>
- <select name="sendrank" id="sendrank" style="width:160px">
- <option value="0">游客</option>
- <?php
- $urank = $cuserLogin->getUserRank();
- $dsql->SetQuery("Select * from `#@__arcrank` where adminrank<='$urank' And `rank`>=10");
- $dsql->Execute();
- while($row2 = $dsql->GetObject())
- {
- if ($row2->rank==$row['sendrank']) echo "<option value='".$row2->rank."' selected>".$row2->membername."</option>";
- else echo "<option value='".$row2->rank."'>".$row2->membername."</option>";
- }
- ?>
- </select>
- </td>
- </tr>
- <tr>
- <td>许可投稿会员组</td>
- <td>
- <?php
- $dsql->SetQuery("Select * from `#@__member_model`");
- $dsql->Execute();
- while($row3 = $dsql->GetObject())
- {
- echo "<label><input type='radio' name='usertype' value='".$row3->name."'".($row['usertype']==$row3->name? "checked" : "")."> ".$row3->name."</label> ";
- }
- ?>
- <label><input type="radio" name="usertype" value="" <?php if ($row['usertype']=='') echo "checked='1'";?>> 不限</label>
- </td>
- </tr>
- <tr>
- <td>会员稿件默认状态</td>
- <td>
- <label><input type="radio" name="arcsta" value="-1" <?php if ($row['arcsta']==-1) echo "checked='1'";?>> 未审核</label>
- <label><input type="radio" name="arcsta" value="0" <?php if ($row['arcsta']==0) echo "checked='1'";?>> 已审核(自动生成网页)</label>
- <label><input type="radio" name="arcsta" value="1" <?php if ($row['arcsta']==1) echo "checked='1'";?>> 已审核(仅使用动态文档)</label>
- </td>
- </tr>
- <tr>
- <td>文档发布程序</td>
- <td><input type="text" name="addcon" id="addcon" value="<?php echo $row['addcon'];?>" class="pubinputs"></td>
- </tr>
- <tr>
- <td>文档修改程序</td>
- <td><input type="text" name="editcon" id="editcon" value="<?php echo $row['editcon'];?>" class="pubinputs"></td>
- </tr>
- <tr>
- <td>文档管理程序</td>
- <td><input type="text" name="mancon" id="mancon" value="<?php echo $row['mancon'];?>" class="pubinputs"></td>
- </tr>
- <tr>
- <td>前台会员发布程序</td>
- <td><input type="text" name="useraddcon" id="useraddcon" value="<?php echo $row['useraddcon'];?>" class="pubinputs"></td>
- </tr>
- <tr>
- <td>前台会员修改程序</td>
- <td><input type="text" name="usereditcon" id="usereditcon" value="<?php echo $row['usereditcon'];?>" class="pubinputs"></td>
- </tr>
- <tr>
- <td>前台会员管理程序</td>
- <td><input type="text" name="usermancon" id="usermancon" value="<?php echo $row['usermancon'];?>" class="pubinputs"></td>
- </tr>
- <tr>
- <td>列表附加字段<br>
- <span class="style2" id="help6">用","分开,可以在列表模板{dede:list}{/dede:list}中用[field:name/]调用</span></td>
- <td><input type="text" name="listfields" id="listfields" size="50" value="<?php echo $row['listfields'];?>" class="pubinputs" style="width:80%"></td>
- </tr>
- <tr>
- <td>投稿标题使用名称</td>
- <td><input type="text" name="titlename" id="titlename" value="<?php echo $row['titlename'];?>" class="pubinputs"></td>
- </tr>
- <tr>
- <td>投稿是否使用摘要<br>
- <span class="style2">如果不使用主表(独立模型)缩略图设置同</span></td>
- <td>
- <label><input type="radio" name="needdes" value="1" <?php if ($row['needdes']==1) echo "checked='1'";?>> 使用</label>
- <label><input type="radio" name="needdes" value="0" <?php if ($row['needdes']==0) echo "checked='1'";?>> 不使用</label>
- </td>
- </tr>
- <tr>
- <td>投稿是否使用缩图</td>
- <td>
- <label><input type="radio" name="needpic" value="1" <?php if ($row['needpic']==1) echo "checked='1'";?>> 使用</label>
- <label><input type="radio" name="needpic" value="0" <?php if ($row['needpic']==0) echo "checked='1'";?>> 不使用</label>
- </td>
- </tr>
- <tr>
- <td>默认栏目id<br><span class="style2" id="help8">与投稿是唯一性结合可以用模型设计自定义表单</span></td>
- <td><input type="text" name="dfcid" id="dfcid" value="<?php echo $row['dfcid'];?>" class="pubinputs" style="width:160px"></td>
- </tr>
- <tr>
- <td>投稿具有唯一性<br>
- <span class="style2" id="help9">如果投稿是唯一会员只能在这个模型对应的栏目中发布单篇文档,其作用相当于自定义表单</span></td>
- <td>
- <label><input type="radio" name="onlyone" value="1" <?php if ($row['onlyone']==1) echo "checked='1'";?>> 是</label>
- <label><input type="radio" name="onlyone" value="0" <?php if ($row['onlyone']==0) echo "checked='1'";?>> 不是</label>
- </td>
- </tr>
- </table>
- <table width="98%" id="adset" cellpadding="3" cellspacing="1" align="center" class="table maintable" style="display:none">
- <tr>
- <td>模型字段配置(可视化模式)</td>
- <td><button type="button" name="fset" id="fset" onClick="location.href='mychannel_field_add.php?id=<?php echo $id;?>'" class="btn btn-success btn-sm">添加新字段</button></td>
- </tr>
- <tr>
- <td colspan="2" class="p-0">
- <table width="100%" cellpadding="1" cellspacing="1" align="center">
- <tr bgcolor="#fbfce2" align="center">
- <td width="28%" class="border-top-0">表单提示文字</td>
- <td width="18%" class="border-top-0">数据字段名</td>
- <td width="20%" class="border-top-0">数据类型</td>
- <td width="18%" class="border-top-0">表单类型</td>
- <td>操作</td>
- </tr>
- <?php
- if ($row['issystem']==-1)
- {
- ?>
- <tr>
- <td colspan='5'>aid 和 typeid 是强制使用字段,这里不列出</td>
- </tr>
- <?php
- } else {
- ?>
- <tr>
- <td colspan='5'>下面列出的字段是附加表的字段,除此外,它还包含主表archives的所有字段</td>
- </tr>
- <?php
- }
- $ds = file(DEDEADMIN."/inc/fieldtype.txt");
- foreach($ds as $d){
- $dds = explode(',',trim($d));
- $fieldtypes[$dds[0]] = $dds[1];
- }
- $fieldset = stripslashes($row['fieldset']);
- $dtp = new DedeTagParse();
- $dtp->SetNameSpace("field","<",">");
- $dtp->LoadSource($fieldset);
- if (is_array($dtp->CTags)){
- foreach($dtp->CTags as $ctag)
- {
- ?>
- <tr align="center" onmousemove="javascript:this.bgColor='#fbfce2';" onmouseout="javascript:this.bgColor='#ffffff';">
- <td>
- <?php
- $itname = $ctag->GetAtt('itemname');
- if ($itname=='') echo "没指定";
- else echo $itname;
- ?>
- </td>
- <td><?php echo $ctag->GetTagName();?></td>
- <td>
- <?php
- $ft = $ctag->GetAtt('type');
- if (isset($fieldtypes[$ft])) echo $fieldtypes[$ft];
- else echo "系统专用类型";
- ?>
- </td>
- <td>
- <?php
- $ft = $ctag->GetAtt('autofield');
- if ($ft=='' || $ft==0) {
- echo "固化字段";
- } else {
- echo "自动表单";
- }
- ?>
- </td>
- <td>
- <?php
- if ($ft==1)
- {
- ?>
- <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>
- <?php if ($row['issystem']!=1){?>
- <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>
- <?php }?>
- <?php
- } else {
- echo "禁止修改";
- }
- ?>
- </td>
- </tr>
- <?php
- }
- }
- ?>
- </table>
- </td>
- </tr>
- <tr>
- <td width="30%">模型字段配置(文本模式)<br>
- 修改配置文本可调整字段顺序,但不会修改字段属性</td>
- <td width="70%"><textarea name="fieldset" id="fieldset" class="biz-textarea"><?php echo stripslashes($row['fieldset']);?></textarea></td>
- </tr>
- </table>
- <table width="98%" cellpadding="3" cellspacing="1" align="center" class="table maintable mt-3 mb-3">
- <tr>
- <td colspan="2" bgcolor="#f8f8f8" align="center" class="py-2">
- <button type="submit" class="btn btn-success btn-sm">保存</button>
- <button type="button" onClick="location='mychannel_main.php';" class="btn btn-success btn-sm">返回</button>
- </td>
- </tr>
- </table>
- </form>
- <?php
- if (!empty($openfield))
- {
- echo "<script>ShowItem2();</script>";
- }
- ?>
- </body>
- </html>
|