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/common/init.jsp" %>
\r
19 <c:if test="<%= PropsValues.MONITORING_PORTAL_REQUEST %>">
\r
20 <%@ include file="/html/common/themes/top_monitoring.jspf" %>
\r
23 <%@ include file="/html/common/themes/top_meta.jspf" %>
\r
24 <%@ include file="/html/common/themes/top_meta-ext.jsp" %>
\r
26 <link href="<%= themeDisplay.getPathThemeImages() %>/<%= PropsValues.THEME_SHORTCUT_ICON %>" rel="Shortcut Icon" />
\r
28 <%-- Available Translations --%>
\r
31 if (!themeDisplay.isSignedIn() && layout.isPublicLayout()) {
\r
32 String completeURL = PortalUtil.getCurrentCompleteURL(request);
\r
34 String canonicalURL = PortalUtil.getCanonicalURL(completeURL, themeDisplay, layout);
\r
37 <link href="<%= HtmlUtil.escapeAttribute(canonicalURL) %>" rel="canonical" />
\r
40 Locale defaultLocale = LocaleUtil.getDefault();
\r
43 <c:if test="<%= locale.equals(defaultLocale) %>">
\r
46 boolean showAlternateLinks = GetterUtil.getBoolean(layout.getTypeSettingsProperty("show-alternate-links"), true);
\r
48 if (showAlternateLinks) {
\r
49 Locale[] availableLocales = PortalUtil.getAlternateLocales(request);
\r
51 if (availableLocales.length > 1) {
\r
52 for (Locale curLocale : availableLocales) {
\r
53 if (!curLocale.equals(defaultLocale)) {
\r
56 <link href="<%= HtmlUtil.escapeAttribute(PortalUtil.getAlternateURL(canonicalURL, themeDisplay, curLocale)) %>" hreflang="<%= LocaleUtil.toW3cLanguageId(curLocale) %>" rel="alternate" />
\r
71 <%-- Portal CSS References --%>
\r
72 <%@ include file="/html/common/themes/top_css.jspf" %>
\r
74 <%-- Portal CSS --%>
\r
76 <link href="<%= HtmlUtil.escapeAttribute(PortalUtil.getStaticResourceURL(request, themeDisplay.getCDNDynamicResourcesHost() + themeDisplay.getPathContext() + "/html/css/main.css")) %>" rel="stylesheet" type="text/css" />
\r
78 <%-- Angularjs CSS --%>
\r
79 <link href="<%= HtmlUtil.escapeAttribute(PortalUtil.getStaticResourceURL(request, themeDisplay.getCDNDynamicResourcesHost() + themeDisplay.getPathContext() + "/html/css/angularjs/main.css")) %>" rel="stylesheet" type="text/css" />
\r
82 List<Portlet> portlets = null;
\r
84 if (layout != null) {
\r
85 String ppid = ParamUtil.getString(request, "p_p_id");
\r
87 if (ppid.equals(PortletKeys.PORTLET_CONFIGURATION)) {
\r
88 portlets = new ArrayList<Portlet>();
\r
90 portlets.add(PortletLocalServiceUtil.getPortletById(company.getCompanyId(), PortletKeys.PORTLET_CONFIGURATION));
\r
92 ppid = ParamUtil.getString(request, PortalUtil.getPortletNamespace(ppid) + "portletResource");
\r
94 if (Validator.isNotNull(ppid)) {
\r
95 Portlet portlet = PortletLocalServiceUtil.getPortletById(company.getCompanyId(), ppid);
\r
97 if (portlet != null) {
\r
98 portlets.add(portlet);
\r
102 else if (layout.isTypePortlet()) {
\r
103 portlets = layoutTypePortlet.getAllPortlets();
\r
105 if (themeDisplay.isStateMaximized() || themeDisplay.isStatePopUp()) {
\r
106 if (Validator.isNotNull(ppid)) {
\r
107 Portlet portlet = PortletLocalServiceUtil.getPortletById(company.getCompanyId(), ppid);
\r
109 if ((portlet != null) && !portlets.contains(portlet)) {
\r
110 portlets.add(portlet);
\r
115 else if ((layout.isTypeControlPanel() || layout.isTypePanel()) && Validator.isNotNull(ppid)) {
\r
116 portlets = new ArrayList<Portlet>();
\r
118 Portlet portlet = PortletLocalServiceUtil.getPortletById(company.getCompanyId(), ppid);
\r
120 if (portlet != null) {
\r
121 portlets.add(portlet);
\r
125 request.setAttribute(WebKeys.LAYOUT_PORTLETS, portlets);
\r
129 <%-- Portlet CSS References --%>
\r
131 <%@ include file="/html/common/themes/top_portlet_resources_css.jspf" %>
\r
133 <%-- Portal JavaScript References --%>
\r
135 <script type="text/javascript">
\r
136 var CKEDITOR_BASEPATH = '<%= themeDisplay.getPathJavaScript() %>/extjs/CKEditor/';
\r
139 <%@ include file="/html/common/themes/top_js.jspf" %>
\r
140 <%@ include file="/html/common/themes/top_js-ext.jspf" %>
\r
142 <%-- Portlet JavaScript References --%>
\r
144 <%@ include file="/html/common/themes/top_portlet_resources_js.jspf" %>
\r
149 List<String> markupHeaders = (List<String>)request.getAttribute(MimeResponse.MARKUP_HEAD_ELEMENT);
\r
151 if (markupHeaders != null) {
\r
152 for (String markupHeader : markupHeaders) {
\r
155 <%= markupHeader %>
\r
161 StringBundler pageTopSB = (StringBundler)request.getAttribute(WebKeys.PAGE_TOP);
\r
164 <c:if test="<%= pageTopSB != null %>">
\r
167 pageTopSB.writeTo(out);
\r
172 <%-- Theme CSS --%>
\r
174 <link class="lfr-css-file" href="<%= HtmlUtil.escapeAttribute(PortalUtil.getStaticResourceURL(request, themeDisplay.getPathThemeCss() + "/main.css")) %>" rel="stylesheet" type="text/css" />
\r
176 <%-- User Inputted Layout CSS --%>
\r
178 <c:if test="<%= (layout != null) && Validator.isNotNull(layout.getCssText()) %>">
\r
179 <style type="text/css">
\r
180 <%= layout.getCssText() %>
\r
184 <%-- User Inputted Portlet CSS --%>
\r
186 <c:if test="<%= portlets != null %>">
\r
187 <style type="text/css">
\r
190 for (Portlet portlet : portlets) {
\r
191 PortletPreferences portletSetup = PortletPreferencesFactoryUtil.getStrictLayoutPortletSetup(layout, portlet.getPortletId());
\r
193 String portletSetupCss = portletSetup.getValue("portletSetupCss", StringPool.BLANK);
\r
196 <c:if test="<%= Validator.isNotNull(portletSetupCss) %>">
\r
202 <%@ include file="/html/common/themes/portlet_css.jspf" %>
\r
206 catch (Exception e) {
\r
207 if (_log.isWarnEnabled()) {
\r
208 _log.warn(e.getMessage());
\r
223 private static Log _log = LogFactoryUtil.getLog("portal-web.docroot.html.common.themes.top_head_jsp");
\r