<%  
  import org.apache.commons.lang.StringEscapeUtils;

  String link = uicomponent.getActionLink(); 
  String titleMessage = StringEscapeUtils.escapeJavaScript(_ctx.appRes("UIConfirmBox.label.Confirmation"));
  String addMessage = StringEscapeUtils.escapeJavaScript(_ctx.appRes("UIConfirmBox.label.ConfirmAdd"));
  String untitledMessage = StringEscapeUtils.escapeJavaScript(_ctx.appRes("UIWikiPageTitleControlArea.label.Untitled"));
  String confirmLabel = StringEscapeUtils.escapeJavaScript(_ctx.appRes("UIConfirmBox.label.Confirm"));
  String cancelLabel = StringEscapeUtils.escapeJavaScript(_ctx.appRes("UIConfirmBox.label.Cancel"));
  boolean isNewMode = uicomponent.isNewMode();
  String pageTitleInputId= uicomponent.getPageTitleInputId();
  def rcontext = _ctx.getRequestContext() ;  
  def requireJs = rcontext.getJavascriptManager().getRequireJS();
  requireJs.require("SHARED/UIWikiSavePage", "UIWikiSavePage");
  requireJs.require("SHARED/UIConfirmBox", "UIConfirmBox");
  requireJs.require("SHARED/UIForm", "UIForm");
%>
<button type="button" id="$uicomponent.id" onclick="if(eXo.wiki.UIWikiSavePage.confirm('$uicomponent.id', $isNewMode, '$pageTitleInputId', '$untitledMessage','$titleMessage', '$addMessage', 'SavePage Icon', '$confirmLabel','$cancelLabel')) $link;" class="btn btn-primary">
  <%=_ctx.appRes("UISubmitToolBar.action.SaveTemplate");%>
</button>

