<%@ Page Language="c#" Inherits="Web.Wpdcc.manageMenu" CodeBehind="manageMenu.aspx.cs" %>
<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>mainMenu</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file = "../Css/head.htm" -->
</head>
<body>
    <div class="main-content-inner">
        <form id="mainMenu" method="post" runat="server">
        <!-- #section:basics/content.breadcrumbs -->
        <div class="breadcrumbs" id="breadcrumbs">
            <script type="text/javascript">
                try { ace.settings.check('breadcrumbs', 'fixed') } catch (e) { }
            </script>
            <ul class="breadcrumb">
                <li>
                    <i class="ace-icon fa  fa-desktop"></i>
                    <a href="welcome.aspx">主页</a>
                </li>
                <li>网站布局管理
                </li>
                <li>
                    <asp:DataList ID="menuNav" runat="server" RepeatDirection="Horizontal" 
                    RepeatLayout="Flow" onitemcommand="menuNav_ItemCommand" >
                    <ItemTemplate>
                        <asp:Label ID="menuPkIdName" runat="server" Visible="False">Label</asp:Label>
                        <asp:LinkButton ID="menuName" runat="server" CommandName="nav" ForeColor="blue">LinkButton</asp:LinkButton>
                    </ItemTemplate>
                    <SeparatorTemplate>
                        &nbsp;&gt;&nbsp;
                    </SeparatorTemplate>
                </asp:DataList>
                    </li>
            </ul>
            <a href="manageMenuTree.aspx" class="btn btn-primary btn-xs pull-right" style="margin:5px 15px 0 0;">
												<i class="ace-icon glyphicon glyphicon-refresh align-top bigger-125"></i>
												切换到菜单模式</a>
            <!-- /.breadcrumb -->

            <!-- /section:basics/content.searchbox -->
        </div>
        <!-- /section:basics/content.breadcrumbs -->
        <div class="page-content">
            <div class="row">
                <div class="col-xs-12">
                    <!-- PAGE CONTENT BEGINS -->
    <div class="list-func-box func-box">
        <div class="bd">
            <div class="page-header clearfix">
                            <div class="action-field">
                    <asp:Button ID="saveGrid" class="btn btn-sm btn-primary" runat="server" Text="保 存" OnClick="saveGrid_Click"></asp:Button>&nbsp;
                    <asp:Button ID="btnAdd" runat="server" Text="添 加" CssClass="btn btn-sm btn-primary" Visible="false" />
                    <asp:Button ID="itemEdit" runat="server" Text="栏目选择" CssClass="btn btn-sm btn-primary" Visible="false"></asp:Button>&nbsp;
                    <asp:Button ID="effect" runat="server" Text="效果查看" CssClass="btn btn-sm btn-primary" Visible="false" ></asp:Button>
                </div>
            </div>
            <div class="function-bd" style="height:580px;">
            <!--[if lte IE 7]><div style="zoom:1"><![endif]-->
            <asp:DataGrid ID="menu" runat="server" class="table table-striped table-bordered table-hover" AutoGenerateColumns="False" onitemcommand="menu_ItemCommand" >
                <Columns>
                    <asp:BoundColumn DataField="pkId" HeaderText="ID" HeaderStyle-CssClass="title"></asp:BoundColumn>
                    <asp:BoundColumn DataField="name" HeaderText="名称" HeaderStyle-CssClass="title"></asp:BoundColumn>
                    <asp:BoundColumn DataField="remark" HeaderText="备注" HeaderStyle-CssClass="title"></asp:BoundColumn>
                    <asp:BoundColumn DataField="mode" HeaderText="生成模式" HeaderStyle-CssClass="title"></asp:BoundColumn>
                    <asp:TemplateColumn Visible="False" HeaderText="位置" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="position" runat="server" DataValueField="NumField" DataTextField="ItemField" CssClass="input-md" Width="110"
                                DataSource="<%# positionDv %>">
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn Visible="False" HeaderText="导航" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:CheckBox ID="navigate" Text=" " runat="server" Checked='<%# Eval("navigate").ToString() == "0" ? false : true %>' />
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="顺序" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:TextBox ID="gridOrder" runat="server" CssClass="input-md w2" Text='<%# DataBinder.Eval(Container, "DataItem.ordering") %>'></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="显示模式" HeaderStyle-CssClass="title" >
                        <ItemTemplate>
                            <asp:DropDownList ID="gateGrid" runat="server" SelectedIndex='<%# DataBinder.Eval(Container, "DataItem.gate") %>' CssClass="input-md" Width="80">
                                <asp:ListItem Value="0" Selected="True">无限制</asp:ListItem>
                                <asp:ListItem Value="1">内网</asp:ListItem>
                                <asp:ListItem Value="2">外网</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn Visible="False" HeaderText="更多页模板" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="moreItem" runat="server" DataTextField="name" DataValueField="pkId" CssClass=""input-md" Width="160"></asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn Visible="False" HeaderText="新闻页模板" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="NewsInfoItemDropDownList" runat="server" DataTextField="name" DataValueField="pkId" CssClass="input-md" Width="160"></asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn Visible="False" HeaderText="栏目模板" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="artDesignDropDownList" runat="server" DataTextField="name" DataValueField="pkId" CssClass="input-md" Width="100"></asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn DataField="grade" HeaderText="显示等级" HeaderStyle-CssClass="title"></asp:BoundColumn>
                    <asp:TemplateColumn HeaderText="显示根菜单中" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="displayRoot"  CssClass="input-md" Width="50"  runat="server" SelectedIndex='<%# DataBinder.Eval(Container, "DataItem.displayRoot") %>'>
                                <asp:ListItem Value="0">否</asp:ListItem>
                                <asp:ListItem Value="1" Selected="True">是</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="执行" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <div class="action-buttons">
                            <a href='manageMenuEditor.aspx?pkId=<%# Eval("pkId") %>'class="FBox" data-toggle="tooltip" data-placement="bottom" title="编辑"><i class="ace-icon fa fa-pencil bigger-120 blue" ></i></a>
                            <asp:LinkButton ID="manage" runat="server" Visible="False" CommandName="manage" data-toggle="tooltip" data-placement="bottom" title="管理子栏目"><i class="ace-icon fa fa-list-ul bigger-120 purple" ></i></asp:LinkButton>
                            <asp:LinkButton ID="subchannel" runat="server"  Visible="False" CommandName="subchannel" data-toggle="tooltip" data-placement="bottom"  title="管理子频道"><i class="ace-icon fa  fa-sitemap bigger-120 purple" ></i></asp:LinkButton>
                            <asp:LinkButton ID="insert" runat="server" Visible="False" CommandName="insert" data-toggle="tooltip" data-placement="bottom"  title="管理子菜单"><i class="ace-icon fa fa-book bigger-120 purple" ></i></asp:LinkButton>
                            <asp:LinkButton ID="del" runat="server"  CommandName="del" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.name") %>' data-toggle="tooltip" data-placement="bottom"  title="删除"><i class="ace-icon fa fa-trash-o bigger-120 red" ></i></asp:LinkButton>
                        </div>
                                </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn Visible="False" DataField="itemId" HeaderText="position" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:BoundColumn Visible="False" DataField="layoutTemplateId" HeaderText="layoutTemplateId" HeaderStyle-CssClass="title"></asp:BoundColumn>
                    <asp:BoundColumn Visible="False" DataField="address" HeaderText="address" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:BoundColumn Visible="False" DataField="newsTemplateId" HeaderText="newInfo" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:BoundColumn Visible="False" DataField="artDesignTemplateId" HeaderText="artDesignTemplateId" HeaderStyle-CssClass="title"></asp:BoundColumn>
                    <asp:BoundColumn Visible="False" DataField="modeId" HeaderText="modeId" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                </Columns>
            </asp:DataGrid>
            <!--[if lte IE 7]></div><![endif]-->
            </div><!--/function-bd-->
            <%--<input id="localAddress" type="hidden" runat="server" />--%>
        </div>
        
    </div>     
  <!-- PAGE CONTENT ENDS -->
                </div>
            </div>
        </div>
        <!-- /.page-content -->
            </form>
    </div>
    
    <!--#include file = "../Css/foot.htm" -->
    <script type="text/javascript" language="javascript">

        jQuery(function ($) {

            //编辑
            $(".FBox").click().fancybox({
                'width': 750,
                'height': 450,
                'hideOnOverlayClick': false,
                'padding': '0',
                'type': 'iframe'
            });

            //新增布局
            $("#btnAdd").click(function () {
                return true;
            }).fancybox({
                'width': 600,
                'height': 350,
                'hideOnOverlayClick': false,
                'type': 'iframe',
                'padding': '0',
                'href': 'manageMenuEditor.aspx?parentid=<%= parentId %>&mode=0'
            });
            //栏目选择
            $("#itemEdit").click(function () {
                return true;
            }).fancybox({
                'width': 520,
                'height': 470,
                'hideOnOverlayClick': false,
                'type': 'iframe',
                'padding': '0',
                'href': 'selectItem.aspx?parentId=<%= parentId %>&mode=1'
            });
        });

        //    //栏目选择
        //    function selectItem(parentid){
        //        var arr = showModalDialog("selectItem.htm?parentId="+parentid, window, "dialogWidth:500px;dialogHeight:420px;help:no;scroll:no;status:no");
        //	    if(arr!=null)
        //	    {
        //	        location.href="manageMenu.aspx?parentId="+arr+"&istype=2";
        //	    }
        //    }
        //频道模板预览
        function preview(template) {
            window.open("../previewEffect.aspx?pkId=" + template, "", "left=400,top=100,width=800,height=550,status=1,resizable=1,scrollbars=1");
        }
        //频道效果预览
        function effectPreview(pkId) {
            window.open("../index.aspx?pkId=" + pkId, "", "left=400,top=100,width=800,height=550,status=1,resizable=1,scrollbars=1");
        }
    </script>
</body>
</html>
