<?php defined('PHPNEW_STATIC_TPL') === false && exit(URL_HOST);?>
<div>
<!--{if $editor}-->
<style type="text/css">
    #codeshow{display: none;}
    #codeshow div{ width: 823px; background-color: white; overflow: hidden; margin-bottom: 8px;}
</style>
<script type="text/javascript">
    function codedisplay(show){
        if(show == 1){
            $('#codeshow').show();
            $('#codeshow div').eq(0).html($('#addcode textarea').val());
            $('#addcode').hide();
            return false;
        }else{
            $('#codeshow').hide();
            $('#addcode').show();
            return false;
        }
    }
    var types = '{$data[types]}';
    $(function (){
        $('select option[value="'+types+'"]').attr('selected',true);
    })
</script>
    <div style="margin-left: 8px; margin-top: 8px;">
        <form method="post" enctype="application/x-www-form-urlencoded">
        <div id="addcode">
        <select name="types" style="border: 1px solid silver; padding: 1px;">
            <!--{loop $type_arr $key $val}-->
            <option value="{$key}">{$val}</option>
            <!--{/loop}-->
        </select>
        <input type="text" name="vars" value="{$data[vars]}" style="width: 280px;"  /> <input type="text" style="width: 380px;" name="tags" value="{$data[tags]}" /> 
        <textarea name="codes" style="width: 823px; border: 2px solid silver; padding-right: 3px; height: 520px; margin-top: 3px;font-size: 12px; color: #636363; margin-bottom: 8px;">{$data[codes]}</textarea><br />
        <span style="color: gray;">* 支持html及javascript代码, 任何网页显示信息均可支持</span> <br /><br />
        <input type="submit" value="保存" />　<input type="submit" onclick="return codedisplay(1);" value="预览" /> 　<input type="submit" onclick="js_header('./index.php?admincp=allcode.html');return false"  value="返回" />
        </div>
        </form>
        
        <div id="codeshow">
            <div>
            </div>
            <input type="submit" onclick="return codedisplay(2);" value="编辑" /><br /><br />
        </div>
    </div>
<!--{else}-->
<style type="text/css">
    .my_table td{line-height: 30px; padding-left: 4px; color: #3F3F3F; border-bottom: 1px solid {$c1};}
    .my_table th{border: 1px solid {$c1};}
    .ta{$default_get[types]}{ font-weight: bolder;}
    .tr_color{background-color: #EEF5F9;}
    .my_table .hot_td{color: #0080FF;}
</style>
<table class="my_table" style="width: 100%; background-color: white;">
    <tr class="admin_list">
        <th style="width: 80px;">类型</th>
        <th style="width: 150px;">变量名</th>
        <th>说明</th>
        <th style="width: 70px;">代码量</th>
        <th style="width: 80px;">操作</th>
    </tr>
    <!--{loop $get_var $key $val}-->
    {eval $i++; $t = $i % 2 === 0?'color':'clear';}
    <tr class="tr_{$t}">
        <td>{$val[types]}</td>
        <td class="hot_td">{$val[vars]}</td>
        <td>{$val[tags]}</td>
        <td>{$val[size]}</td>
        <td> <a href="./index.php?admincp=allcode&editor={$key}.html">编辑</a> / <a href="./index.php?admincp=allcode&delete={$key}.html" {GET_ALERT}>删除</a></td>
    </tr>
    <!--{/loop}-->
    <!--{if !$get_var}-->
    <tr>
        <td colspan="20" style="text-align: center;">暂时没有信息, <input type="submit" onclick="js_header('./index.php?admincp=allcode&editor.html')" value="新建一个" /></td>
    </tr>
    <!--{else}-->
         <tr>
         <td colspan="3">{$page_list}</td>
        <td colspan="2" style="text-align: right;"> <input type="submit" onclick="js_header('./index.php?admincp=allcode&editor.html')" value="新建一个" /></td>
    </tr>
    <!--{/if}-->
     <tr>
        <td colspan="20" style="text-align: left;">
        <strong>使用说明:</strong><br />
        　1: 此功能对于二次开发自定义很有帮助.<br />
        　2: 系统变量默认是禁止创建新变量, 所有类型均不许可创建Hook_字样变量. <br />
        　3: 变量名, 说明均有文字长度限制, 本功能压力未全面测试, 请注意.<br />
        　4: <span style="color: red;">此功能更偏向开发人员, 请小心操作!</span>
        
        </td>
    </tr>
</table>
<!--{/if}-->
</div>