<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
            <title>{{$lang.admin_title}}</title>
            <script type="text/javascript" src="{{$js_path}}global.js"></script>
            <script type="text/javascript" src="{{$admin_js_path}}admin.js"></script>
            <link href="{{$style_path}}main.css" rel="stylesheet" type="text/css" />
            <base target="_self" />
            <script language="javascript">

                var doc = window.dialogArguments;
                function writeParent(sUrl)
                {
                    if(doc != null)
                    {
                        doc.fnInsertLocalImage(sUrl);
                        alert('{{$lang.js_notice_image_insert_ok}}');
                    }
                    else
                    {
                        window.opener.fnInsertLocalImage(sUrl);
                        alert('{{$lang.js_notice_image_insert_ok}}');
                    }
                }
            </script>
    </head>
    <body>
        <div class="layout">
            <!-- 当前所在位置和相关链接 -->
            <div class="location_nav">
                <!-- 当前所在位置 -->
                <div class="location_link">
                    <ol id='breadcrumb'>
                        {{foreach from=$location_link item=link name=link}}
                        <li>{{$link}}{{if !$smarty.foreach.link.last}}&nbsp;&gt;&nbsp;{{/if}}</li>
                        {{/foreach}}
                    </ol>
                </div>
                <!-- 相关链接 -->
                <div class="location_other">
                    {{foreach from=$location_other item=other_link}}
                    {{$other_link}}&nbsp;
                    {{/foreach}}
                </div>
            </div>

            <!-- 添加目录标题行 -->
            <div class="title_bgcolor">
                <span>{{$lang.title_upload_image}}</span>
            </div>
            <!-- 添加目录表单 -->
            <div style="height:50px;">
                <p style="margin-top:10px;">
                    <form name="form1" action="{{$current_page_url}}" enctype="multipart/form-data" method="post">
                        <input type="hidden" name="MAX_FILE_SIZE" value="2000000">
                            <strong>{{$lang.title_upload_image}}</strong>
                            {{$lang.label_pic_name}}:
                            &nbsp;<input class="input_style" name="text_pic_name" type="text"  size="15"/>
                            &nbsp;<input class="input_style" name="upfile" type="file" maxlength="0" size="1"/>
                            <input type="submit" name="sub_upload_file" class="button" value="{{$lang.tab_start_upload}}">
                                </p></form>
                                </div>
                                <!-- 目录列表标题行 -->
                                <div class="title_bgcolor">
                                    <span>{{$lang.title_pic_list}}：{{$cate_dir}}</span>
                                </div>
                                <!-- 目录列表 -->
                                <div class="div_li_data">
                                    <form style="margin-top:0px;" action="content.php?act=tag" method="post">
                                        <ul class="data_list" id="tag_box">
                                            {{foreach from=$pic_list item=pic}}
                                            <li>
                                                <div>
                                                    <div>
                                                        <!-- 如果是从写博客页面跳过来，用来选择图片的则执行下面的代码 -->
                                                        {{if $select_func}}
                                                        <a href="javascript:;" border="0" onclick="writeParent('{{$base_root_url}}/{{$pic.middle_pic}}');">
                                                            <img src="{{$base_root_url}}/{{$pic.small_pic}}" width="160" height="160">
                                                        </a>
                                                        <a href="javascript:;" border="0" onclick="writeParent('{{$base_root_url}}/{{$pic.small_pic}}');">
                                                            {{$lang.label_small_img}}
                                                        </a>
                                                        <a href="javascript:;" border="0" onclick="writeParent('{{$base_root_url}}/{{$pic.middle_pic}}');">
                                                            {{$lang.label_middle_img}}
                                                        </a>
                                                        <a href="javascript:;" border="0" onclick="writeParent('{{$base_root_url}}/{{$pic.original_pic}}');">
                                                            {{$lang.label_original_img}}
                                                        </a>
                                                        {{else}}
                                                        <a href="{{$base_root_url}}/{{$pic.original_pic}}" border="0" target="_blank">
                                                            <img src="{{$base_root_url}}/{{$pic.small_pic}}" width="160" height="160">
                                                        </a>
                                                        {{/if}}
                                                    </div>
                                                    <div>
                                                        {{$pic.pic_name}}
                                                        <a href="{{$current_page_url}}&mod=del&pic_id={{$pic.pic_id}}" border="0">
                                                            <img src="{{$base_root_url}}/images/delete.png">
                                                        </a>
                                                        <br>
                                                            <a href="{{$base_root_url}}/{{$pic.original_pic}}" border="0" target="_blank">
                                                                ({{$pic.upload_time|date_format:"%Y-%m-%e %T"}})
                                                            </a>


                                                    </div>
                                                </div>
                                            </li>
                                            {{/foreach}}
                                        </ul>
                                        <div>&nbsp;</div>
                                    </form>
                                </div>
                                <div class="sabrosus" id="local_page" style="text-align:right;">
                                    {{$page}}
                                </div>
                                </div>
                                </body>
                                <!-- 加载分页的样式 -->
                                <script type="text/javascript">
                                    var sSpan = $('local_page').childNodes;
                                    var iNum  = sSpan.length;
                                    for (i = 0; i < iNum; i++) {
                                        if (sSpan[i].tagName == 'SPAN') {
                                            sSpan[i].className += 'current';
                                        }
                                    }
                                </script>
                                </html>