3 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
\r
5 * This library is free software; you can redistribute it and/or modify it under
\r
6 * the terms of the GNU Lesser General Public License as published by the Free
\r
7 * Software Foundation; either version 2.1 of the License, or (at your option)
\r
10 * This library is distributed in the hope that it will be useful, but WITHOUT
\r
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
\r
12 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
\r
17 <%@ include file="/html/portal/layout/view/portlet_js.jspf" %>
\r
19 <%@ page import="com.liferay.portlet.sites.util.SitesUtil" %>
\r
21 <aui:script position="inline">
\r
22 Liferay.Util.addInputFocus();
\r
24 <c:if test="<%= (runtimePortletIds != null) && !runtimePortletIds.isEmpty() && !layoutTypePortlet.hasStateMax() %>">
\r
25 Liferay.Portlet.runtimePortletIds = ['<%= ListUtil.toString(portlets, Portlet.PORTLET_ID_ACCESSOR, "','") %>'];
\r
29 String controlPanelCategory = ParamUtil.getString(request, "controlPanelCategory");
\r
33 <c:when test="<%= themeDisplay.isStatePopUp() || Validator.isNotNull(controlPanelCategory) %>">
\r
34 Liferay.Util.getTop().Liferay.fire(
\r
39 windowName: Liferay.Util.getWindowName()
\r
46 String scroll = ParamUtil.getString(request, "scroll");
\r
49 <c:if test="<%= Validator.isNotNull(scroll) %>">
\r
53 document.getElementById('<%= HtmlUtil.escape(scroll) %>').scrollIntoView();
\r
61 <aui:script use="aui-base">
\r
62 Liferay.Util.addInputType();
\r
64 Liferay.Portlet.ready(
\r
65 function(portletId, node) {
\r
66 Liferay.Util.addInputType(node);
\r
74 LayoutRevision layoutRevision = null;
\r
76 if (layout != null) {
\r
77 group = layout.getGroup();
\r
79 layoutRevision = LayoutStagingUtil.getLayoutRevision(layout);
\r
83 <c:if test="<%= !themeDisplay.isStatePopUp() && !group.isControlPanel() && (layout != null) && (!group.hasStagingGroup() || group.isStagingGroup()) && (GroupPermissionUtil.contains(permissionChecker, scopeGroupId, ActionKeys.ADD_LAYOUT) || LayoutPermissionUtil.contains(permissionChecker, layout, ActionKeys.UPDATE) || (layoutTypePortlet.isCustomizable() && LayoutPermissionUtil.contains(permissionChecker, layout, ActionKeys.CUSTOMIZE))) %>">
\r
84 <c:if test="<%= layout.isTypePortlet() %>">
\r
86 <%-- MIGRATION MODIFICATION --%>
\r
87 if(typeof Liferay.Data == 'undefined'){
\r
90 Liferay.Data.layoutConfig = {
\r
91 container: '#main-content',
\r
94 <c:when test="<%= !themeDisplay.isFreeformLayout() %>">
\r
95 dropNodes: '.portlet-column',
\r
96 handles: ['.portlet-title', '.portlet-title-default'],
\r
99 dropNodes: '.portlet-boundary',
\r
101 freeformPlaceholderClass: 'lfr-freeform-layout-drag-indicator',
\r
102 handles: ['.portlet-header-bar', '.portlet-title-default', '.portlet-topper'],
\r
106 disabledDropContainerClass: 'portlet-dropzone-disabled',
\r
107 dragNodes: '.portlet-boundary:not(.portlet-static)',
\r
108 dropContainer: '.portlet-dropzone',
\r
109 emptyColumnClass: 'empty',
\r
110 invalid: '.portlet-static',
\r
111 nestedPortletId: '_<%= PortletKeys.NESTED_PORTLETS %>_INSTANCE',
\r
112 portletBoundary: '.portlet-boundary'
\r
116 <aui:script use="liferay-layout">
\r
117 <%-- aui:script won't accept a null body --%>
\r
121 <aui:script use="liferay-navigation">
\r
125 new Liferay.Navigation(
\r
127 hasAddLayoutPermission: <%= GroupPermissionUtil.contains(permissionChecker, scopeGroupId, ActionKeys.ADD_LAYOUT) %>,
\r
131 for (int i = 0; (layouts != null) && (i < layouts.size()); i++) {
\r
132 Layout curLayout = (Layout)layouts.get(i);
\r
134 boolean updateable = SitesUtil.isLayoutUpdateable(curLayout);
\r
135 boolean deleteable = updateable && LayoutPermissionUtil.contains(themeDisplay.getPermissionChecker(), curLayout, ActionKeys.DELETE);
\r
139 deletable: <%= deleteable %>,
\r
140 id: <%= curLayout.getLayoutId() %>,
\r
141 updateable: <%= updateable %>
\r
150 <c:if test="<%= layoutRevision != null %>">
\r
151 layoutSetBranchId: '<%= layoutRevision.getLayoutSetBranchId() %>',
\r
160 var navBlock = A.one('#navigation');
\r
166 Liferay.fire('initNavigation');
\r
173 <aui:script use="liferay-menu,liferay-notice,liferay-poller">
\r
174 new Liferay.Menu();
\r
176 <%-- MIGRATION MODIFICATION --%>
\r
177 if(typeof Liferay.Data == 'undefined'){
\r
181 if(typeof(Liferay.Data.notices)=='undefined'){
\r
182 Liferay.Data.notices = {};
\r
185 var liferayNotices = Liferay.Data.notices;
\r
187 for (var i = 1; i < liferayNotices.length; i++) {
\r
188 new Liferay.Notice(liferayNotices[i]);
\r
191 <c:if test="<%= themeDisplay.isSignedIn() %>">
\r
192 Liferay.Poller.init(
\r
194 encryptedUserId: '<%= Encryptor.encrypt(company.getKeyObj(), String.valueOf(themeDisplay.getUserId())) %>',
\r
195 supportsComet: <%= ServerDetector.isSupportsComet() %>
\r