<% uicomponent.addInterceptor("ecm-explorer/interceptor/PreNodeSaveInterceptor.groovy", "prev") ; %>

<div class="UIForm FormLayout FormScrollLayout">
  <%
	 uiform.begin()
  %>
  <%/* start render action*/%>
  <% if (uiform.isShowActionsOnTop()) {
            uiform.processRenderAction()
         }
  %>
  <%/* end render action*/%>
  <div class="HorizontalLayout">
   <table class="UIFormGrid">
      <tr>
        <td class="FieldLabel"><label for="title"><%=_ctx.appRes("Article.dialog.label.title")%></label></td>
        <td class="FieldComponent">
        <%
          String[] fieldTitle = ["jcrPath=/node/exo:title", "options=noSanitization", "validate=empty"] ;
          uicomponent.addTextField("title", fieldTitle) ;
        %>
        </td>
      </tr>

			<tr>
			  <td class="FieldLabel"><label for="name"><%=_ctx.appRes("Article.dialog.label.name")%></label></td>
			  <td class="FieldComponent">
			  <%
	        String[] fieldName = ["jcrPath=/node", "options=noSanitization", "mixintype=mix:votable,mix:commentable,mix:i18n,mix:versionable", "editable=if-null", "validate=empty,name"] ;
	        uicomponent.addTextField("name", fieldName) ;
      	%>
          <script type="text/javascript">
          titleField = document.getElementById("title");
          titleField.onchange = function() { eXo.ecm.SELocalization.cleanName(this.value, "name"); } ;
          </script>
        </td>
			</tr>

      <tr>
        <td class="FieldLabel"><label for="content-lang"><%=_ctx.appRes("ElementSet.dialog.label.language")%></label></td>
        <td class="FieldComponent">
        <%
          String lang = org.exoplatform.portal.webui.util.Util.getPortalRequestContext().getLocale().toString();
          String[] fieldLang = ["jcrPath=/node/exo:language", "script=ecm-explorer/widget/FillSelectBoxWithLanguage.groovy", lang] ;
          uicomponent.addSelectBoxField("content-lang", fieldLang) ;
        %>
        </td>
      </tr>

			<tr>
			  <td class="FieldLabel"><label for="summary"><%=_ctx.appRes("Article.dialog.label.summary")%></label></td>
			  <td class="FieldComponent">
			    <div class="UIFCKEditor">
						<%
						  String[] fieldSummary = ["jcrPath=/node/exo:summary", "options=Basic", ""] ;
						  uicomponent.addRichtextField("summary", fieldSummary) ;
		      	%>
		      </div>
				</td>
			</tr>

			<tr>
			  <td class="FieldLabel"><label for="content"><%=_ctx.appRes("Article.dialog.label.content")%></label></td>
			  <td class="FieldComponent">
			    <div class="UIFCKEditor">
						<%
  						String[] fieldContent = ["jcrPath=/node/exo:text", "options=toolbar:CompleteWCM,'height:410px',noSanitization", ""] ;
  						uicomponent.addRichtextField("content", fieldContent) ;
			      %>
					</div>
				</td>
			</tr>

      <tr>
        <td class="FieldLabel"><%=_ctx.appRes("Article.dialog.label.lastModifiedDate")%></td>
        <td class="FieldComponent"><%=uicomponent.getLastModifiedDate()%></td>
      </tr>
		</table>
  </div>
  <% if (!uiform.isShowActionsOnTop()) {
            uiform.processRenderAction()
         }
  %>
  <%uiform.end()%>
</div>