Skip to content

Instantly share code, notes, and snippets.

@saml
Created February 11, 2014 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saml/8937940 to your computer and use it in GitHub Desktop.
Save saml/8937940 to your computer and use it in GitHub Desktop.
<%--
Copyright 1997-2008 Day Management AG
Barfuesserplatz 6, 4001 Basel, Switzerland
All Rights Reserved.
This software is the confidential and proprietary information of
Day Management AG, ("Confidential Information"). You shall not
disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement you entered into
with Day.
==============================================================================
Default init script.
Draws the WCM initialization code. This is usually called by the head.jsp
of the page. If the WCM is disabled, no output is written.
==============================================================================
--%><%@include file="/libs/foundation/global.jsp" %><%
%><%@page import="com.day.cq.wcm.api.WCMMode,
com.day.cq.widget.HtmlLibraryManager" %><!-- ddd --><%
if (WCMMode.fromRequest(request) != WCMMode.DISABLED) {
HtmlLibraryManager htmlMgr = sling.getService(HtmlLibraryManager.class);
if (htmlMgr != null) {
htmlMgr.writeCssInclude(slingRequest, out, "cq.wcm.edit");
htmlMgr.writeJsInclude(slingRequest, out, "cq.wcm.edit");
}
String dlgPath = null;
if (editContext != null && editContext.getComponent() != null) {
dlgPath = editContext.getComponent().getDialogPath();
}
%><!-- /ddd -->
<script type="text/javascript" >
var fct = function() {
CQ.WCM.launchSidekick("<%= currentPage.getPath() %>", {
propsDialog: "<%= dlgPath == null ? "" : dlgPath %>",
locked: <%= currentPage.isLocked() %>
});
};
window.setTimeout(fct, 1);
</script><%
}
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment