www.gusucode.com > 网猫影视系统NetMao Movie 4.6.6 开源版源码程序 > upload/admin/tpl/templates.tpl.php
<?php if(!defined('IN_NetMao')) exit('Access Denied'); ?> <? if($action == 'templates' && !$edit){ ?> <table cellpadding="0" cellspacing="0" border="0" width="100%" height="10"> <tr> <td ></td> </tr> </table> <table cellpadding="2" cellspacing="1" border="0" align=center class="tableBorder"> <tr> <td class="tablerow">当前操作 > 模板编辑</td> </tr> </table> <table cellpadding="0" cellspacing="0" border="0" width="100%" height="10"> <tr> <td ></td> </tr> </table> <table width="100%%" cellpadding="2" cellspacing="1" class="tableborder"> <form method="post" action="?action=templates"> <tr> <th colspan=5>模板编辑</th> </tr> <tr> <td class="tablerowhighlight"> <input type="checkbox" name="chkall" class="header" onclick="checkall(this.form)"> 删</td> <td class="tablerowhighlight">模板名称</td> <td class="tablerowhighlight">所在目录</td> <td class="tablerowhighlight">版权信息</td> <td class="tablerowhighlight">编辑</td> </tr> <? if(is_array($tpls))foreach($tpls AS $tpl){ ?> <tr onmouseout="this.style.backgroundColor='#F1F3F5'" onmouseover="this.style.backgroundColor='#CEEAD3'" bgColor='#F1F3F5'> <td height="25"><input type="checkbox" name="delete[]" <? if($tpl[templateid]==1){echo 'disabled';}else{echo '';} ?> value="<?=$tpl[templateid]?>"></td> <td><input type="text" size="10" name="namenew[<?=$tpl[templateid]?>]" value="<?=$tpl[name]?>"></td> <td><input type="text" size="25" name="directorynew[<?=$tpl[templateid]?>]" value="<?=$tpl[directory]?>"></td> <td><?=$tpl[copyright]?></td> <td><a href="?action=templates&edit=<?=$tpl[templateid]?>">[详细]</a></td> </tr> <? } ?> <tr onmouseout="this.style.backgroundColor='#F1F3F5'" onmouseover="this.style.backgroundColor='#CEEAD3'" bgColor='#F1F3F5'> <td height="25">新增</td> <td> <input type="text" size="10" name="newname"> </td> <td> <input type="text" size="25" name="newdirectory"> </td> <td> <input type="text" size="25" name="newcopyright"> </td> <td> </td> </tr> <tr> <td colspan="7" bgcolor="#E1E1E1"> <input type="submit" name="tplsubmit" value=" 提 交 "> </td> </tr> </form> </table> <? }elseif($action == 'templates' && $edit) { ?> <table cellpadding="0" cellspacing="0" border="0" width="100%" height="10"> <tr> <td ></td> </tr> </table> <table cellpadding="2" cellspacing="1" border="0" class="tableBorder"> <tr> <td class="tablerow">当前操作 > 模板维护</td> </tr> </table> <table cellpadding="0" cellspacing="0" border="0" width="100%" height="3"> <tr> <td ></td> </tr> </table> <table cellpadding="2" cellspacing="1" class="tableborder"> <tr> <th colspan=3>模板维护 - <?=$template['name']?> </th> </tr> <form method="post" action="?action=tpladd&edit=<?=$edit?>"> <tr> <td width="100" bgcolor="#F1F3F5">添加文件</td> <td width="200" align="center" bgcolor="#F1F3F5"><input type="text" name="name" size="40" maxlength="40"></td> <td bgcolor="#F1F3F5"> <select name="type"> <option value="tpl" selected>模板文件</option> <option value="ctrl">控制文件</option> <option value="js">脚本文件</option> </select> <input name="submit" type="submit" value=" 提 交 "></td> </tr> </form> <form method="get" action="nmadmin.php"> <input type="hidden" name="action" value="templates"> <input type="hidden" name="edit" value="<?=$edit?>"> <tr> <td width="100" bgcolor="#F1F3F5"> 搜索模板内容</td> <td width="200" align="center" bgcolor="#F1F3F5"><input type="text" name="keyword" size="40"></td> <td bgcolor="#F1F3F5"> <input name="submit" type="submit" value=" 提 交 "></td> </tr> </form> </table> <table cellpadding="0" cellspacing="0" border="0" width="100%" height="10"> <tr> <td ></td> </tr> </table> <table cellpadding="2" cellspacing="1" class="tableborder"> <tr> <th>选择模板<?=$keywordadd?></th> </tr> <tr> <td class="tablerow"> <ul> <li><b>NetMao 语言包</b></li> <? if(is_array($langarray)) foreach($langarray as $langpack){ ?> <ul><li><?=$langpack?> <a href="?action=tpledit&templateid=<?=$template[templateid]?>&fn=<?=$langpack?>.lang.php">[编辑]</a></ul> <? } ?> <li><b>NetMao 模板文件</b> <? if(is_array($tplarray)) if(is_array($tplarray)) foreach($tplarray as $tpl => $subtpls) { ?> <ul><li><b><?=$tpl?></b> <? foreach($subtpls as $subtpl){ ?> <ul><li><?=$subtpl?> <a href="?action=tpledit&templateid=<?=$template[templateid]?>&fn=<?=$subtpl?>.htm&keyword=<?=$keywordenc?>">[编辑]</a> <a href="?action=tpledit&templateid=<?=$template[templateid]?>&fn=<?=$subtpl?>.htm&delete=yes">[删除]</a></ul> <? } ?> </ul> <? } ?> <li><b>NetMao 脚本文件</b> <? if(is_array($jsarray)) foreach($jsarray as $jspack){ ?> <ul><li><?=$jspack?> <a href="?action=tpledit&templateid=<?=$template[templateid]?>&fn=<?=$jspack?>.js">[编辑]</a> <a href="?action=tpledit&templateid=<?=$template[templateid]?>&fn=<?=$jspack?>.js&delete=yes">[删除]</a></ul> <? } ?> <li><b>NetMao 控制文件</b></li> <? if(is_array($ctrlarray)) foreach($ctrlarray as $ctrlpack){ ?> <ul><li><?=$ctrlpack?> <a href="?action=tpledit&templateid=<?=$template[templateid]?>&fn=<?=$ctrlpack?>.ctrl.php">[编辑]</a> <a href="?action=tpledit&templateid=<?=$template[templateid]?>&fn=<?=$ctrlpack?>.ctrl.php&delete=yes">[删除]</a></ul> <? } ?> </ul> </td> </tr> </table> <? }elseif($action == 'tpledit'){ ?> <script language="JavaScript"> var n = 0; function displayHTML(obj) { win = window.open(" ", 'popup', 'toolbar = no, status = no, scrollbars=yes'); win.document.write("" + obj.value + ""); } function HighlightAll(obj) { obj.focus(); obj.select(); if (document.all) { obj.createTextRange().execCommand("Copy"); window.status = "将模板内容复制到剪贴板"; setTimeout("window.status=''", 1800); } } function findInPage(obj, str) { var txt, i, found; if (str == "") { return false; } if (document.layers) { if (!obj.find(str)) { while(obj.find(str, false, true)) { n++; } } else { n++; } if (n == 0) { alert("未找到指定字串。"); } } if (document.all) { txt = obj.createTextRange(); for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) { txt.moveStart('character', 1); txt.moveEnd('textedit'); } if (found) { txt.moveStart('character', -1); txt.findText(str); txt.select(); txt.scrollIntoView(); n++; } else { if (n > 0) { n = 0; findInPage(str); } else { alert("未找到指定字串。"); } } } return false; } </script> <table cellpadding="0" cellspacing="0" border="0" width="100%" height="10"> <tr> <td></td> </tr> </table> <table cellpadding="2" cellspacing="1" border="0" align=center class="tableBorder"> <tr> <td class="tablerow">当前操作 > 模板编辑</td> </tr> </table> <table cellpadding="0" cellspacing="0" border="0" width="100%" height="10"> <tr> <td></td> </tr> </table> <table cellpadding="2" cellspacing="1" class="tableborder"> <tr> <th>编辑模板 - <?=$template['name']?> <?=$fn?> </th> </tr> <form name="myform" method="post" action="?action=tpledit&templateid=<?=$templateid?>&fn=<?=$fn?>"> <input type="hidden" name="keyword" value="<?=$keywordenc?>"> <tr> <td class="tablerow"> <textarea cols="160" rows="30" name="templatenew"><?=$content?></textarea> </td> </tr> <tr bgcolor="#E1E1E1"> <td> <input name="search" type="text" accesskey="t" size="25" onChange="n=0;"> <input name="button" type="button" accesskey="f" onClick="findInPage(this.form.templatenew, this.form.search.value)" value=" 搜 索 "> <input name="button" type="button" accesskey="e" onClick="history.go(-1)" value=" 返 回 "> <input name="button" type="button" accesskey="p" onClick="displayHTML(this.form.templatenew)" value=" 预 览 "> <input name="button" type="button" accesskey="c" onClick="HighlightAll(this.form.templatenew)" value=" 复 制 "> <input type="submit" name="editsubmit" value=" 提 交 "> </td> </tr> </form> </table> <? } ?>