<%
  import org.exoplatform.wiki.webui.UIWikiPortlet;
  
  String actionName = uicomponent.getActionName();
  String actionId = UIWikiPortlet.WIKI_PORTLET_ACTION_PREFIX + actionName;
  String anchor = "#" + actionName;
  String actionLink = uicomponent.getActionLink();
  boolean isAnchor = uicomponent.isAnchor();
  String labelName = _ctx.appRes(uicomponent.getParent().getName() +".action." + actionName);
  def rcontext = _ctx.getRequestContext() ;  
  def requireJs = rcontext.getJavascriptManager().getRequireJS();
  requireJs.require("SHARED/UIWikiAjaxRequest", "UIWikiAjaxRequest");
  requireJs.require("SHARED/UIForm", "UIForm");
%>
 
<% if (isAnchor)  {%>
  <a onclick="eXo.wiki.UIWikiAjaxRequest.makeNewHash('$anchor');" href="javaScript:void(0)"><i class="uiIcon$actionName"></i>$labelName</a>
  <a onclick="$actionLink" href="javaScript:void(0)" id="$actionId" style="display:none;">&nbsp;</a>
<%} else { %>
  <a onclick="$actionLink" href="javaScript:void(0)"><i class="uiIcon$actionName"></i>$labelName</a>
<%} %>
