<%@ Page Language="C#" MasterPageFile="~/bitrix/admin/AdminMasterPage.master" AutoEventWireup="true" CodeFile="IBlockElementEdit.aspx.cs" Inherits="bitrix_admin_IBlockElementEdit" Title="<%$ LocRaw:PageTitle %>" ValidateRequest="false" %>

<%@ Register Src="~/bitrix/admin/controls/Main/AdminImageField.ascx" TagName="AdminImageField" TagPrefix="uc2" %>
<%@ Register Src="~/bitrix/controls/Main/TimeInterval.ascx" TagName="TimeInterval" TagPrefix="ti" %>
<%@ Register Src="~/bitrix/controls/Main/CustomFieldList.ascx" TagName="CustomFieldList" TagPrefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
			<%  
				GoToListButton.Href = String.Concat("IBlockListAdmin.aspx?iblock_id=", iblockId, "&type_id=", typeId, redirectSectionId >= 0 ? "&filter_sectionid=" + redirectSectionId : String.Empty);
				AddButton.Href = String.Concat("IBlockElementEdit.aspx?iblock_id=", iblockId, "&type_id=", typeId, redirectSectionId >= 0 ? "&section_id=" + redirectSectionId : String.Empty);		
			%>
			<bx:BXContextMenuToolbar ID="BXContextMenuToolbar1" OnCommandClick="BXContextMenuToolbar1_CommandClick" runat="server">
				<Items>
					<bx:BXCmSeparator SectionSeparator="true" />
					<bx:BXCmImageButton
						CssClass="context-button icon btn_list" ID="GoToListButton" CommandName="go2list"
						Text="" Title=""
					/>
					<bx:BXCmSeparator />
					<bx:BXCmImageButton ID="AddButton"
						CssClass="context-button icon btn_new" CommandName="AddNewElement"
						Text="" Title="" 
					/>
					<bx:BXCmSeparator />
					<bx:BXCmImageButton ID="DeleteButton" 
						CssClass="context-button icon btn_delete" CommandName="DeleteElement"
						Text="" Title=""
						ShowConfirmDialog="true" ConfirmDialogText="<%$ LocRaw:ActionConfirmDialogText.DeleteElement %>"
					/>
				</Items>
			</bx:BXContextMenuToolbar>
			<bx:BXValidationSummary ID="errorMassage" runat="server" CssClass="errorSummary" HeaderText="<%$ Loc:Kernel.Error %>"/>
			<bx:BXMessage ID="successMessage" runat="server" Content="<%$ Loc:Message.Success %>"
				CssClass="ok" IconClass="ok" Title="<%$ Loc:Kernel.Information %>" Visible="False" Width="438px" />
			<asp:HiddenField ID="hfIBlockId" runat="server" />
			<asp:HiddenField ID="hfTypeId" runat="server" />
			<asp:HiddenField ID="hfElementId" runat="server" />
			<bx:BXTabControl ID="BXTabControl1" runat="server" OnCommand="BXTabControl1_Command">
				<bx:BXTabControlTab ID="BXTabControlTab1" runat="server" Selected="True" Text="<%$ LocRaw:TabText.Main %>" Title="<%$ LocRaw:TabTitle.Main %>">
					<table id="Table4" border="0" cellpadding="0" cellspacing="0" class="edit-table">
						<tr valign="top" id="trID" runat="server">
							<td class="field-name" width="40%" runat="server">
								ID:</td>
							<td width="60%" runat="server">
								<asp:Label ID="lbID" runat="server"></asp:Label>
							</td>
						</tr>
						<tr valign="top" id="trUpdateDate" runat="server">
							<td class="field-name" width="40%" runat="server">
								<%= GetMessage("Label.Modified") + ":" %></td>
							<td width="60%" runat="server">
								<asp:Label ID="lbUpdateDate" runat="server"></asp:Label>
							</td>
						</tr>
						<tr valign="top">
							<td class="field-name" width="40%">
								<%= GetMessage("Label.Active") + ":" %></td>
							<td width="60%">
								<asp:CheckBox ID="cbActive" runat="server" />
							</td>
						</tr>
						<tr valign="top">
							<td class="field-name" width="40%">
								<%= GetMessage("Label.Period") + ":" %></td>
							<td width="60%">
								<ti:TimeInterval ID="tiActive" runat="server" />
							</td>
						</tr>
						<tr valign="top">
							<td class="field-name" width="40%">
								<span class="required">*</span><%= GetMessage("Label.Name") + ":" %></td>
							<td width="60%">
								<asp:TextBox ID="tbName" Width="350px" runat="server"></asp:TextBox>
								<asp:RequiredFieldValidator ID="rfvName" runat="server" ControlToValidate="tbName"
									ErrorMessage="<%$ Loc:Message.ElementNameIsRequired %>">*</asp:RequiredFieldValidator>
							</td>
						</tr>
						<%
					if (CustomFieldList1.HasItems)
					{
						%>
						<tr class="heading">
							<td colspan="2">
								<%= GetMessage("Section.CustomProperties") + ":" %>
							</td>
						</tr>
						<%
					}
						%>
					</table>
                    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <uc1:CustomFieldList ID="CustomFieldList1" runat="server" EditMode="false">
                        </uc1:CustomFieldList>
                        </ContentTemplate>
                    </asp:UpdatePanel>
				</bx:BXTabControlTab>
				<bx:BXTabControlTab ID="BXTabControlTab2" runat="server" Text="<%$ LocRaw:TabText.Preview %>" Title="<%$ LocRaw:TabTitle.Preview %>">
					<table id="Table5" border="0" cellpadding="0" cellspacing="0" class="edit-table">
						<tr valign="top">
							<td class="field-name" width="40%">
								<%= GetMessage("Label.Image") + ":" %></td>
							<td width="60%">
								<uc2:AdminImageField ID="PreviewImg" runat="server" ShowDescription="true" MaxImageWidth="400" />
							</td>
						</tr>
						<tr class="heading">
							<td colspan="2">
								<%= GetMessage("Label.PreviewContent") + ":" %>
							</td>
						</tr>
						<tr valign="top">
							<td colspan="2" align="center">
								<asp:RadioButtonList ID="rblPreviewTextType" runat="server" RepeatDirection="Horizontal">
									<asp:ListItem Selected="True" Value="text" Text="<%$ Loc:Option.Text %>" />
									<asp:ListItem Value="html" Text="Html" />
								</asp:RadioButtonList>
								<asp:TextBox ID="tbPreviewText" runat="server" Columns="60" Rows="15" TextMode="MultiLine" Width="100%"></asp:TextBox>
								<bx:BXWebEditor ID="bxwePreviewText" runat="server" 
									Width="100%" Height="400px"
									StartModeSelector="True"
									StartMode="HTMLVisual"
									UseHTMLEditor="False" AutoLoadContent="True" ContentType="Text" FullScreen="False" LimitCodeAccess="False" TemplateId="" UseOnlyDefinedStyles="False" WithoutCode="False">
								<Taskbars>
									<bx:BXWebEditorBar Name="BXPropertiesTaskbar" />
								</Taskbars>
								<Toolbars>
									<bx:BXWebEditorBar Name="manage" />
									<bx:BXWebEditorBar Name="standart" />
									<bx:BXWebEditorBar Name="style" />
									<bx:BXWebEditorBar Name="formating" />
									<bx:BXWebEditorBar Name="source" />
									<bx:BXWebEditorBar Name="table" />
								</Toolbars>
								</bx:BXWebEditor>
							</td>
						</tr>
					</table>
				</bx:BXTabControlTab>
				<bx:BXTabControlTab ID="BXTabControlTab3" runat="server" Text="<%$ LocRaw:TabText.Detail %>" Title="<%$ LocRaw:TabTitle.Detail %>">
					<table id="Table6" border="0" cellpadding="0" cellspacing="0" class="edit-table">
						<tr valign="top">
							<td class="field-name" width="40%">
								<%= GetMessage("Label.Image") + ":" %></td>
							<td width="60%"><uc2:AdminImageField ID="DetailImg" runat="server" ShowDescription="true" MaxImageWidth="400" />
							</td>
						</tr>
						<tr valign="top">
							<td colspan="2" align="center">
								<asp:RadioButtonList ID="rblDetailTextType" runat="server" RepeatDirection="Horizontal">
									<asp:ListItem Selected="True" Value="text" Text="<%$ Loc:Option.Text %>" />
									<asp:ListItem Value="html" Text="Html" />
								</asp:RadioButtonList>
								<asp:TextBox ID="tbDetailText" runat="server" Columns="60" Rows="15" TextMode="MultiLine" Width="100%"></asp:TextBox>
								<bx:BXWebEditor ID="bxweDetailText" runat="server" 
									Width="100%" Height="400px"
									StartModeSelector="True"
									StartMode="HTMLVisual"
									UseHTMLEditor="False" AutoLoadContent="True" ContentType="Text" FullScreen="False" LimitCodeAccess="False" TemplateId="" UseOnlyDefinedStyles="False" WithoutCode="False">
								<Taskbars>
									<bx:BXWebEditorBar Name="BXPropertiesTaskbar" />
								</Taskbars>									
								</bx:BXWebEditor>
							</td>
						</tr>
					</table>
				</bx:BXTabControlTab>
				<bx:BXTabControlTab ID="BXTabControlTab4" runat="server" Text="<%$ LocRaw:TabText.Groups %>" Title="<%$ LocRaw:TabTitle.Groups %>">
					<table id="Table7" border="0" cellpadding="0" cellspacing="0" class="edit-table">
						<tr valign="top">
							<td class="field-name" width="40%">
								<%=GetSectionsName()+":"%></td>
							<td width="60%">
								<asp:ListBox ID="lbSections" Rows="15" SelectionMode="Multiple" runat="server"></asp:ListBox>
							</td>
						</tr>
					</table>
				</bx:BXTabControlTab>
				<bx:BXTabControlTab ID="BXTabControlTab5" runat="server" Text="<%$ LocRaw:TabText.Additional %>" Title="<%$ LocRaw:TabTitle.Additional %>">
					<table id="Table8" border="0" cellpadding="0" cellspacing="0" class="edit-table">
						<tr valign="top">
							<td class="field-name" width="40%">
								<%= GetMessage("Label.SortIndex") + ":" %></td>
							<td width="60%">
								<asp:TextBox ID="tbSort" runat="server"></asp:TextBox>
							</td>
						</tr>
						<tr valign="top">
							<td class="field-name" width="40%">
								<%= GetMessage("Label.MnemonicCode") + ":" %></td>
							<td width="60%">
								<asp:TextBox ID="tbCode" runat="server"></asp:TextBox>
							</td>
						</tr>
						<tr valign="top">
							<td class="field-name" width="40%">
								<%= GetMessage("Label.ExternalCode") + ":" %></td>
							<td width="60%">
								<asp:TextBox ID="tbXmlId" runat="server"></asp:TextBox>
							</td>
						</tr>
						<tr valign="top">
							<td class="field-name" width="40%"><%= GetMessage("Label.Tags") %>:</td>
							<td width="60%">
								<asp:TextBox ID="tbTags" runat="server" Width="250px"></asp:TextBox><br />
								<small><%= GetMessage("Comment.Tags") %></small>
							</td>
						</tr>
					</table>
				</bx:BXTabControlTab>
			</bx:BXTabControl>
</asp:Content>
