<%@ Control Language="C#" AutoEventWireup="true" CodeFile="template.ascx.cs" Inherits="bitrix_components_bitrix_photogallery_photo_templates__default_template" %>
<%@ Reference VirtualPath="~/bitrix/components/bitrix/photogallery.photo.edit/component.ascx"  %>
<% if(Component.CanModify){ %>
<table width="100%">
    <tr>
        <td colspan="2">
            <bx:BXValidationSummary ID="validationSummary" runat="server" 
                CssClass="errorSummary" HeaderText="<%$ Loc:Kernel.Error %>"
                BorderColor="Red" BorderStyle="Solid" BorderWidth="1px" />        
        </td>
    </tr>
    <tr>
        <td align="right" valign="middle">
            <%= GetMessage("Legend.Title") %><span style=" color:Red;">*</span>:
        </td>
        <td align="left">
            <asp:TextBox ID="AlbumTitle" runat="server" ></asp:TextBox>
            <asp:RequiredFieldValidator runat="server" ID="valTitle" ControlToValidate="AlbumTitle" ErrorMessage="<%$ Loc:Error.TitleIsRequired %>">*</asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td width="40%"  align="right"  valign="top">
            <%= GetMessage("Legeng.Albums") %></td>
        <td width="60%"  align="left">
            <asp:DropDownList ID="lbSections" Rows="15" SelectionMode="Multiple" runat="server"></asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td colspan="2" align="center">
            <%= GetMessage("Legend.Description") %><br />
            <asp:TextBox ID="AlbumDescription" runat="server" TextMode="MultiLine" Rows="10" Width="100%"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td align="left" valign="middle" colspan="2">
            <%--<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="<%$ Loc:Kernel.Save %>" /> <%= GetMessage("Or") %> <a href="<%= Component.BackUrl %>" EnableAjax="true"><%= GetMessage("Cancel") %></a>--%>
            <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="<%$ Loc:Kernel.Save %>" Width="100px" UseSubmitBehavior="false" CausesValidation="true" />
            <asp:Button ID="Button2" runat="server"  Text="<%$ Loc:Cancel %>" UseSubmitBehavior="false"  OnClientClick="GoBack(); return false;" Width="100px" CausesValidation="false" />
        </td>
    </tr>
</table>
<script type="text/javascript" language="javascript">
    window.GoBack = function()
    {
        window.location.href = "<%= Component.BackUrl %>";
    }
</script>
<%} else { %>
    <%= GetMessage("YouDontHaveRightsToPerformThisAction") %> <a href="<%= Component.BackUrl %>" EnableAjax="true"><%= GetMessage("Return") %></a>
<%} %>