<%-- /** * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ --%> <% boolean customizableLayout = !(group.isLayoutPrototype() || group.isLayoutSetPrototype() || group.isStagingGroup() || group.isUserGroup()) && layoutTypePortlet.isCustomizable() && LayoutPermissionUtil.containsWithoutViewableGroup(permissionChecker, layout, false, ActionKeys.CUSTOMIZE); boolean linkedLayout = (!SitesUtil.isLayoutUpdateable(layout) || (layout.isLayoutPrototypeLinkActive() && !group.hasStagingGroup())) && LayoutPermissionUtil.containsWithoutViewableGroup(themeDisplay.getPermissionChecker(), layout, false, ActionKeys.UPDATE); boolean modifiedLayout = (layoutSet != null) && layoutSet.isLayoutSetPrototypeLinkActive() && SitesUtil.isLayoutModifiedSinceLastMerge(layout) && hasLayoutUpdatePermission; %> <% boolean dockbarMessagesHidden = GetterUtil.getBoolean(SessionClicks.get(request, "dockbarMessagesHidden", "false")); %>
<% String taglibImage = "search"; String taglibMessage = "view-default-page"; if (!layoutTypePortlet.isCustomizedView()) { taglibMessage = "view-my-customized-page"; } else if (layoutTypePortlet.isDefaultUpdated()) { taglibImage = "activate"; taglibMessage = "the-defaults-for-the-current-page-have-been-updated-click-here-to-see-them"; } %> <% String taglibURL = "javascript:if (confirm('" + UnicodeLanguageUtil.get(pageContext, "are-you-sure-you-want-to-reset-your-customizations-to-default") + "')){submitForm(document.hrefFm, '" + HttpUtil.encodeURL(resetCustomizationViewURL) + "');}"; %>
Liferay.provide( window, 'toggleCustomizedView', function(event) { var A = AUI(); A.io.request( themeDisplay.getPathMain() + '/portal/update_layout', { data: { cmd: 'toggle_customized_view', customized_view: '<%= String.valueOf(!layoutTypePortlet.isCustomizedView()) %>', p_auth: '<%= AuthTokenUtil.getToken(request) %>' }, on: { success: function(event, id, obj) { window.location.href = themeDisplay.getLayoutURL(); } } } ); }, ['aui-io-request'] );
var toggleCustomizedView = A.one('#toggleCustomizedView'); if (toggleCustomizedView) { toggleCustomizedView.on('click', toggleCustomizedView); }
A.one('.info-link-container').on( 'click', function(event) { event.preventDefault(); var navAccountControls = event.currentTarget.ancestor('.nav-account-controls'); var infoItems = navAccountControls.one('.info-items'); navAccountControls.one('.info-items').toggleClass('hide'); Liferay.Store('dockbarMessagesHidden', infoItems.hasClass('hide')); } );